Custom reports

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
KCarlson
Lieutenant (LT)
Lieutenant (LT)
Posts: 71
Joined: Mon Dec 13, 2004 5:35 pm
Location: Santa Barbara, CA
Contact:

Custom reports

Post by KCarlson » Tue Apr 20, 2010 5:17 pm

Is it possible to do custom reports in AC7 without having the source code? I did some custom reports in AC5, but looking at the code for reports in AC7 it looks much harder to do your own. I need to get a report by payment type, like the daily sales report, but with the utilized payment methods as the rows instead of the individual order ids.

User avatar
Shopping Cart Admin
AbleCommerce Admin
AbleCommerce Admin
Posts: 3055
Joined: Mon Dec 01, 2003 8:41 pm
Location: Vancouver, WA
Contact:

Re: Custom reports

Post by Shopping Cart Admin » Tue Apr 20, 2010 5:53 pm

Hello,

Both are written in asp.net which is pretty easy to access the database information. So I wouldn't think either product has an edge in report creation. The source code wouldn't be needed at all.
Thanks for your support

Shopping Cart Guru
AbleCommerce.com
Follow us on Facebook

KCarlson
Lieutenant (LT)
Lieutenant (LT)
Posts: 71
Joined: Mon Dec 13, 2004 5:35 pm
Location: Santa Barbara, CA
Contact:

Re: Custom reports

Post by KCarlson » Tue Apr 20, 2010 6:09 pm

But the new ones use the ReportDataSource class which has methods that I can't change or add to. The reports in Able 5 used SQL which made them easier to modify. I could write them from scratch using SQL, but some of them I just want to add a field to. For example, I would like to add item counts to the daily sales report.

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

Re: Custom reports

Post by mazhar » Wed Apr 21, 2010 7:26 am

Either you are looking to show order items count against each order entry in reprot or want to show total order numbers on report I think its possiable without source ReportDataSource. If this is the order item count then add new column to gridview. Add a new method called int CountOrderItems(Object dataItem) in back end code. Finally use this method in new column something like

Code: Select all

<%#CountOrderItems(Container.DataItem)%> 
and method code should be something like

Code: Select all

protected int CountOrderItems(Object dataItem) 
    {
        OrderSummary summary = (OrderSummary)dataItem;
        Order order = OrderDataSource.Load(summary.OrderId);
        int productCount = 0;
        foreach (OrderItem orderItem in order.Items)
            if (orderItem.OrderItemType == OrderItemType.Product)
                productCount++;
        return productCount;
    }

KCarlson
Lieutenant (LT)
Lieutenant (LT)
Posts: 71
Joined: Mon Dec 13, 2004 5:35 pm
Location: Santa Barbara, CA
Contact:

Re: Custom reports

Post by KCarlson » Wed Apr 21, 2010 10:39 am

Thanks. That will really help. I will try that this morning. I would also like the ability to add new reports. For example, a report on the payment types used for a date range of orders. Would I need to add a method for ReportDataSource to do that?

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

Re: Custom reports

Post by mazhar » Wed Apr 21, 2010 11:08 am

You don't need to add any thing to ReportDataSource. You can crate your custom class under with custom queries under App_Code folder of your website. Finally you can create your report UI and make use of your custom class to fetch the desired data against desired input.

KCarlson
Lieutenant (LT)
Lieutenant (LT)
Posts: 71
Joined: Mon Dec 13, 2004 5:35 pm
Location: Santa Barbara, CA
Contact:

Re: Custom reports

Post by KCarlson » Wed Apr 21, 2010 1:17 pm

While I have you in a discussion, one example of a modification to an existing report I need is the product breakdown report. It would be good if we could see the variants in that.

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

Re: Custom reports

Post by mazhar » Thu Apr 22, 2010 7:37 am

We have number of partners who provide custom development services. Have a look at partners page.
http://www.ablecommerce.com/Development ... 11C33.aspx

Post Reply