3
Answers

Automatically save file

Photo of Ramco Ramco

Ramco Ramco

Mar 11
120
1

Hi

  I don't know whether it is correct forum or not. I have below code in Sap B1 . In this scenario Default printer shoule be PDF . Secondly it asks for path. Is there any way to set the name and path through code so the exporting of the layout becames automatic? Below is the Code.

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);

Thanks

Answers (3)