Hai,
I am using the following code for exporting the report to PDF format.
It exports the report successfully. But it is not considering the record selection formula/Groupselectionformula
which is passed here. Pls give me the solution for this
Dim objRD As New ReportDocument()
Dim req As New ExportRequestContext()
Dim str As System.IO.MemoryStream
Dim crv As New CrystalReportViewer()
objRD.Load("c:\rptsample.rpt" )
If LCase(strReportPath) = "rptsample.rpt" Then
objRD.DataDefinition.GroupSelectionFormula = "DistinctCount ({TBLCUS.CUSID},{TBLCUS.SECURITYID} )>1"
Else
objRD.DataDefinition.RecordSelectionFormula = strFormula
End If
objRD.ExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat
objRD.ExportOptions.FormatOptions = New PdfRtfWordFormatOptions()
AddCrystalParameter(objRD, colParam)
req.ExportInfo = objRD.ExportOptions
str = objRD.FormatEngine.ExportToStream(req)
With HttpContext.Current.Response
.ClearContent()
.ClearHeaders()
.ContentType = "application/pdf"
.AddHeader("Content-Disposition", "inline; filename=Report.pdf")
.BinaryWrite(str.ToArray)
'.End()
End With
objRD.Close()
regards ,
P.sujatha
I am using the following code for exporting the report to PDF format.
It exports the report successfully. But it is not considering the record selection formula/Groupselectionformula
which is passed here. Pls give me the solution for this
Dim objRD As New ReportDocument()
Dim req As New ExportRequestContext()
Dim str As System.IO.MemoryStream
Dim crv As New CrystalReportViewer()
objRD.Load("c:\rptsample.rpt" )
If LCase(strReportPath) = "rptsample.rpt" Then
objRD.DataDefinition.GroupSelectionFormula = "DistinctCount ({TBLCUS.CUSID},{TBLCUS.SECURITYID} )>1"
Else
objRD.DataDefinition.RecordSelectionFormula = strFormula
End If
objRD.ExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat
objRD.ExportOptions.FormatOptions = New PdfRtfWordFormatOptions()
AddCrystalParameter(objRD, colParam)
req.ExportInfo = objRD.ExportOptions
str = objRD.FormatEngine.ExportToStream(req)
With HttpContext.Current.Response
.ClearContent()
.ClearHeaders()
.ContentType = "application/pdf"
.AddHeader("Content-Disposition", "inline; filename=Report.pdf")
.BinaryWrite(str.ToArray)
'.End()
End With
objRD.Close()
regards ,
P.sujatha