c# - report viewer in windows form not updating even after refresh report -


i try generate report via report viewer using click event on button. working fine. when update data in database report viewer show old report . have tried using refresh report too.its not working. using table adapter in dataset populate data. this.reportviewer1.reset();

            microsoft.reporting.winforms.reportdatasource reportdatasource2 = new microsoft.reporting.winforms.reportdatasource();             reportdatasource2.name = "ledgerby_partyid";              reportdatasource2.value = this.ledger_by_party_idbindingsource;              // this.reportdataset.ledger_by_party_id.reset();               this.ledger_by_party_idtableadapter.fill(this.reportdataset.ledger_by_party_id, selected_partyid);              this.reportviewer1.localreport.reportembeddedresource = "proj.userreport.ledger_bypartyid.rdlc";             this.reportviewer1.localreport.datasources.clear();             this.reportviewer1.localreport.datasources.add(reportdatasource2);             this.reportviewer1.localreport.refresh();             this.reportviewer1.refreshreport(); 

i solved same problem. searching few days in internet couldn't find answer it. hope post overcome same problem.

all need - define manually connection, refill dataset , bind source reportviewer. here project example:

using microsoft.reporting.winforms;     private void reportform_load(object sender, eventargs e)     {         sqlconnection conn = new sqlconnection();         conn.connectionstring = @"data source=(localdb)\v11.0;attachdbfilename=d:\gd robotics\visualprojects\gdpolin\gdpolin\polinadb.mdf;integrated security=true;connect timeout=30";         conn.open();         sqldataadapter reportdbtableadapter = new sqldataadapter("select *  [reportdb]", conn);         datatable polinadbdataset = new datatable();         reportdbtableadapter.fill(polinadbdataset);         conn.close();          this.reportviewer1.reset();         this.reportviewer1.localreport.datasources.clear();         this.reportviewer1.localreport.reportpath = @"d:\gd robotics\visualprojects\gdpolin\gdpolin\report1.rdlc";         reportdatasource rds = new reportdatasource("dataset1", polinadbdataset);//"dataset1" name of dataset. go .rdlc form>view>report data>"right click on dataset">dataset properties         this.reportviewer1.localreport.datasources.add(rds);         this.reportviewer1.refreshreport();     } 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -