Add to Inventory report?

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
niall08
Commander (CMDR)
Commander (CMDR)
Posts: 175
Joined: Tue Dec 09, 2008 10:29 am

Add to Inventory report?

Post by niall08 » Wed Mar 18, 2009 3:34 am

Under MANAGE > INVENTORY in the admin, has anyone:

1) Added a new field, like SKU, and been able to sort according to that new field; and
2) Rather than paging used an alphabet-based navigation system to navigate through the inventory items?

The current inventory controls seems fine, but proves to be cumbersome and almost useless when a full inventory is uploaded..

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Add to Inventory report?

Post by jmestep » Wed Mar 18, 2009 6:14 am

You could probably do that and then change the sort expression in the gridview control:
<cb:SortedGridView ID="InventoryGrid" DefaultSortExpression="Name"
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

niall08
Commander (CMDR)
Commander (CMDR)
Posts: 175
Joined: Tue Dec 09, 2008 10:29 am

Re: Add to Inventory report?

Post by niall08 » Wed Mar 18, 2009 7:01 am

No.. I've tried that - it throws an SQL error:

"ORDER BY items must appear in the select list if the statement contains a UNION, INTERSECT or EXCEPT operator"

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Add to Inventory report?

Post by mazhar » Wed Mar 18, 2009 8:14 am

You can get Sku added to report by first adding follwing metod to code file

Code: Select all

protected string GetSku(Object productId) 
    {
        Product product = ProductDataSource.Load(AlwaysConvert.ToInt(productId));
        return (product != null) ? product.Sku : string.Empty;
    }
and then adding a new column to grid

Code: Select all

 <asp:TemplateField HeaderText="Sku">
                            <ItemStyle HorizontalAlign="Center" />
                            <ItemTemplate>
                                <asp:Label ID="Sku" runat="server" Text='<%# GetSku(Eval("ProductId")) %>' Columns="4"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
In order to enable sort by sku you will need to write your own query, current function does not support order by Sku.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Add to Inventory report?

Post by mazhar » Wed Mar 18, 2009 8:17 am

Following options will be available for sorting on report

Code: Select all

ProductId, Name,InStock, InStockWarningLevel

niall08
Commander (CMDR)
Commander (CMDR)
Posts: 175
Joined: Tue Dec 09, 2008 10:29 am

Re: Add to Inventory report?

Post by niall08 » Wed Mar 18, 2009 10:33 am

Thanks Mazhar - I already had the SKU value added, and removed the "SortExpression" attribute so that the column was effectly dead.

I'll have a look at writing my own query..

Post Reply