Reportviewer control prints older report even when report is refreshed
I have a reportviewer control in my windows application developed using C# where i can view a report and print the report.The problem i am facing is as follows . I entered a parameter and printed the report twice.Then entered a different parameter to the same report and printed (twice) but reportviewer printed the first parameter report and not the second one.I am using sql server 2005 reporting server.May i know what is the cause for this problem. Please help me to solve this. Thank You, Chaithu
August 29th, 2011 10:02am

Hi Chaithanya, Thanks for your post. According to your description, the reportviewer was not refreshed after changing the parameter, I list two cases below to assist you solve the problem: 1. If the referred report in the reportviewer is a Server report, you need to call the below code after you update the report parameter. this.reportViewer1.ServerReport.RefreshReport(); 2. If the referred report in the reportviewer is a local report, you need to reload the dataset after the report parameter changed, and then refresh the report, please refer to the code below: this.CascadeTableTableAdapter.FillBy(this.ForumSupportDBDataSet.CascadeTable, p1ToolStripTextBox.Text); this.reportViewer1.LocalReport.Refresh(); this.reportViewer1.RefreshReport(); I hope this can help you, if you have anything unclear, please feel free to let me know. Thanks, Bill Lu Please remember to mark the replies as answers if they help and unmark them if they provide no help.If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.
Free Windows Admin Tool Kit Click here and download it now
August 31st, 2011 1:30am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics