Home End User
New Blog Posts: Merging Reports - Part 1 and Part 2

ppDesigner - Preview Zoom Setting

edited December 2005 in End User
RB 9.03

I am setting in a Report property PreviewFormSetting.ZoomSetting =
zsPageWidth, but when I preview it at runtime in design mode (workspace) it
does't work.
How can I set PreviewFormSetting.ZoomSetting = zsPageWidth every time when I
preview a Report from workspace?

Thank You

Comments

  • edited December 2005
    Hi Vincenzo,

    Are you loading your report from a template? If so, you will either need to
    save the template down with this property already set or set the property
    inside teh Template.OnLoadEnd event.

    If no templates are involved, try placing a break point on the line of code
    where you set the zoomsetting and be sure it is firing before the previewer
    is loaded.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited December 2005
    Yes, I load it from a template. I am setting it OnLoadEnd event, but it
    doesn't work fine.


  • edited December 2005
    Hi Vincenzo,

    As a test I saved a template file with the zoomsetting at zsWholePage, then
    created a simple app that loads the template and in the OnLoadEnd event sets
    the zoompercentage to zsPageWidth. This works correctly for me. How is
    your app different. The code I'm using is posted below.

    uses
    ppTypes;

    procedure TForm1.Button1Click(Sender: TObject);
    begin
    ppReport1.Template.FileName := 'c:\Test.rtm';
    ppReport1.Template.LoadFromFile;
    ppReport1.Print;
    end;

    procedure TForm1.FormCreate(Sender: TObject);
    begin
    ppReport1.Template.OnLoadEnd := TemplateOnLoadEnd;
    end;

    procedure TForm1.TemplateOnLoadEnd(Sender: TObject);
    begin
    ppReport1.PreviewFormSettings.ZoomSetting := zsPageWidth;
    end;

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited December 2005
    Try to see at runtime when you are in preview page of workspace of a
    ppDesigner.

  • edited December 2005
    Hi Vincenzo,

    Inside the OnShow event of the designer you can access the Viewer property
    of the DesignerWindow object and set this value.

    procedure TForm1.ppDesigner1Show(Sender: TObject);
    begin
    TppDesignerWindow(ppDesigner1.Form).Viewer.ZoomSetting := zsPageWidth;
    end;

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.