Designed for the industrial world, Dream Report offers both Command Line automation as well as Web Service automation.

Command Line Automation

The Dynamic Report Generator (DRG) can generate predefined reports for the currently running project, changing report definition properties at runtime, such as the time period and item.  All dynamic modifications of the report properties will be done only for that specific report execution and will not be saved in the report layout.  If you have a running project containing a daily report, and you generate this report using DRG, applying a new period of 1 hour, for example, will generate an hourly report file. The original report will continue to run and generate daily reports as before.

DRG has 2 working modes: silent and with a user interface.

If a user runs generation command with additional command line parameters, the DRG will not open any user interface and will execute the command in a silent mode, i.e. pass the command to the runtime manager to generate the selected report for the specified period.

The Command line has the following available formats for generation requests:

-generate This argument will say that generation request will be performed. The following parameters are possible
-name Report name
-instance Report instance name
-fixPeriod This argument will indicate that the fixed time period is used
-absPeriod This argument will indicate that the absolute time period is used
-relPeriod This argument will indicate that the relative time period is used
-batchRelPeriod This argument will indicate that the batch-based relative time period is used
-batchAbsPeriod This argument will indicate that the batch-based absolute time period is used
-timeStart Time that defines start of period
-timeEnd Time that defines end of period
-batchDef Name of the batch definition to be uses
-batchRel Mode for the relative batch ID (it can be “last” or “current”)
-batchCount Number of batches to count
-batchIdStart ID of the batch for the report start
-batchIdEnd ID of the batch for the report end
-currentTime This argument will set the current time for the report.

Target for the report can be “pdf”, “email”, “printer”, “excel” (see examples below)

-fileParam File to be used as a file with the parameters for preprocessor

NOTE: If -fixPeriod is used, then -timeStart has to provide one of the following arguments: “last day”, “last n days”, “last hour”, “last n hours”, “last week”, “last n weeks”, “last month” and “last n months”, “Current day”, “Current hour”, “Current week”, “Current month”, “Current quarter”, where n is a number from 1 to 500.

Examples:

  • rtm.exe -generate -name Report_1 -instance Instance_1 -fixPeriod “last 10 hours”
  • rtm.exe -generate -name Report_1 -instance Instance_1 -absPeriod -timeStart “31/12/2010 00:00:00” -timeEnd “01/01/2011 00:00:00”
  • rtm.exe -generate -name Report_1 -instance Instance_1 -relPeriod -timeStart 10-2:30:30 -timeEnd 5-2:30:30
  • rtm.exe -generate -name Report_1 -instance Instance_1 -batchRelPeriod -batchDef MyBatch -batchRel last -batchCount 2
  • rtm.exe -generate -name Rep1 -instance Inst1 -batchAbsPeriod -batchDef MyBatch -batchIdStart 120 -batchIdEnd 130
  • rtm.exe -generate -name Rep1 -instance Inst1 -currentTime 2010-12-02 18:00:20
  • rtm.exe -generate -name Rep1 -instance Inst1 -target pdf excel email printer
  • rtm.exe -generate -name Rep1 -instance Inst1 -fileParam “C:\Data\params.xml”

Examples of targets for the report:

-t pdf
-t pdf excel
-t pdf excel email
-t pdf excel email printer

NOTES:

Report target “printer” will send output files for printing according to the printer settings of the report file format of the Dream Report Studio. That means that no matter which targets have been defined in the cmd command, the printer will receive only those files which have been defined in the Dream Report Studio Report Settings.

If the generated report needs to be delivered to email, the user must always add the generated report output format (PDFor/and Excel) to the “-t email” command line.

Example:

“-t pdf email” – report will be sent to the defined email with the report generated in PDF format;
“- t excel email” – report will be sent to the defined email with the report generated in Excel format;
“- t pdf excel email” – report will be sent to the defined email with the report generated in PDF and Excel format.

 

Web Service Automation

Report generation via the Web Service can be requested with help of following URL:
http:/hostname/DRWeb/WebAPI/GenReport.aspx?report=PDF%20Report&start=2000-10-11%2012:13:14&stop=2001-11-12%2013:14:15&ptype=abs&param1=1&param2=3&param3=hello

where:
report – contains name of the report that has to be generated, e.g. report=Report_0
instance – contains name of the instance of specified report to be generated, e.g. instance=Inst_1
ptype – time period type for report generation, currently only absolute is supported, e.g. ptype=abs
start – contains start of the report generation time period, e.g. start=2012-08-25 10:00:00
stop – contains end of the report generation time period, e.g. stop=2012-09-01 10:00:00
format – contains format of report to be generated, e.g. format=1 for PDF, format=4 for excel
target – contains output target for report, 2 for printer, 16 for email
other parts like param1, param2 are considered as report parameters and will be passed to report generator.

Note:
If variable values contain characters prohibited in URL they have to be encoded for URL format. For example: encodeURIComponent(“2012-09-03 10:00:00”) which will result in 2012-09-03%2010:00:00.

Parameters for report generation e.g. param1, param2, etc. cannot have the same name as URL parts. Reserved words are: report, instance, ptype, start, stop, format, target, user, pwd, fcolor, bgcolor, lang