locked
Need help urgently!!! ReportDataSource RRS feed

  • Question

  • Hi everyone!!!

    I need help urgently... I'm trying to load a rdlc report dynamically using entity framework. The reportviewer is showing, but no data is showing at all... At the moment I hardcoded the path to get it working, then I will load different reports depending on a value...

    This is what I've done:

    protected void Page_Load(object sender, EventArgs e)
            {
                ReportView.Reset();
                ReportView.ProcessingMode = ProcessingMode.Local;
                LocalReport report = new LocalReport();
                ReportView.LocalReport.ReportPath = "C:\\Users\\Karen\\Desktop\\Connection42\\Connection42 Projects\\Multi platform Applications\\NeoXSolution\\NeoXSolution\\Neo.Web\\NoParameters.rdlc";
                ReportDataSource rds = null;
                // Get Entity Data
                
                rds = new ReportDataSource(ReportView.LocalReport.GetDataSourceNames()[0]);
                if (rds.Equals(null) == false)
                    ReportView.LocalReport.DataSources.Add(rds);
                ReportView.Visible = true;
            }

    Please help me, I really need to get it working... This is the first time working on this, if I missed anything, please tell me and any tips will be greatly appreciated.

    thanks so much in advance!!!!


    Rising Storm Technologies

    Wednesday, March 7, 2012 10:06 AM

Answers

  •   

    I think you need to supply the entity you are reporting on............

              // Get Entity Data           
    ReportDataSourcerds = new ReportDataSource(ReportView.LocalReport.GetDataSourceNames()[0],YOUR_DBCONTEXT.YOUR_ENTITY_TYPE.TOLIST());

    REPORTVIEW.REFRESHREPORT()

    Hope that helps..........


    Mike

    • Proposed as answer by MickJack Friday, March 9, 2012 2:49 PM
    • Marked as answer by linkit Monday, March 19, 2012 12:37 PM
    Friday, March 9, 2012 2:49 PM