M
Morten Snedker
I am trying to move from having a crystalreportviewer to just
launching the PDF, but have difficulties adding a parameter value for
the underlying stored procedure
The commented-out part works in another context and I'm trying to make
it fit in, but can't see through it.
Thanks a bunch for any help!
Regards /Snedker
'--code begin
crReportDocument = New ReportDocument()
crReportDocument.Load(Server.MapPath("Reports\Erklaering.rpt"))
Fname = "c:\exports\" & Session("vvsID") & ".pdf"
'Dim field1 As ParameterField =
Me.CrystalReportViewer1.ParameterFieldInfo(0)
'Dim val1 As ParameterDiscreteValue = New
ParameterDiscreteValue
'val1.Value = Session("vvsID")
'field1.CurrentValues.Add(val1)
crDiskFileDestinationOptions = New
DiskFileDestinationOptions()
crDiskFileDestinationOptions.DiskFileName = Fname
crExportOptions = crReportDocument.ExportOptions
With crExportOptions
.DestinationOptions = crDiskFileDestinationOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.PortableDocFormat
End With
crReportDocument.Export()
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile(Fname)
Response.Flush()
Response.Close()
System.IO.File.Delete(Fname)
'--code end
launching the PDF, but have difficulties adding a parameter value for
the underlying stored procedure
The commented-out part works in another context and I'm trying to make
it fit in, but can't see through it.
Thanks a bunch for any help!
Regards /Snedker
'--code begin
crReportDocument = New ReportDocument()
crReportDocument.Load(Server.MapPath("Reports\Erklaering.rpt"))
Fname = "c:\exports\" & Session("vvsID") & ".pdf"
'Dim field1 As ParameterField =
Me.CrystalReportViewer1.ParameterFieldInfo(0)
'Dim val1 As ParameterDiscreteValue = New
ParameterDiscreteValue
'val1.Value = Session("vvsID")
'field1.CurrentValues.Add(val1)
crDiskFileDestinationOptions = New
DiskFileDestinationOptions()
crDiskFileDestinationOptions.DiskFileName = Fname
crExportOptions = crReportDocument.ExportOptions
With crExportOptions
.DestinationOptions = crDiskFileDestinationOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.PortableDocFormat
End With
crReportDocument.Export()
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile(Fname)
Response.Flush()
Response.Close()
System.IO.File.Delete(Fname)
'--code end