Disable Preview Form Re-Draw
Greetings,
I have some forms I'm launching from the Preview Form by utilizing the
OnDrawCommandCreate and OnDrawCommandClick of a label.
This works great when I'm launch a form as a modal form. The problem I'm
encountering is when I launch a form as non-modal.
The report redraws when it gets focus. This causes it to land back on
the 1st page. Which if the user is x^pages in will cause them to lose
their place in the report.
1. Why does it not re-draw when I launch a modal form, but does re-draw
when I launch a non-modal form?
2. Can I disable this re-draw feature?
3. If not, can I capture the re-draw and re-position on the page they
were previously on?
Thanks for your time,
Dusten
I have some forms I'm launching from the Preview Form by utilizing the
OnDrawCommandCreate and OnDrawCommandClick of a label.
This works great when I'm launch a form as a modal form. The problem I'm
encountering is when I launch a form as non-modal.
The report redraws when it gets focus. This causes it to land back on
the 1st page. Which if the user is x^pages in will cause them to lose
their place in the report.
1. Why does it not re-draw when I launch a modal form, but does re-draw
when I launch a non-modal form?
2. Can I disable this re-draw feature?
3. If not, can I capture the re-draw and re-position on the page they
were previously on?
Thanks for your time,
Dusten
This discussion has been closed.
Comments
Which version of ReportBuilder and Delphi are you currently using?
Using the latest version of ReportBuilder I am unable to recreate this
behavior with a simple application using a non-modal preview.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I'm only talking about a modal preview form.
frustratingly obvious ModalPreview property on the TppReport.
And it does work great when the report is non-modal.
But I am holding out hope that there's a way to do what I want with a
modal report.
Thanks for your time
Dusten
I apologize, I misread your initial post. When you mentioned that you
were using a modal preview, I assumed you were aware of and altering the
ModalPreview property.
I performed the same test with a modal preview and was unable to cause
the report to refresh when changing focus from the previewer.
If possible, please provide me with some simple steps to recreate this
issue on my machine. Below are my steps.
1. Run a simple Delphi application from the IDE.
2. Preview a simple 100 page report.
3. Navigate to a random page other than the first.
4. Change focus to another application running on the machine (MS Word).
5. Return focus to the Preview window.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
application. As a reminder I'm using Delphi XE3 and RB 15.05 Build 275
1. Create a VCL application inside of Delphi.
2. Add a second form to the application.
3. Add a report to the main form. Tie it up to a dataset that has
sufficient data to print a few pages.
4. Add 2 labels to the report on the detail band and assign the
following code on their OnDrawCommandClick events.
Label1
Form2.ShowModal;
Label2
Form2.Show;
5. Run the application, browse to the second page, click on label 1.
Close the modal form and notice the report does not re-draw.
6. Click on label 2. Close the form, or put your focus back on the
report and notice that the report does re-draw, and goes back to the
first page.
I'd be happy with a work around as well if there is no way to prevent
re-draw on modal previews.
Thanks again
Dusten
Sorry for the delay, I was able to reproduce this behavior and we are
currently researching a solution.
You can currently work around the issue by setting the
Report.PreviewFormSettings.SinglePageOnly property to True.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Registered RB 16 users can email support@digital-metaphors.com to
receive the patch.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com