ShowReport Script Examples: Difference between revisions

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search
(403051)
 
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
This page contains script examples for the [[Supported_QPR_ProcessAnalyzer_Commands_in_Scripts#--.23ShowReport|ShowReport]] script command.
This page contains script examples for the [[SQL Scripting Commands#--.23ShowReport|ShowReport]] script command.


The following example opens the data table identified by data table name "SqlTable" and project name "Test" as a report.
The following example reads datatable by name "SqlTable" and project name "Test" as a report to a temporary table, and then creates a CSV file "Report1.csv" containing the datatable contents.
<pre>
<pre>
(SELECT 'AnalysisType', '18') UNION ALL
(SELECT 'AnalysisType', '18') UNION ALL
Line 11: Line 11:
SELECT * FROM #AnalysisResult;  
SELECT * FROM #AnalysisResult;  
(SELECT 'Title', 'Report1') UNION ALL
(SELECT 'Title', 'Report1') UNION ALL
(SELECT 'SheetName', 'Sheet1') UNION ALL
(SELECT 'MaximumCount', '0')  
(SELECT 'MaximumCount', '0')  
--#ShowReport  
--#ShowReport  
</pre>
</pre>
The following script will create contents to a temporary table, and then show a pivot table from those contents.
<pre>
(SELECT 'AnalysisType', '5') UNION ALL
(SELECT 'SelectedCaseAttributes', '*') UNION ALL
(SELECT 'FilterId', CAST(@_FilterId AS NVARCHAR)) UNION ALL
(SELECT 'TargetTable', '#AnalysisResult')
--#GetAnalysis
(SELECT * FROM [#AnalysisResult])
(SELECT 'Title', 'Report1') UNION ALL
(SELECT 'SheetName', 'ShowReportResult') UNION ALL
(SELECT 'PivotSheetName', 'Pivot') UNION ALL
(SELECT 'PivotTitle', 'Pivot report name') UNION ALL
(SELECT 'PivotRows', 'Account Manager') UNION ALL
(SELECT 'PivotColumns', 'Region') UNION ALL
(SELECT 'PivotValues', 'Duration Days')
--#ShowReport
</pre>


[[Category:Examples]]
[[Category:Examples]]

Latest revision as of 15:29, 15 December 2021

This page contains script examples for the ShowReport script command.

The following example reads datatable by name "SqlTable" and project name "Test" as a report to a temporary table, and then creates a CSV file "Report1.csv" containing the datatable contents.

(SELECT 'AnalysisType', '18') UNION ALL
(SELECT 'ProjectName', 'Test') UNION ALL
(SELECT 'DataTableName', 'SqlTable') UNION ALL
(SELECT 'TargetTable', '#AnalysisResult')
--#GetAnalysis

SELECT * FROM #AnalysisResult; 
(SELECT 'Title', 'Report1') UNION ALL
(SELECT 'MaximumCount', '0') 
--#ShowReport