(annoying) auto refresh feature
Zhou X.B.
Indonesia
Hi everybody,
I am new to Fastreports, previously I was using Crystal Reports w/ Delphi 7 to develop application. Recently my componay upgrade to Delphi XE2 which comes w/ Fastreports. I found Fastreports is really fast. But I have some problems because I don't understand Fastreports well, yet.
My application is a VCL & MDI application, all reports are previewed in modeless windows. I use some ad hoc TClientDataSets to query database server, then connect reports to these TClientDataSets. Previously with Crystal Reports, I can do things like this:
- run query to get data for date Jan/01 - Jan/15, pass the TClientDataSets to preview module and show preview window
- repeat the same for Jan/16 - Jan/31
- I get two preview windows, first w/ data for Jan/01 - Jan/15, second for Jan/16 - Jan/31
I try the same with Fastreports which is obviously faster than Crystal Reports in showing preview window. But, I got two preview windows w/ same information, both showing data for Jan/16 - Jan/31 which is the results from the second (last) query.
I think this is because of auto-refresh feature of Fastreports, both of the preview windows reflect current data seamlessly, actually this is not needed by my application. I wonder whether there is an option to switch off this auto-refresh feature. Thanks for any reply.
Regards,
Zhou X.B.
I am new to Fastreports, previously I was using Crystal Reports w/ Delphi 7 to develop application. Recently my componay upgrade to Delphi XE2 which comes w/ Fastreports. I found Fastreports is really fast. But I have some problems because I don't understand Fastreports well, yet.
My application is a VCL & MDI application, all reports are previewed in modeless windows. I use some ad hoc TClientDataSets to query database server, then connect reports to these TClientDataSets. Previously with Crystal Reports, I can do things like this:
- run query to get data for date Jan/01 - Jan/15, pass the TClientDataSets to preview module and show preview window
- repeat the same for Jan/16 - Jan/31
- I get two preview windows, first w/ data for Jan/01 - Jan/15, second for Jan/16 - Jan/31
I try the same with Fastreports which is obviously faster than Crystal Reports in showing preview window. But, I got two preview windows w/ same information, both showing data for Jan/16 - Jan/31 which is the results from the second (last) query.
I think this is because of auto-refresh feature of Fastreports, both of the preview windows reflect current data seamlessly, actually this is not needed by my application. I wonder whether there is an option to switch off this auto-refresh feature. Thanks for any reply.
Regards,
Zhou X.B.
Comments
I think you need two instances of TfrxReport to do this.
Best Regards,
Cristian Peţa
I try to understand your concept of those two preview windows.
A.
Does your end user need to see them both at the same time (like cascade or tile)?
Or maybe end user will select which preview he/she wants to see and will select one of them for viewing on a full screen.
B.
Is it possible to show your data (1st part of Jan, 2nd part of Jan) in one preview?
I mean - first n pages (let's say 1-3) may show data from 1-15 Jan, the next n pages (let's say 4-6) will show data from 16-31 Jan.
Which option of the above two (A. or B.) may be implemented in your report?
The version which comes with Delphi is totally inadequate for any serious work.
Don't waste your time trying to get things to work with the Embarcadero version.
Hi,
At design time simply drop two TfrxReport (frxReport1 and frxReport2).
Or create two instances at run time.
Best Regards,
Cristian Peţa
Hi Mick,
Thanks again, and sorry that it*s quite a while to reply you,. Certainly my case is A, I also need a feature that could let user see preview windows when all clientdatasets are freed (coz I used adhoc clientdatasets)
Hi,
Preview in FR is somehow live-preview. You need active datasets.
Because this I say that you need two frxReport and of course two active datasets.
I think the only way to do this with closed datasets is saving both reports in .fp3 format and show them. Or EMF, PDF....
Best Regards,
Cristian Peta
You should:
- Get ready your DataSet for data from Jan 1-15,
- Prepare report without showing it in a Preview,
- Save prepared report to fp3 file or any stream
- Get ready your DataSet for data from Jan 16-31,
- Prepare report without showing it in a Preview,
- Have your application to keep two Preview windows at the same time,
- One Preview should show saved report, second Preview should show the second report.
But I STILL wonder why do you need to complicate that - especially when you've just started your FR adventure ;-)
You may create ONE single report cointaining both halfs of Jan in ONE Preview. You may use FR Outline possibilities to allow your user very easy navigation through the whole report.
Hi Cristian,
I got your point. I just wish Fastreport provide AutoRefresh property that can be TRUE or FALSE, so developers have option of live-preview or static-preview. Is there a chance to request such an update ?
Regards,
Zhou X.B.
Hi Mick,
Thanks for your example, I appreciate it.
Regards,
Zhou X.B.
I wonder what is your decision about solving the issue you've started that topic with.
It isn't a typical FR problem - so could you say a few words about that?
Hi Mick,
If you read my reply to Cristian Peta then you would understand my decision about this topic. Thanks
Regards,
Zhou X.B.