Click to See Complete Forum and Search --> : Exporting problem in pdf format.


RiteshNetshell
May 29th, 2007, 07:18 AM
I have a report in which I am using 5 Subreport. Whenever I export the

main report in pdf format then the only blank page has shown. I am not

able to understand the problem. and when I export the report that has

only 1 report without any subreport that it's work properly. So plz temme

the solution of this problem.

I am also included the code that I am using to export the report.

Dim Rpt As New ReportDocument
Dim RptQR As New ReportDocument
Dim RptSQR As New ReportDocument
Dim RptSSQR As New ReportDocument
Dim RptSub As New ReportDocument
rid = Session("reporttypeidfinal")
rname = Session("reportnamefinal")
Rpt.Load(Server.MapPath("RptSummaryReport.rpt"))

Dim ds As New Data.DataSet
Dim dsQR As New Data.DataSet
Dim dsSR As New Data.DataSet
Dim dsSSR As New Data.DataSet

Dim dtQR As New SqlDataAdapter("Select distinct CategoryID,QuestionId,SubQuestionId,SSQuestionID,ResponseId,Response,Remediation from vwReportRemediation where response is not null and reportname = '" & rname & "' and reporttypeid = '" & rid & "' and subquestionid is null and ssquestionid is null ", New ConnectToDB().connect())
dtQR.Fill(dsQR, "vwMainresponse")
Rpt.Subreports("RptMainQ").SetDataSource(dsQR)

Dim dtSR As New SqlDataAdapter("Select distinct CategoryID,QuestionId,SubQuestionID,ResponseId,Response,Remediation from vwReportRemediation where reportname = '" & rname & "' and reporttypeid = '" & rid & "' and response is not null and subquestionid is not null AND SSquestionid is null", New ConnectToDB().connect())

dtSR.Fill(dsSR, "VwSubQuestion")
Rpt.Subreports("RptSubQ").SetDataSource(dsSR)

Dim dtSSR As New SqlDataAdapter("Select distinct CategoryID,QuestionId,SubQuestionId,SSQuestionID,ResponseId,Response,Remediation from vwReportRemediation where reportname = '" & rname & "' and reporttypeid = '" & rid & "' and response is not null and SSquestionid is not null", New ConnectToDB().connect())
dtSSR.Fill(dsSSR, "vwSSResponse")
Rpt.Subreports("RptSSQ").SetDataSource(dsSSR)

Dim dt As New SqlDataAdapter("Select distinct * from vwReportRemediation where reportname = '" & rname & "' and reporttypeid = '" & rid & "' ORDER BY PriorityCat, Priority ", New ConnectToDB().connect())
dt.Fill(ds, "vwReportGenerate")

Dim dsFooter As Data.DataSet = FillFooterReport()
Rpt.Subreports("RptFooter.rpt").SetDataSource(dsFooter)
Rpt.SetDataSource(ds)

CRV1.ReportSource = Rpt

Rpt.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Response, False, "ExportedReport")