with RB7 i generate a lot of reports with a Custom Preview witch opens maximized. After installing RB7 for D6 I get only a little window. The WindowsState property didnt work.
In RB 7, we added the PreviewFormSettings to the Report. This is the new way to configure your report preview forms. If you created a TppPreview descendent and are wanting to use this to maximize its parent TppPrintPreview form, then it won't work. The reason is that the new property has to modify the print preview form after it is created. There is no method you can override on the TppPreview class to allow you to update this after the producer has set the preview form setting properties. However, there is the Report.OnPreviewFormCreate event which does get triggered and will allow you to configure each report to use the old method of creating a maximized preview with the zoom set to 100 percent as described in the tech tip article. If you use this technique in the past, then it will still work in RB 7. The other option is to use the new property to configure the preview form settings.
procedure TForm1.ppReport1PreviewFormCreate(Sender: TObject); begin
You have two options, one is to open up every form and set this property on the report in the object inspector.
The second option is to revert the behavior to the old way. You should be able to open up ppProd.pas in your RBuilder\Source directory and comment out the call to SettingsToPreviewForm in the TppProducer.PrintToScreen method. Change your library path to RBuilder\Source from RBuilder\Lib and rebuild your project. It tried it and it will work.
Comments
way to configure your report preview forms. If you created a TppPreview
descendent and are wanting to use this to maximize its parent
TppPrintPreview form, then it won't work. The reason is that the new
property has to modify the print preview form after it is created. There is
no method you can override on the TppPreview class to allow you to update
this after the producer has set the preview form setting properties.
However, there is the Report.OnPreviewFormCreate event which does get
triggered and will allow you to configure each report to use the old method
of creating a maximized preview with the zoom set to 100 percent as
described in the tech tip article. If you use this technique in the past,
then it will still work in RB 7. The other option is to use the new
property to configure the preview form settings.
procedure TForm1.ppReport1PreviewFormCreate(Sender: TObject);
begin
ppReport1.PreviewForm.WindowState := wsMaximized;
TppViewer(ppReport1.PreviewForm.Viewer).ZoomSetting := zs100Percent;
end;
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
its a fine solution and it works.
Is there a way to change the settings generally in one position.
I have to change about 100 Forms .
Thanks
Knut Lambert
CONSILIUM GmbH
the report in the object inspector.
The second option is to revert the behavior to the old way. You should be
able to open up ppProd.pas in your RBuilder\Source directory and comment out
the call to SettingsToPreviewForm in the TppProducer.PrintToScreen method.
Change your library path to RBuilder\Source from RBuilder\Lib and rebuild
your project. It tried it and it will work.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com