Skip to Content
0

How to export layout to pdf using sdk

Sep 03, 2017 at 08:28 PM

216

avatar image

Hi.

How can we save an invoice or any other layout to pdf using sdk? The document is already saved.

Thanks

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Johan Hakkesteegt Sep 04, 2017 at 05:47 AM
0

Hi Fedias,

The print layout system in B1 is limited to the client software. it is only accessible through the SDK via the UI API.

That means that you can try to manipulate a print layout by using the UI API to press the right buttons and menus, and/or opening the related form. In other words, use the UI API to replicate whatever a user would do.

It would probably be easier to create your own pdf creator class. There are several .net libraries out there, like Expert Pdf Components, or Essential Objects. I also hear good things about Sharpshooter.

Regards,

Johan

Share
10 |10000 characters needed characters left characters exceeded
Fedias Papadopoulos Sep 13, 2017 at 12:36 PM
0

Hi Johan,

Thanks for your response.

We want to avoid use the crystal reports libraries to prepare the pdf, that's why we are looking somehow to directly export it and then use it as attachment.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Fedias,

The libraries I mentioned above are in no way related to Crystal Reports. They are independent from SAP, and can be used in any .NET (C# or VB.NET) application.

The UI API is related only to the B1 client, so also not to Crystal reports. The UI API is the only way to access the print layout system in the B1 client.

Regards,

Johan

0
Danilo Kasparian Sep 14, 2017 at 01:00 PM
0

Hi Fedias,

This should help you

http://www.b1tech.tips/2016/01/printing-system-layout-in-sap-business.html

So if you have a PDF printer set as default would work. I don`t think it is the perfect solution but is at least a workaround.

       SAPbobsCOM.CompanyService oCmpSrv;
       SAPbobsCOM.ReportLayoutsService oReportLayoutService;
       SAPbobsCOM.ReportLayoutPrintParams oPrintParam;
       oCmpSrv = oCompany.GetCompanyService();
       oReportLayoutService = (ReportLayoutsService)oCmpSrv.GetBusinessService(SAPbobsCOM.ServiceTypes.ReportLayoutsService);
       oPrintParam = (ReportLayoutPrintParams)oReportLayoutService.GetDataInterface(SAPbobsCOM.ReportLayoutsServiceDataInterfaces.rlsdiReportLayoutPrintParams);
       oPrintParam.LayoutCode = "INV20014";
       oPrintParam.DocEntry = 350;
       oReportLayoutService.Print(oPrintParam);
Share
10 |10000 characters needed characters left characters exceeded