Kavi suja

Kavi suja

  • NA
  • 298
  • 171.6k

RDLC file - FirstPage only visible (Don't show continue page

Jul 24 2013 6:55 AM
Hi,
   I have main report and subreport (rdlc files).The report generated correctly from database.But the problem is,the first page of Report only visible while application running.When convert report in to PDF,it will show all the available pages in report.But I can't identify where the problem is actually.The subreport generate correctly.I include the code here:
DataTable dtbl = new DataTable("DataTable1");
                    int dID = Convert.ToInt16(ddlDoctor.SelectedValue);

                    ReportBLLogic objRptBLL = new ReportBLLogic();
                    dtbl = objRptBLL.GenerateMainReport(dID, "GetDoctorListByParam");

                    ReportViewer1.Visible = true;
                    ReportViewer1.LocalReport.DataSources.Clear();
                    ReportViewer1.ResolveUrl("ReportByDoctor.rdlc");
                    ReportDataSource source = new ReportDataSource("dsGetDoctor", dtbl);
                    ReportViewer1.LocalReport.DataSources.Add(source);
                    this.ReportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(SetSubDataSource);

                    // set parameters 
                    ReportParameter[] RptParam = new ReportParameter[7];
                    RptParam[0] = new ReportParameter("GeneratedDate", txtdate.Text);
                    //RptParam[0] = new ReportParameter("GeneratedDate", txtdate.Text);
                    MySqlDataReader HospitalName = objRptBLL.GetOrgName();
                    HospitalName.Read();
                    RptParam[1] = new ReportParameter("name",HospitalName["organization_name"].ToString());
                    RptParam[2] = new ReportParameter("address",HospitalName["address"].ToString());
                    RptParam[3] = new ReportParameter("city",HospitalName["city"].ToString());
                    RptParam[4] = new ReportParameter("code",HospitalName["code"].ToString());
                    RptParam[5] = new ReportParameter("country",HospitalName["country"].ToString());
                    RptParam[6] = new ReportParameter("phone",HospitalName["phone"].ToString());
                    this.ReportViewer1.LocalReport.SetParameters(RptParam); 

                    ReportViewer1.LocalReport.Refresh();
                    ReportViewer2.Visible = false;
                    rfvfda.Enabled = false;
                    rfvdate.Enabled = true;
For subreport :
 public void SetSubDataSource(object sender, SubreportProcessingEventArgs e)
        {
           // else if (rbdate.Checked == true)
            //else if (rblReport.SelectedIndex.Equals(1))
            {
                DataTable dtbl = new DataTable("DataTable1");

                DateTime dt = Convert.ToDateTime(txtdate.Text);
                int dID = Convert.ToInt16(e.Parameters["prmDoctorID"].Values[0]);             

                ReportBLLogic objRptBLL = new ReportBLLogic();
                //dtbl = objRptBLL.GenerateSubReport("GenerateDoctorSubReport");            
                dtbl = objRptBLL.GenerateSubReport(dID, dt, "GenerateReport");
                e.DataSources.Add(new ReportDataSource("dsReportDate", dtbl));

            }
Can anyone help me to do this?
Here 1st page only visible.But when i convert it in to PDF,It'll show all 35 pages.














Answers (7)