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

Re: Control Preview Form visibility Part II

edited February 2002 in General
Jim:

I'm back with my problem. I've tried to do it the way u tell.
I didn't reach the end.It takes me to a lots of other small problems, i have
to control lots of things.
Besides if i can do it in a way that when user tells application to show
report, it's already in memory and it's just put it visible,
why should i make it in a way that when user tells application to show
report, application must load the report and show it.I think it's not the
optimized way to do it.I know it's just a couple seconds, but on the fly
it's the best way.

You wrote:
You aren't gonna want to change the interface section of RB source if
you have RAP.

I don't use RAP, just standard Delphi code.

You wrote:
The TppProducer ancestor provides a PreviewForm property, so you should
be able to set its Visible property.

Yes, but not funcional because you in ppProd.PrintToScreen you call show,
what makes the form visible

Comments

  • edited March 2002
    You can create a device which generates the report pages to memory with
    Report.CachePages = True. Then interact with the user, then call report
    print method.

    uses
    ppTypes, ppDevice;

    procedure TForm1.Button1Click(Sender: TObject);
    var
    lDevice: TppScreenDevice;
    begin

    ppReport1.CachePages := True;

    lDevice := TppScreenDevice.Create(Self);
    lDevice.PageSetting := psAll;
    lDevice.Publisher := ppReport1.Publisher;

    ppReport1.PrintToDevices;

    ShowMessage('Get User Selection');

    ppReport1.Print;

    lDevice.Free;

    end;



    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.