locked
subreport data not showing RRS feed

  • Question

  • User103755304 posted

    Hi

     

    I am not getting data in subreport along with main report, But If I run the subreport alone I am getting data.

     

    below is the code which I am using , Please figure out my problem and give me the solution.

     

     

    rptH.FileName = Server.MapPath(

    rptH.Load();

     

    ReportClass rptH = new ReportClass();"~/Reports/RPT/" + crfilename + ".rpt"); //ReportDocument rptH = new ReportDocument();

     

    //rptH.Load(Server.MapPath("~/Reports/RPT/" + crfilename + ".rpt"));

     

     

    //// rptH.SetDataSource(ds);

     

    // //if (ds != null)

     

    // //{

     

    // // rptH.SetDataSource(ds);

     

    // //}

     

    // //else if (Revenues != null && Expenditures != null)

     

    // //{

     

    //string subreportName1;

     

    //SubreportObject SubreportObject1 = rptH.ReportDefinition.ReportObjects["rptCnty2YrRevenue"] as SubreportObject;

     

    //ReportDocument subreport1 = new ReportDocument();

     

    //subreportName1 = SubreportObject1.SubreportName;

     

    //subreport1 = SubreportObject1.OpenSubreport(subreportName1);

     

    //subreport1.SetDataSource(Revenues);

     

    // string subreportName2;

     

    // SubreportObject SubreportObject2 = rptH.ReportDefinition.ReportObjects["rptCnty2YrExpenditure"] as SubreportObject;

     

    // ReportDocument subreport2 = new ReportDocument();

     

    // subreportName2 = SubreportObject2.SubreportName;

     

    // subreport2 = SubreportObject2.OpenSubreport(subreportName1);

     

    // subreport2.SetDataSource(Expenditures);

     

     

    //rptH.Subreports[0].Load(Server.MapPath("~/Reports/RPT/rptCnty2YrRevenue.rpt"));

     

    //rptH.Subreports["rptCnty2YrExpenditure.rpt"].Load(Server.MapPath("~/Reports/RPT/rptCnty2YrExpenditure.rpt"));

     

    RevenuesObject.Add(Revenues);

     

    ExpendituresObject.Add(Expenditures);

     

    rptH.Subreports[0].SetDataSource(RevenuesObject);

    rptH.Subreports[1].SetDataSource(ExpendituresObject);

     

    List<MDOT.ADARS.CFR.Model.Revenues> RevenuesObject = new List<MDOT.ADARS.CFR.Model.Revenues>();List<MDOT.ADARS.CFR.Model.Expenditures> ExpendituresObject = new List<MDOT.ADARS.CFR.Model.Expenditures>();//rptH.Subreports[0].OpenSubreport(Server.MapPath("~/Reports/RPT/rptCnty2YrRevenue.rpt")).SetDataSource(RevenuesObject);

     

    //rptH.Subreports[1].OpenSubreport(Server.MapPath("~/Reports/RPT/rptCnty2YrExpenditure.rpt")).SetDataSource(ExpendituresObject);

     

    Wednesday, December 29, 2010 5:03 PM

All replies