The Unisys.AgileBusiness.RuntimeAPI namespace contains the IPrintReport interface that enables you to print an AB Suite Windows report output.
The RuntimeFactory class includes methods to return the IPrintReport objects.
Refer to Definition of the IPrintReport Interface for more information about the interface.
Namespace: Unisys.AgileBusiness.RuntimeAPI
Assembly: Unisys.AgileBusiness.RuntimeAPI (in Unisys.AgileBusiness.RuntimeAPI.dll)
Syntax:
The IPrintReport object can be created by using the RuntimeFactory. GetReportPrinter() method.
IPrintReport printReport = RuntimeFactory.GetReportPrinter();
The IPrintReport interface exposes the following member.
Methods
Method | Description |
---|---|
PrintReport | Called by an application to print an AB Suite windows generated report output with the specified properties. |
StatusInfo IPrintReport.PrintReport Method
This method allows you to print an AB Suite windows generated output to the specified destination station.
Syntax
PrintReport(Unisys.AgileBusiness.RuntimeAPI.PrintReportParameter printParameters)
Argument
parameter: Members of PrintReportParameter
The object describes all the PrintReportParameter values and parameters available from the PrintReportParameter class. The PrintReportParameter class exposes the following members.
Members of PhasedSqlParameter class
Name | Type | Description |
---|---|---|
ReportXMLFile | string | File name of the report output XML to be printed along with the complete path. |
DeviceType | string | Device type to which the report output is printed. |
StationName | string | Destination Station name. |
FontName | string | Font name used for printing. |
Pitch | int | Pitch of the form for printing. This specifies the number of characters that can be printed in a line. |
FormDepth | int | Depth of the form for printing. This specifies the number of lines that can be printed in a page. |
StartPageNo | uint | Page number at which print starts. |
EndPageNo | uint | Page number at which print ends. |
DeleteXML | bool | If true, deletes Report XML file on completion of report print. |
Return Value
If this method succeeds, it returns the StatusInfo object with the status code: Error, Warning, or Success and the status message, if any.
Using the IPrintReport Interface
The following steps and code example illustrates the implementation of IPrintReport for printing a report output file to the specified destination station.
Create a new C# Class Library in Microsoft Visual Studio.
Add a reference to the following assembly that you need when calling from the Class Library,
Unisys.AgileBusiness.RuntimeAPI.dll (from <AB Suite 7.0 Installation directory>\bin64 folder)
Add the following code to the Class to print AB Suite Windows report output:
using System; using Unisys.AgileBusiness.RuntimeAPI; namespace SamplePrintReport { class Program { static void Main(string[] args) { // Get Report printer IPrintReport reportPrinter = RuntimeFactory.GetReportPrinter(); // Create PrintReport parameter PrintReportParameter parameter = new PrintReportParameter(); parameter.ReportXMLFile = @"C:\Print Test\TestPrint.xml"; parameter.DeviceType = "LP"; parameter.StationName = "FinePrint"; parameter.FontName = "Monotype Corsiva"; parameter.Pitch = 200; parameter.FormDepth = 80; parameter.StartPageNo = 2; parameter.EndPageNo = 8; parameter.DeleteXML = true; // Print Report StatusInfo status = printRep.PrintReport(parameter); } } }
Definition of the IPrintReport Interface
Following is the definition of the IPrintReport interface:
namespace Unisys.AgileBusiness.RuntimeAPI { public interface IPrintReport { StatusInfo PrintReport(PrintReportParameter printParameters); } }