Create a business rule that defines and outputs a list containing the date you want to print.
Catalog the business rule and extract the DataNames.
Drag the new report Class from the Component Store into your mvDesigner Library.
Open your mvDesigner report in design mode.
Drag your business rule from the mvDCatalog group of the Enterprise Browser to your report and select $getreportdata as your event.
Drag a report entry field from the Component Store to the report.
Drag a column from the list extracted from your business rule from the DataNames group of the Enterprise Browser to the entry field.
Repeat procedure 2 until you have all the desired field on your report.
Drag a business rule that performs the changes to a report field to a report field to override the value and modify properties (such as color of the field that is to be printed).
Select the '$print' event.
Call w3GetVal(PrintValue,"iMvdPrintValue")
Retrieves the value about to be printed.
Call w3GetVal(RecCount,"w3TriggerParam.pRecCount")
Retries the number of records printed so far.
Call w3GetVal(TriggerObject")
Call w3mvDPropertyChange(TriggerObject,"textcolor","kBlue")
Changes the text color of the field you are printing to blue.
Open an mvDesigner window in design and add a control, such as Push Button to start the report.
Drag your report from the Enterprise Browser from the new reports group to your control.
Select the click event, select Start New Print Job check box, and your preferred print options.
Open an mvD Remote form in design and add a Printing Control and another control, such as Push Button to start the report.
Drag your report from the new reports group of the Enterprise Browser to the control used to start the report.
Select the click event, select Start New Print Job check box, then select your preferred print options.
Enter the name of your Printing Control in the print field.
Open the mvD Toolbar or menu in design and add a control or menu line.
Drag your report from the new reports group of the Enterprise Browser to your control or menu line.
Select the click event, select the Start New Print Job check box, then select your preferred print options.
|
NOTE |
To perform batch printing the business rule that you dropped into the mvDesigner report class must have a persistent connection. |
Select batch printing when you drag the report to the control used to start the report.
Add an additional control, such as Progress Bar or Push Button to your class, which will be used to print the remaining batches of data.
Drag the report from the reports group of the Enterprise Browser to this control and do not select Start New Print Job.
Type the w3mvDPropertyChange command to start your report in BASIC (although it is intended to implement an encapsulation of this command called w3mvDPrintReport).
Call w3mvDPropertyChange("$$cinst","$openreport(’REPORTS’, ’rReportName’,1,’kDevScreen’)","REQUIRED")
Drag the report to your cataloged business rule.
Select the $construct event if you wish to pass values from the window or remote form that opens the report to your business rule.
Note that your business rule must have a persistent connection. Values can be accessed using:
Call w3GetVal(FormFieldValue,"FormFieldValue")
Drag the business rule to your data grid or graph component report, which returns the data for the list onto the component.
If you are performing batch printing, this business rule must be the same as the one used for fetching the data and must have a persistent connection.
The rule must return the data for the data grid or graph in iMvdSubList with the columns defined as Col1, Col2, Col3, and so on.
Report parameters, such as the print destination and the path of the output file, can be set up by the user in BASIC using the w3mvDPropertyChange command.
Call w3mvDPropertyChange("$root","$cdevice","kDevFile")
Call w3mvDPropertyChange("$root.$prefs","$printfile", "z:\windows\desktop\printfile.prn")
Call w3mvDPropertyChange("$root","$cdevice","kDevHtml")
Call w3mvDPropertyChange("$$root.$devices.HTML","$setparam (kDevHtmlFileName,’z:\myhtml.html’)","REQUIRED")
See Also
Generating Report in mvDesigner
Setting up the Development Environment
Using the Report Graph Control Component