Data Connectivity
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Data Connectivity
Message Icon Topic: Can't refresh report data Post Reply Post New Topic
Author Message
orange_square
Newbie
Newbie


Joined: 19 May 2008
Location: United States
Online Status: Offline
Posts: 2
Quote orange_square Replybullet Topic: Can't refresh report data
    Posted: 19 May 2008 at 8:18am
I have a report that takes 2 parameters (StartDate and EndDate). I get the values of these 2 parameters in the BeforeRender event. This is the first event where the values of the parameters provided by me are available (pls correct me if I am wrong). After i get the parameters I modify the data in the table in DB where the report connects to. I am trying to tell the report to refresh its data, but that doesn't happen. Is it to late at this point to refresh the data of the report?

Help appreciated!

Thanks!
IP IP Logged
orange_square
Newbie
Newbie


Joined: 19 May 2008
Location: United States
Online Status: Offline
Posts: 2
Quote orange_square Replybullet Posted: 19 May 2008 at 10:35am
I did it eventually. I'll write the solution for my problem here maybe there will be somebody that will need it.
I said I can only retrieve the values of the parameters in the BeforeRender event of the CrystalReportViewer object. That's not true though. Once you post the page back to the server you can retrieve the collection of values from this.Page.Request.Form collection. Therefore I was able to retrieve the StartDate and EndDate pretty early in the lifecycle process of the page and now I am saving the data in the DB and the report shows the updated data.
This is how the code looks like:

DateTime startDate = DateTime.Parse(this.Page.Request.Form["StartDate0DiscreteValue"].ToString());

where StartDate0DiscreteValue is the name of the first control that the input parameters page renders.

Hope it might help somebody.

Radu
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.