Hi, Here’s the error that I got. Since we’re working usually in French, I’ll leave the error as it appeared. It says, roughly translated: “Error in file […] operation not authorised on related parameter”
{" Erreur dans le fichier FaDetail 6436_7080_{916660D8-FDDF-4696-BBB3-3150E4351AAE}.rpt : Opération non autorisée effectuée sur un paramètre relié."}
With the following line :
i = crReport.FormatEngine.GetLastPageNumber(New CrystalDecisions.Shared.ReportPageRequestContext) So, just for you to know, my reports contains a lot of sub-reports (approx. 20)
Here’s a sample code in vb.net:
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Dim crDiskFileDestinationOptions As New DiskFileDestinationOptions
Dim crReportDetail As New CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim crReportSommr As New CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim i As Integer
Try
crReportDetail.Load("D:\Applprod\Sige\Rapport\FaDetail.rpt", OpenReportMethod.OpenReportByTempCopy)
SetDBLogonForReport(crReportDetail)
bFactDetlInitParams(crReportDetail)
i = crReportDetail.FormatEngine.GetLastPageNumber(New CrystalDecisions.Shared.ReportPageRequestContext) crReportDetail.ExportToDisk(ExportFormatType.PortableDocFormat, "D:\Applprod\Sige\TEMP\Detail.pdf")
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Thanks lot.