How to add some custom report(s) within the E-Commerce reporting category

   —   
This article describes how to add some custom report(s) within the E-Commerce reporting category in CMSDesk -> Tools -> E-commerce -> Reports.
When you take a look into Reports tab in E-commerce section in your CMSDesk, you will see several pre-defined reports:


These reports are hard-coded and you cannot add a new one by some native way, using the user interface. Anyway, you can create some custom reports.  You may want to show it in this e-commerce section. In this case, you need to modify <project folder>/CMSModules/Reporting/Tools/Ecommerce/reports_tree.aspx.cs file and add your custom report here manually. By default, there is following code:

string[,] reports = { {"{$Ecommerce.NumberOfOrdersPerYear_caption$}", "EcommNumberOfOrdersPerYear", "ecommerce_order.gif"},
{"{$Ecommerce.NumberOfOrdersPerMonth_caption$}", "EcommNumberOfOrdersPerMonth", "ecommerce_order.gif"},
{"{$Ecommerce.NumberOfOrdersPerDay_caption$}", "EcommNumberOfOrdersPerDay", "ecommerce_order.gif"},
{"{$Ecommerce.SalesPerYear_caption$}", "EcommSalesPerYear", "ecommerce_sales.gif"},
{"{$Ecommerce.SalesPerMonth_caption$}", "EcommSalesPerMonth", "ecommerce_sales.gif"},
{"{$Ecommerce.SalesPerDay_caption$}", "EcommSalesPerDay", "ecommerce_sales.gif"},
{"{$Ecommerce.Inventory_caption$}", "EcommInventory", "ecommerce_product.gif"},
{"{$Ecommerce.Top100CustByVolOfSales_caption$}","EcommTop100CustByVolOfSales", "ecommerce_customer.gif"},
};


You can add your own report in here by changing the code above like this:

string[,] reports = { {"{$Ecommerce.NumberOfOrdersPerYear_caption$}", "EcommNumberOfOrdersPerYear", "ecommerce_order.gif"},
{"{$Ecommerce.NumberOfOrdersPerMonth_caption$}", "EcommNumberOfOrdersPerMonth", "ecommerce_order.gif"},
{"{$Ecommerce.NumberOfOrdersPerDay_caption$}", "EcommNumberOfOrdersPerDay", "ecommerce_order.gif"},
{"{$Ecommerce.SalesPerYear_caption$}", "EcommSalesPerYear", "ecommerce_sales.gif"},
{"{$Ecommerce.SalesPerMonth_caption$}", "EcommSalesPerMonth", "ecommerce_sales.gif"},
{"{$Ecommerce.SalesPerDay_caption$}", "EcommSalesPerDay", "ecommerce_sales.gif"},
{"{$Ecommerce.Inventory_caption$}", "EcommInventory", "ecommerce_product.gif"},
{"{$Ecommerce.Top100CustByVolOfSales_caption$}","EcommTop100CustByVolOfSales", "ecommerce_customer.gif"},
{"My custom report","custom", null}
};


Second parameter - custom, is code name of your report.


Update for version 6:

You can add a new report in CMS Site Manager -> Development -> Modules -> E-commerce -> User Interface -> Orders -> Reports. You can take an inspiration from the other UI elements there and register a new one there. You can use the target URL for example:

~/CMSModules/Reporting/Tools/Ecommerce/Reports.aspx?
statcodename=EcommNumberOfOrdersPerDay&
reportcodename=EcommNumberOfOrdersPerDay&
displayfilter=1


which will display the report with the code name: 'EcommNumberOfOrdersPerDay' and its input for a parameter (displayfilter=1).




See also: Reporting module


Applies to: Kentico CMS 4.x, an update for 6.x
Share this article on   LinkedIn

Juraj Ondrus

Hi, I am the Technical support leader at Kentico. I'm here to help you use Kentico and get as much as possible out of it.