cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to print SAP B1 Invoice on the printer assigned in Report and Layout Manager using UI API

allsanlawlas
Explorer
0 Kudos
266

Hello,

I am trying to print the SAP B1 Marketing documents on the printer that is assigned in the Report and Layout Manager but it is always sent to the default printer set in Windows using the SAP B1 SDK.

The code is as below:

 

// Connect to the printing services
CompanyService oCompanyService;
ReportLayoutsService oReportLayoutService;
ReportLayoutPrintParams oPrintParam;
oCompanyService = oCompany.GetCompanyService();
oReportLayoutService = oCompanyService.GetBusinessService(ServiceTypes.ReportLayoutsService);

// Setup the Report
ReportParams oReportParams = oReportLayoutService.GetDataInterface(ReportLayoutsServiceDataInterfaces.rlsdiReportParams);
oReportParams.ReportCode = "INV2";

// Get the default report layout
oPrintParam = oReportLayoutService.GetDataInterface(ReportLayoutsServiceDataInterfaces.rlsdiReportLayoutPrintParams);
oPrintParam.LayoutCode = oReportLayoutService.GetDefaultReport(oReportParams).LayoutCode;
oPrintParam.DocEntry = sapDocument.DocEntry;

oReportLayoutService.Print(oPrintParam);

 

Could you please let us know how we can print on the assigned printer.

Any help on this will be appreciated. Thank you.

SAP Business One, version for SAP HANA SAP Business One Extensibility 

@ANKIT_CHAUHAN 

 

 

Accepted Solutions (0)

Answers (0)