none
C# report view dont show updated data !! RRS feed

  • Question

  • Hello..

    Simply i am developing an application which has 2 forms one for data insertion into Sql compact edition database and the other form has the report view which will show the data of my Sql database. The problem is when i insert data into the database and just open the report viewing form it doesnt show recent insertions unless i closed the application and ran it again. i this its something related to "how to update the data set (.xsd) file in run-time environment.

    I am using visual studio 2010 ultimate..

    Thanks in advice.

    • Moved by Bob Shen Friday, April 26, 2013 10:03 AM move to a more appropriate forum
    Sunday, April 21, 2013 9:34 PM

All replies

  • If you are using Transactions then you need to commit them.

    If not you probably need to refresh the dataset used by the report as it is probably populated when the application is run and not when the page is opened.


    Digital Forensic Software Developer
    http://www.pledgebank.com/StopOnlineAbuse

    Online Safety Net
    Mark as Answer or Vote up if useful thank you!
    Volunteer Developers Required to work on free systems that can be used to reduce online child abuse and bullying! contact: dave@online-safety.net if you are interested.

    • Proposed as answer by Dave A Gordon Monday, April 22, 2013 10:29 AM
    Monday, April 22, 2013 10:29 AM
  • Yea, thats exactly what i need. But how to refresh the dataset in run time ?? Because i made that report using standards as making new dataset the. In report viewer i design new report and finally the code is automatically generated ?? Thanks for fast reply.
    Monday, April 22, 2013 2:40 PM
  • Please guys i really need help in this problem ??
    Monday, April 22, 2013 8:41 PM
  • Try these

    http://stackoverflow.com/questions/8802707/setting-the-datasource-for-a-local-report-net-report-viewer

    http://stackoverflow.com/questions/9422017/setting-a-datasource-for-a-report-at-runtime

    This looks like the one for you:

    http://msdn.microsoft.com/en-us/library/ms252085.aspx

    Rebinding Data Sources to the ReportViewer Control

    Rebinding a data source is necessary if you modify a report definition that has already been bound to a control, if you modify the dataset after the control has been bound to a form or Web page, or if you add a new dataset to the report. All of these scenarios result in data bindings that are out-of-date. Use the Rebind Data Sources task on the ReportViewer Tasks smart tags panel to update the data bindings in application code.


    Digital Forensic Software Developer
    http://www.pledgebank.com/StopOnlineAbuse

    Online Safety Net
    Mark as Answer or Vote up if useful thank you!
    Volunteer Developers Required to work on free systems that can be used to reduce online child abuse and bullying! contact: dave@online-safety.net if you are interested.


    Monday, April 22, 2013 10:54 PM
  • I dont want to be ODD, but it these links could not help me !!! 

    if anyone one have code solution i will be very thankful.

    Tuesday, April 23, 2013 2:00 PM
  • Supply some code and we will correct your mistakes if we see them. But we are not just going to write it for you.

    Digital Forensic Software Developer
    http://www.pledgebank.com/StopOnlineAbuse

    Online Safety Net
    Mark as Answer or Vote up if useful thank you!
    Volunteer Developers Required to work on free systems that can be used to reduce online child abuse and bullying! contact: dave@online-safety.net if you are interested.

    Tuesday, April 23, 2013 2:19 PM
  • i tried many thing like those : 

    reportViewer1.LocalReport.DataSources.Clear(); reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local; reportViewer1.LocalReport.ReportPath = @" my path"; reportViewer1.LocalReport.DataSources.Clear(); reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSet1", SCHOOL1DataSet.Tables["COURSES"] )); reportViewer1.DocumentMapCollapsed = true; reportViewer1.RefreshReport();

            private void Form1_Load(object sender, EventArgs e)
            {
    
                this.COURSESTableAdapter.Fill(this.SCHOOL1DataSet.COURSES);
    
                this.reportViewer1.RefreshReport();
    
                reportViewer1.ReportRefresh += new CancelEventHandler(reportViewer1_ReportRefresh);
            }
    
            private void reportViewer1_ReportRefresh(object sender, CancelEventArgs e)
            {
                this.COURSESTableAdapter.Fill(this.SCHOOL1DataSet.COURSES);
                reportDataSource.Value = SCHOOL1DataSet.COURSES;
                reportViewer1.ReportRefresh += new CancelEventHandler(reportViewer1_ReportRefresh);
            }

    Wednesday, April 24, 2013 11:53 PM