Running the Grouped Report

Unlike the static and dynamic reports, grouped reports will not appear in Commerce Server Business Desk. Grouped reports are executed by calling the ReportRenderer2.dll public interfaces, as shown in the following Visual Basic code.

You can execute the grouped report script multiple times, which may be necessary during report development. Each set of grouped reports is uniquely identified by a GUID in its name. No reports will be overwritten.

After the grouped report has been run there will be a new entry in the GroupReportJob table and the reports will be in the cataloged in the GroupReportStatus table.

' Instantiate ReportRenderer2.dll
   Dim objReport As New ReportRenderer2

' Set the Report locale (the default value is 1033 if it is not set).
' This is used to format the dates in the report header.
   objReport.ReportLocale = 1033

' Set the report directory where the grouped reports are to be created
   objReport.ReportDirectory = "C:\Inetpub\wwwroot\retailbizdesk\analysis\Completed Reports"

' Get the correct connection string based on the site name
   Dim configObject As new SiteConfigReadOnly '(MSCSCfg.dll)
   Dim olapConstr, dwConstr

   Set configObject = New SiteConfigReadOnly
   configObject.Initialize("Retail")
   dwConStr = configObject.Fields("Global Data Warehouse").Value.Fields("ConnStr_db_dw").Value
OlapConStr = configObject.Fields("Global Data Warehouse").Value.Fields("ConnStr_OLAP").Value
   Set configObject = Nothing

' Execute the grouped report
   ' ReportID is the ID from the Report table for the grouped report to be executed
   ' DW conn string is the connection string to the DW
   '   This query can be use to obtaiin this conn string: Select s_Value from ResourceProps where s_PropertyName = 'connstr_db_dw'
   ' OLAP conn string is only needed for grouped OLAP reports
   '   This query can be use to obtain this conn string: Select s_Value from ResourceProps where s_PropertyName = 'ConnStr_OLAP' 
   objReport.ExecGroupedReport("ReportID|DW conn string|OLAP conn string")
Set objReport = Nothing

Copyright © 2005 Microsoft Corporation.
All rights reserved.