Quantcast
Channel: SCN: Message List - Reporting and Printing
Viewing all articles
Browse latest Browse all 2719

Printing exported layout programmatically only print the first Document

$
0
0

Hi all,

 

I'm trying to print a Sales Order in PDF format by SDK.

The rpt is a standard layout exported from SAP.

The document have a stored procedure (TmSp_DocLineTypeLayout), that need two parameters DocKey@ and ObjectId@.

 

Opening the rpt with the SAP CR editor I can preview successfully the first five Sales Orders for example. (Dockeys : 1,2,3,4,5)

 

The problem occurs when I try to print through SDK, only the first document (DocKey: 1) is generated properly in PDF, when I pass a different DocKey than 1 the PDF shows empty.

 

The code is very simple:

 

If (File.Exists("C:\SalesOrder.rpt")) Then

                crReport.Load("C:\SalesOrder.rpt")

                ' set parameters for your report

                crReport.SetParameterValue(0, 5)

                crReport.SetParameterValue(1, 17)

                crReport.DataSourceConnections(0).SetConnection(oCompany.Server, oCompany.CompanyDB, False)

                crReport.DataSourceConnections(0).SetLogon(oCompany.DbUserName, SQLPassword)

                crReport.ExportToDisk(ExportFormatType.PortableDocFormat, "C:\SalesOrder.pdf")

                crReport.Dispose()

End If

 

Any idea?

Thanks!


Viewing all articles
Browse latest Browse all 2719

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>