Is it possible to pass multiple discrete values to a report document so
that I can export it to PDF?
I've managed to perform the following code to display a Crystal Report
Viewer ok, but i want to be able to export that to a PDF and print it.
Dim invNos As New ArrayList -- populated elsewhere in my code.
Dim oRpt As New ReportDocument
oRpt.Load(MapPa th(<crystalRepo rt>))
Dim crParameterFiel ds As ParameterFields
Dim crParameterFiel d As ParameterField
Dim crParameterValu es As ParameterValues
Dim crParameterDisc reteValue As ParameterDiscre teValue
CrystalReportVi ewer1.ReportSou rce = oRpt
crParameterFiel ds = CrystalReportVi ewer1.Parameter FieldInfo
crParameterFiel d = crParameterFiel ds.Item("InvNos ")
crParameterValu es = crParameterFiel d.CurrentValues
For i = 0 To invNos.Count - 1
crParameterDisc reteValue = New ParameterDiscre teValue
crParameterDisc reteValue.Value = invNos(i)
crParameterValu es.Add(crParame terDiscreteValu e)
crParameterDisc reteValue = Nothing
Next
CrystalReportVi ewer1.Parameter FieldInfo = crParameterFiel ds
-- The code below errors as I haven't managed to pass my
-- InvNos parameter to my ReportDocument.
Dim st As System.IO.Strea m
st = oRpt.ExportToSt ream
CrystalDecision s.Shared].ExportFormatTy pe.PortableDocF ormat)
Response.ClearC ontent()
Response.ClearH eaders()
Response.Conten tType = "applicatio n/pdf"
Dim b(st.Length) As Byte
st.Read(b, 0, st.Length)
Response.Binary Write(b)
Response.End()
I've also read this document
(http://support.businessobjects.com/l...s/c2013539.asp)
which states you can't use SetParameterVal ue() method to pass multiple
values.
So anyone got any ideas how i can? Or is it possible to export my
CrystalReportVi ewer to PDF?
Many thanks in advance for any suggestions.
Dan Williams.