DIAPI print to pdf document
I am trying to print to pdf a invoice when I add it. Is there any way to do it by DIAPI?
Pedro Magueija replied
Dim crReport As New ReportDocument
If (File.Exists(ReportPath)) Then
' set parameters for your report
crReport.PrintOptions.PrinterName = ""
crReport.DataSourceConnections(0).SetConnection(B1Connections.diCompany.Server, B1Connections.diCompany.CompanyDB, False)
crReport.PrintToPrinter(Copies, True, StartPage, EndPage)
Don't forget to include all necessary runtime dlls in the project. These are:
Also, you need to have the correct version of the runtime, installed in each client machine. I think SAP B1 installs CR runtime 12.x (not 100% sure).
If you add the dlls from any other version you must install that runtime version in the client machine.
CR versions and downloads:
I think you need the CR 2008.
Hope this helps,