on 2011 Jan 08 7:39 PM
I am displaying a document using Crystal Reports vs2010 viewer control in a C# Win Forms application.
When selecting the next toolbutton there is an annoying message box that flashes (very) briefly that reads:
"Please wait while the document is processing". It is then overwritten by the next page. This flashes each time the next page toolbutton is selected. Once the last page is encountered and the document has been fully rendered, the message box no longer occurs.
I understand the document is not fully rendered initially, so Crystal does not know how many pages there are, and I understand the trade offs for that and am OK with all that. However, this is an application that has been upgraded from previous versions of Crystal several times and this behavior is new (or at least wasn't visible in prior versions) to Crystal vs2010 as far as I can tell.
I would like to suppress this message box and its accompanying flash which will be very annoying to users The development workstation this is occurring on is a very recent high end machine with quad cores, 12GB of ram, etc so it is unrelated to horsepower.
So my preference would be to turn off this annoying feature or second choice would be to cause the viewer to fully render the document before displaying the first page which I believe would eliminate the issue at the cost of performance.
I know my user community and they are not going to accept this.
Any help would be appreciated. Thanks in advance.
Hi funky,
Most people wanted more info or a Progress indication when the viewer was doing something and not "hung". The RDC had one and its functionality could not be ported to the .NET viewer.
I don't recall seeing the flashing, although I do see the background turn black momentarily as the page is being rendered if that's what you mean by flashi?
Using the Object Browser I found these possible API's that may help you:
CrystalDecisions.Windows.Forms.CrystalReportViewer.ShowProgressAnimation(bool)
And the other one that may help is this one:
CrystalDecisions.Windows.Forms.ProgressButton
There is a property of the viewer itself called UseWaitCursor and it's set to False by default. You could set it to true to see if it uses the Cursor to show the busy rather than popping up the message box.
Another possible work around is to use a report with saved data, then no wait time per page.
Thank you
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Don,
The behavior that occurs when hitting the next tool button specifically is:
the background clears and paints to a dark rectangle (which you mention)
the message box is displayed
the message box is removed
the new page is painted with data
In my case, the message box appears so briefly that it is a flash. I can see some user feedback is required for lengthy operations, and why folks might desire that, but I would say that should probably be an option that could be set.
This is a new (unwanted for me) behavior that was introduced into vs2010 version. I would say that in my case, and others who have fast processing times between page displays, it is going to be way more of an annoyance than a benefit. Having a selectable attribute would probably be fairly simple and keep everyone happy. Another option would be to only display the message box if a certain time period had elapsed. Giving the user feedback on long operations is very helpful and I concur with that thinking, but if paging is subsecond, and users frequently next through 50 page reports it is incredibly annoying. And yes I know they could search, or go directly to page N, those functions are enabled in the viewer for them, but as you can probably guess, only a certain set of users will ever navigate via those functions. The others just pump the toolbuttons. I'm not going to win that battle.
I'm not familiar with the saved data with report option so I will check into that, and I already tried setting the ShowProgressAnimation to false which had no effect. I will also try the wait cursor, but I doubt that will help although I do appreciate the ideas.
I will report back after trying that and let you know.
Hi Don,
Some follow up on your suggestions:
1) After researching Save Data with report, this feature will not be a good option for typical usage of this application.
2) Setting UseWaitCursor to true does exactly that, it gives a wait cursor when the mouse cursor is anywhere within the client area of the viewer control. Other than that, there are no changes in behavior.
3) CrystalDecisions.Windows.Forms.ProgressButton does not seem to work / help. I tried:
Image img = new Bitmap(0,0);
CrystalDecisions.Windows.Forms.ProgressButton button =
new CrystalDecisions.Windows.Forms.ProgressButton(img,"");
I get a com error class not registered at runtime. And even if I successfully instantiated a new ProgressButton object,
I don't see any method that allows that object to be assigned to the viewer.
Also, with further testing today I discovered a little more interesting behavior. The message box occurs when next page is selected as discussed previously. It does not appear on prev page (ever that I can tell). Even if a user next pages through the report, from page 1 to last lpage, then returns to page 1 and the selects next page, the message box is still displayed, which seems to indicate to me that the message box is actually called in the next page always, whether or not the report has been completely rendered.
So what I am down to at this point is:
1) I'd like to know exactly what the purpose / usage of ShowProgressAnimiation(bool) is ?
Seems like that would be the ticket here, except I verified that setting to false has no effect on the undesired behavior. Could a developer or PM verify what the purpose of this method is, whether it is currently functional, and if so what is the proper usage ?
2) If ShowProgressAnimation is not the solution, can the display of the message box be controlled by a programmer configurable attribute ?
Thanks
The Adapt number is our internal tracking tool.
It's been slated for Service Pack 2. The releases for CR for VS 2010 will be only Service Packs ( full installs ) and we are working on 3 month intervals but that is still to be determined.
No access to Adapt, watch the download page for updates.
Thank you
Don
You are a funny guy....
Just add a note for your users in the readme file for your app. If they really don't like it tell them to blink for a second right after they hit the next page button.... Or depending on how R&D implements the fix you may be able to make it configurable... For those who want it they can...
Thanks again
Don
Derive a class from CrystalReportViewer:
public class MyCrystalReportViewer : CrystalReportViewer
{
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
Type oType = typeof(CrystalReportViewer);
FieldInfo oInfo = oType.GetField("progressButton", BindingFlags.NonPublic | BindingFlags.Instance);
ProgressButton oButton = (ProgressButton)oInfo.GetValue(this);
oButton.Size = new System.Drawing.Size(0, 0);
}
}
You will also need to add a gif image as an embedded resource to your project in the same namespace as the inherited class with the name DefaultAnimation.gif
This is to rectify another unresolved problem with inheriting from the CrystalReportViewer as mentioned here:
http://scn.sap.com/thread/1836467
Once you have done this the annoying message box will no longer be displayed by your derived viewer control (because it has zero size and so is no longer visible).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Or alternatively without using reflection:
public class MyCrystalReportViewer : CrystalReportViewer
{
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
foreach (System.Windows.Forms.Control oControl in this.Controls)
{
if (oControl is ProgressButton)
{
oControl.Size = new System.Drawing.Size();
}
}
}
}
Hope this is of use to someone.
User | Count |
---|---|
62 | |
9 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.