on 09-02-2019 5:12 PM
Dear Experts,
I'm using Sap Business One version 9.3 PL10 (sql/Hana) and I'm trying to print Crystal Reports Document on different printers using DI Api sdk.
I can print a cr report layout, using SAPbobsCOM.ReportLayoutsService and SAPbobsCOM.ReportLayoutPrintParams.
The problem is that the default windows printer is always used even if, in sap b1, another printer is associated with the report layout.
Is it possible to set a custom printer before printing report layout (oReportLayoutService.Print(oReportPrintParams) ) ?
Thank you in advance.
Kind regard,
Moreno
CR for VS runtime by default uses the PrintToPrinter() API to print the report.
Search for this KBA and add the registry key and see if that works for you:
https://launchpad.support.sap.com/#/notes/2284485
Other option is to set the PC's default printer to the custom printer and set the report to use the same printer properties.
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mr. Don,
To print cr Layout I don't directly use the crystal report libraries but the DI Api libraries made available by Sap Business one, in its sdk environment.
I believe that, at the moment, the only solution is to change the windows default printer.
thank you so much for your time ... Really appreciated !
Best Regards
Moreno
Actually the B1 .NET SDK is the same CR for VS sdk package.
Registry key will work for you.
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thank you very much for your time Mr. Williams !
Sorry but I find it hard to understand.
I have to print, from an external executable (DI Api only) and in the background, a cr report on different printers.
The problem is that I can't set up a custom printer in my subroutine:
This is my code
SAPbobsCOM.ReportLayoutsService oReportLayoutService = Common.oCompanySource.GetCompanyService().GetBusinessService(SAPbobsCOM.ServiceTypes.ReportLayoutsService);
SAPbobsCOM.ReportLayoutPrintParams oReportPrintParams = oReportLayoutService.GetDataInterface(SAPbobsCOM.ReportLayoutsServiceDataInterfaces.rlsdiReportLayoutPrintParams);
oReportPrintParams.LayoutCode = 'INV20012';
oReportPrintParams.DocEntry = 35;
oReportLayoutService.Print(oReportPrintParams);
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.