Slow preview in 14.07
We recently upgraded from 10.08 to 14.07. Running large multi-page
reports seems to be slower in the new version. Based on the "Drawing
page 1 for " message, it seems to be "drawing" about one
page per second. The fun thing is that if you move the mouse over the
window or type keys on the keyboard while it's "drawing", it goes fast.
It's not using much CPU when it's going slow and it's using more when
it's going fast.
Has anyone else run into behaviour like this?
reports seems to be slower in the new version. Based on the "Drawing
page 1 for " message, it seems to be "drawing" about one
page per second. The fun thing is that if you move the mouse over the
window or type keys on the keyboard while it's "drawing", it goes fast.
It's not using much CPU when it's going slow and it's using more when
it's going fast.
Has anyone else run into behaviour like this?
This discussion has been closed.
Comments
We have not seen behavior like this with RB 14. In fact most users have
reported an increase in generation speed due to the background thread
processing added for RB 14. Below are a couple items to try to isolate
the issue.
1. First upgrade your version to 14.08. Contact
info@digital-metaphors.com with your serial number for upgrade instructions.
2. Try setting PreviewFormSettings.SinglePageOnly to True (or
Viewer.SinglePageOnly if you are not using the Preview) and re-test your
application. This will remove the threading logic and generate reports
the same way it did in RB 10. Does this speed things up?
3. Try running your reports on a different machine and see if you get
the same results.
4. Try running your reports without data to rule out the possibility
that this is a data access issue.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
far...
This didn't seem to make any difference.
I set PreviewFormSettings.SinglePageOnly to True and ran the report.
When I pressed the Last Page button, the remaining 30 pages generated
almost immediately without me wiggling my mouse.
This problem was first reported on a different machine.
Pardon my ignorance, but how do I run a report without data and still
have it generate several pages? By hooking up a report to a pipeline
other than a TppDBPipeline?
Sorry, #4 was more if all the other options had no effect. It appears
the issue is caused by the threaded page generation when SinglePageOnly
is set to False.
Does your application by chance have any DB controls (DB Grids, etc.)
connected to the same datasets the report is connected to during
execution? If so, this can cause issues with the threading mechanism
used for the new multi-page preview. Be sure you either call
DisableControls on the dataset before printing the report or keep all
Report datasets separate from other form controls.
myDataSet.DisableControls;
try
myReport.Print;
finally
myDataSet.EnableControls;
end;
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
The dataset is only used for this report I'm testing.
Do I lose any functionality if I work around this issue by setting
SinglePageOnly=True?
Setting SinglePageOnly to True will remove the ability to continuously
scroll pages in the preview/viewer (i.e. the way it worked in RB 12 and
earlier).
If you can recreate this with a simple example that I could run on my
machine, please send it to support@digital-metaphors.com in .zip format
and I'll take a look at it.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
was going on. An important detail that I should have mentioned (but
it's never mattered before) is that our reports are compiled into DLLs
instead of directly into our applications.
ReportBuilder's new page generation code (SinglePageOnly=False) relies
on calls to Synchronize in ppThreadedPageCache.pas, but calling
Synchronize doesn't work properly in a DLL. Hurray for Delphi threading!
I can work around the issue by creating a TTimer that continually calls
CheckSynchronize from within the DLL while the report is being run.
preview works great.
I recommend following the guidelines in the RB DLL demo. Delphi VCL requires
the Application.Handle be passed from a Delphi app that calls a Delphi DLL.
Below is portion of the DLL example..
{------------------------------------------------------------------------}
{ShowForm - exported function for DLL example
1. When calling a DLL from Delphi, pass the Application.Handle
example:
ShowForm(Application.Handle);
2. When calling from a non VCL environment, pass 0 and a new application
handle will be created
example:
Showform(0);
}
function ShowForm(aAppHandle: THandle): Bool;
var
Form1: TfrmDLL;
begin
// use specified app handle or create a new one, as needed}
if (aAppHandle <> 0) then
Application.Handle := aAppHandle
else
Application.CreateHandle;
{create the form}
Form1 := TfrmDLL.Create(nil);
{must be modal for DLL calls (never modeless) }
try
Result := (Form1.ShowModal = mrOK);
finally
Form1.Free;
end;
end;
-
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com