G
Guest
Hi.
I am rendering a pdf file from an aspx page. The problem is if the user has
an earlier version of adobe acrobat reader (specifically v 5), the report
shows as blank pdf file. But if you use v 6.0, everything is great. Is there
a workaround with this ? Here is my sample code ...
Dim crReportDocument As ReportDocument
Dim crExportOptions As ExportOptions
Dim crDiskFileDestinationOptions As DiskFileDestinationOptions
Dim Fname As String
crReportDocument = New ReportDocument
crReportDocument.Load(Server.MapPath("../reports/clientdetails.rpt"))
crReportDocument.SetDatabaseLogon(Application("crystaluser"),
Application("crystalpass"))
crReportDocument.SetParameterValue("@programid",
Session("thisprogid"))
crReportDocument.SetParameterValue("@clientid",
Request.QueryString("cid"))
Fname = Server.MapPath("pdf\" & Request.QueryString("cid") & ".pdf")
crDiskFileDestinationOptions = New DiskFileDestinationOptions
crDiskFileDestinationOptions.DiskFileName = Fname
crExportOptions = crReportDocument.ExportOptions
With crExportOptions
.DestinationOptions = crDiskFileDestinationOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.PortableDocFormat
End With
crReportDocument.Export()
crReportDocument = Nothing
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile(Fname)
Response.Flush()
Response.Close()
System.IO.File.Delete(Fname)
Any help or advice or comments will be appreciated..
I am rendering a pdf file from an aspx page. The problem is if the user has
an earlier version of adobe acrobat reader (specifically v 5), the report
shows as blank pdf file. But if you use v 6.0, everything is great. Is there
a workaround with this ? Here is my sample code ...
Dim crReportDocument As ReportDocument
Dim crExportOptions As ExportOptions
Dim crDiskFileDestinationOptions As DiskFileDestinationOptions
Dim Fname As String
crReportDocument = New ReportDocument
crReportDocument.Load(Server.MapPath("../reports/clientdetails.rpt"))
crReportDocument.SetDatabaseLogon(Application("crystaluser"),
Application("crystalpass"))
crReportDocument.SetParameterValue("@programid",
Session("thisprogid"))
crReportDocument.SetParameterValue("@clientid",
Request.QueryString("cid"))
Fname = Server.MapPath("pdf\" & Request.QueryString("cid") & ".pdf")
crDiskFileDestinationOptions = New DiskFileDestinationOptions
crDiskFileDestinationOptions.DiskFileName = Fname
crExportOptions = crReportDocument.ExportOptions
With crExportOptions
.DestinationOptions = crDiskFileDestinationOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.PortableDocFormat
End With
crReportDocument.Export()
crReportDocument = Nothing
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile(Fname)
Response.Flush()
Response.Close()
System.IO.File.Delete(Fname)
Any help or advice or comments will be appreciated..