Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 12 of 12

Thread: Custom Reports

  1. #1
    Richnyc30 is offline Senior Member
    Join Date
    Mar 2009
    Posts
    340

    Default Custom Reports

    Wher e is some understandable docs on Custom Reports. I read the manual and support docs and don't know how to put it in the menu.

  2. #2
    ASPAlfred is offline Senior Member
    Join Date
    Nov 2007
    Posts
    2,244

    Default

    We have directions on how to do that, refer to Creating Custom Reports For Use Within The Admin Site.

  3. #3
    Richnyc30 is offline Senior Member
    Join Date
    Mar 2009
    Posts
    340

    Default I did read the knowledgebase doc

    Does the report magically appear after testing the sql statement? At least it seems like magic if you read the doc.
    What about complex reports? What's that do to the grid it magically apears in?

  4. #4
    ASPAlfred is offline Senior Member
    Join Date
    Nov 2007
    Posts
    2,244

    Default

    The results won't come up until you go to the admin navigate to Orders -> Reports -> Customer Reports and select your report from the drop down box and it will be populated in a datagrid below. This is clearly stated in the KB.

  5. #5
    Richnyc30 is offline Senior Member
    Join Date
    Mar 2009
    Posts
    340

    Default What is the magic?

    So once run in the SQL menu choice under Configuration the report will show up in the menu of Reports? Is the SQL statement saved in SQL Server? This is what I don't understand. I read the doc several times.

  6. #6
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    Yes, it is saved on the CustomReport table under the SQLCommand column

  7. #7
    Richnyc30 is offline Senior Member
    Join Date
    Mar 2009
    Posts
    340

    Default External formating on Report

    The auto response to a report SQL query is a grid. Any way to change that to an external xml or html formating?

  8. #8
    Bastian33o2 is offline Member
    Join Date
    May 2008
    Posts
    44

    Default Custom Report

    What would be the SQL Query to get a custom report for the following

    Monthly report with the following data:

    Customer Level 1
    Monthly Dollar Amount
    Monthly Number of Orders


    I would like to get a report for the entire past year with each month separately.

    Thanks for any help.
    MultiStore 9.3.1.1

  9. #9
    DanV's Avatar
    DanV is offline Ursus arctos horribilis
    Join Date
    Apr 2006
    Posts
    1,568

    Default

    This should do it... Extracts order totals, number of orders, and groups them by customer level ID by month

    Code:
    SELECT	DATEPART(MONTH, o.OrderDate) AS [Month],
    		c.CustomerLevelID,
    		SUM(OrderTotal) AS [OrderTotals],
    		COUNT(*) AS NumberOfOrders
    	FROM Orders o
    	JOIN Customer c on o.CustomerID = c.CustomerID
    	WHERE o.Deleted = 0
    		AND o.TransactionState = 'CAPTURED'
    		AND o.OrderDate >= '01/01/2009'
    		AND o.OrderDate <= '12/31/2009'
    	GROUP BY c.CustomerLevelID, DATEPART(MONTH, OrderDate)

  10. #10
    Bastian33o2 is offline Member
    Join Date
    May 2008
    Posts
    44

    Default Custom Report

    Dan,

    Thank you for your help but can you post a complete SQL command together with the beginning:

    INSERT INTO CustomReport (Name, Description, SQLCommand)
    VALUES ('Test Report', 'Test Description of our report', 'SELECT Email, BIllingZip FROM ORDERS')

    When I execute your command, it gets executed but nothing happens. No custom report to be seen.

    Thanks much!
    MultiStore 9.3.1.1

  11. #11
    ASPAlfred is offline Senior Member
    Join Date
    Nov 2007
    Posts
    2,244

    Default

    Try this:

    Code:
    INSERT INTO CustomReport (Name, Description, SQLCommand)
    VALUES ('Monthly Report', 'Monthly Report based on customer level Amount and no of orders', 'SELECT	DATEPART(MONTH, o.OrderDate) AS [Month],
    		c.CustomerLevelID,
    		SUM(OrderTotal) AS [OrderTotals],
    		COUNT(*) AS NumberOfOrders
    	FROM Orders o
    	JOIN Customer c on o.CustomerID = c.CustomerID
    	WHERE o.Deleted = 0
    		AND o.TransactionState = ''CAPTURED''
    		AND o.OrderDate >= ''01/01/2009''
    		AND o.OrderDate <= ''12/31/2009''
    	GROUP BY c.CustomerLevelID, DATEPART(MONTH, OrderDate)')

  12. #12
    Bastian33o2 is offline Member
    Join Date
    May 2008
    Posts
    44

    Default Custom Reports

    Thank you Alfred. This worked perfectly!
    MultiStore 9.3.1.1