PC Review


Reply
Thread Tools Rate Thread

how do I force CrystalReportViewer to refresh its data?

 
 
Bob
Guest
Posts: n/a
 
      12th Nov 2004
I'm asking here because I've posted this question in the crystal newsgroup,
waited two weeks, and got zero response. I would be very appreciative if
someone could shed some light on this problem for me.

I'm using the CrystalDecisions.Windows.Forms.CrystalReportViewer available
in CrystalDecisions.Windows.Forms.dll, version 9.2.3300.0.

Why does the crystal report viewer refuse to reload its data when the
RefreshReport method is called if the report parameters haven't changed? Can
I force it to always refresh or will I have to cobble together an ugly
workaround?

Bob


 
Reply With Quote
 
 
 
 
Bob
Guest
Posts: n/a
 
      1st Dec 2004
For future reference to others that may find my post, subclassing
ReportDocument and overriding the RefreshReport method is not a viable
option because CrystalReportViewer will not trigger a reload of data if it
sees that the parameters in its ReportDocument haven't changed. You have to
handle the ReportRefresh event (there is no override) in CrystalReportViewer
itself and in it 1. call the refresh method of the report document, 2.
update its parameters, then 3. set CrystalReportViewer's report source to
its report source (no change).

IMHO this is rather clunky, almost smells like a workaround to less than
well-thought-out design. But they refuse to call any behavior a "bug",
probably to keep the $200 I paid them to impart the knowledge I'm sharing
here.

I really dislike Crystal now. I may be stuck with it in my current
deployment but I'm going to looking for other DotNet reporting solutions
(purely DotNet, not this bastardized COM crap) when I have the opportunity.

Bob

"Bob" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm asking here because I've posted this question in the crystal

newsgroup,
> waited two weeks, and got zero response. I would be very appreciative if
> someone could shed some light on this problem for me.
>
> I'm using the CrystalDecisions.Windows.Forms.CrystalReportViewer available
> in CrystalDecisions.Windows.Forms.dll, version 9.2.3300.0.
>
> Why does the crystal report viewer refuse to reload its data when the
> RefreshReport method is called if the report parameters haven't changed?

Can
> I force it to always refresh or will I have to cobble together an ugly
> workaround?
>
> Bob
>
>



 
Reply With Quote
 
New Member
Join Date: Mar 2011
Posts: 1
 
      25th Mar 2011
Bob - thank you so much, it worked perfectly. In my case, the report took no parameters, so the code was simply:

CrystalReportSource1.ReportDocument.Refresh();
CrystalReportViewer1.ReportSource = CrystalReportSource1;

Thanks again - saved me a lot of work!
John

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to force refresh caching when I do some action as updating data, or delete records? ABC Microsoft ASP .NET 0 3rd Jan 2006 08:57 AM
How To Force Server To Send Data To WebPage WIthout Refresh(Push Method) batista Microsoft ASP .NET 4 20th Oct 2005 10:33 AM
Force Refresh Kevin Spencer Microsoft ASP .NET 2 2nd Jul 2005 03:24 PM
Force a refresh? Steve Banks Microsoft Frontpage 2 1st Oct 2004 02:44 PM
force refresh brian Microsoft ASP .NET 1 12th Nov 2003 02:22 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:58 PM.