简体   繁体   中英

Refresh ReportViewer Data

I have a report that takes its data from table1 .

If I'm adding new data to table1 the report won't update its data until I restart the .exe file.

Is there a command (C#) that I can use to refresh the data in the report ?

reportViewer.RefreshReport()

下次尝试使用Google :)

Have you tried the RefreshReport method?

Calling the RefreshReport method causes all data in the report to be reloaded and rendered. A call to RefreshReport is automatically added to the Form Load event handler when a ReportViewer control is added to a form.

private void Form1_Load(object sender, EventArgs e)
{
    this.reportViewer.RefreshReport();
  }

http://msdn.microsoft.com/en-us/library/microsoft.reporting.winforms.reportviewer.refreshreport(v=vs.100).aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM