IPrintReport Interface

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

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.

  1. Create a new C# Class Library in Microsoft Visual Studio.

  2. 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)

  3. 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);
			}
		}