Docs/tutorials for writing custom reports

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
ksolito
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 42
Joined: Tue Nov 25, 2008 3:16 pm

Docs/tutorials for writing custom reports

Post by ksolito » Thu May 21, 2009 1:49 pm

Store owner would like some customized reports. For starters, one listing inventory by manufacturer, and another listing low inventory by manufacturer. I suspect more will be required in the future.

Are there any documents or threads about general reporting process and creating custom reports?

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

Re: Docs/tutorials for writing custom reports

Post by mazhar » Fri May 22, 2009 4:56 am

You can write new reports via writing your custom queries
http://wiki.ablecommerce.com/index.php/Custom_Queries

Also there are many code samples available in forums about data access, check
viewforum.php?f=47

Here are some mods discussed in reports
viewtopic.php?f=44&t=9101
viewtopic.php?f=44&t=8713
viewtopic.php?f=42&t=8873
viewtopic.php?f=45&t=8496

ksolito
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 42
Joined: Tue Nov 25, 2008 3:16 pm

Re: Docs/tutorials for writing custom reports

Post by ksolito » Tue Nov 10, 2009 4:34 pm

mazhar,

I viewed the sample on wiki but I am still unclear on how to retreive and process the sql query return.

I have something like this:

Code: Select all

       CommerceBuilder.Data.Database database = Token.Instance.Database;
       string sql = ("<my really comprehensive inventory query that is tested and debugged in SQL Mgmt Express>");
       using (System.Data.Common.DbCommand selectCommand = database.GetSqlStringCommand(sql))
       {
           database.ExecuteScalar(selectCommand);
I want to iterate through the returned data and build a report.

vieodesign
Ensign (ENS)
Ensign (ENS)
Posts: 9
Joined: Tue Dec 08, 2009 8:50 am

Re: Docs/tutorials for writing custom reports

Post by vieodesign » Tue Jan 05, 2010 11:24 am

Has anyone ever done a basic, step by step how-to for changing or adding a custom report? That would be wildly helpbul. In my case, I'm trying to follow the examples, but what in the world is the .aspx.cs file for? What does it do and do I need to create one (and how)?

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

Re: Docs/tutorials for writing custom reports

Post by mazhar » Wed Jan 06, 2010 5:05 am

vieodesign wrote:Has anyone ever done a basic, step by step how-to for changing or adding a custom report? That would be wildly helpbul. In my case, I'm trying to follow the examples, but what in the world is the .aspx.cs file for? What does it do and do I need to create one (and how)?
You need to call execture reader on you db command that will retrun you a reader to itterate over your returned data. For example

Code: Select all

using(IDataReader dr = database.ExecuteScalar(selectCommand))
{
while(dr.Read())
{
//Here read columns from current row read by reader like
int id = AlwaysConvert.ToInt(dr[0]);
string name = AlwaysConvert.ToString(dr[1]);
}
dr.Close();
}

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

Re: Docs/tutorials for writing custom reports

Post by mazhar » Wed Jan 06, 2010 5:08 am

vieodesign wrote:Has anyone ever done a basic, step by step how-to for changing or adding a custom report? That would be wildly helpbul. In my case, I'm trying to follow the examples, but what in the world is the .aspx.cs file for? What does it do and do I need to create one (and how)?
I think there was something about a custom report available at plugables.com, have a look at here
http://blog.plugables.com/tag/report/

Post Reply