Hallo everyone,
I have crystal reports in a web application. The reports are displayed correctly and the subreports as wel. I also want to be able to export de reports.
To do so I have used an own export button and a dropdownlist in order to select the export format. This also works fine.
My problem is that when I browse to a subreport within the report and then click the export button, the mainreport will be exported and not the currently visible subreport.
This is my code:
In LaadRapport() a new report document will be created. And I guess that this is actually the problem. I don't want to export the whole new report but my selected subreport. But I don't know how to do that.
Does anybody have an idea?
Thanx in advance!
jennie
I have crystal reports in a web application. The reports are displayed correctly and the subreports as wel. I also want to be able to export de reports.
To do so I have used an own export button and a dropdownlist in order to select the export format. This also works fine.
My problem is that when I browse to a subreport within the report and then click the export button, the mainreport will be exported and not the currently visible subreport.
This is my code:
PHP:
Protected Sub btExport_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btExport.Click
Dim oRapportDocument As ReportDocument = LaadRapport()
' Declare variables and get the export options.
Dim exportOpts As ExportOptions = oRapportDocument.ExportOptions
Select Case LCase(cmbExport.SelectedValue)
Case "pdf"
Dim pdfFormatOpts As New PdfRtfWordFormatOptions()
' Set the pdf format options
pdfFormatOpts.UsePageRange = False
exportOpts.FormatOptions = pdfFormatOpts
exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat
Case "excel"
.....
Case "exceldataonly"
......
Case "word"
.......
Case "rtf"
......
End Select
exportOpts.ExportDestinationType = ExportDestinationType.NoDestination
oRapportDocument.ExportToHttpResponse(exportOpts, Response, True, "Exported Rapport")
End Sub
In LaadRapport() a new report document will be created. And I guess that this is actually the problem. I don't want to export the whole new report but my selected subreport. But I don't know how to do that.
Does anybody have an idea?
Thanx in advance!
jennie