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

Custom Prievew

edited October 2005 in General
Is it possible to have multiple instances of a custom preview on screen if
its not modal .. SO they can prievew two documents at the same time in two
windows ?

Comments

  • edited October 2005
    Hi,

    Yes, but you will need to create or place multiple TppReport objects on your
    form in order to view more than one report at the same time.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2005
    I am creating them dynamically using Loadfromdatabase Then Print .. The
    custom preview window is displayed automatically .. How do i direct it to
    instance a new preview window ?


  • edited October 2005
    Hi Adrian,

    So you would need to dynamically create the TppReport objects and load the
    templates from database based on how many reports you would like to view at
    the same time. If the custom preview is properly registered there it will
    automatically be displayed. Example... (this is rough psuedo code).

    var
    lReport: TppReport;
    lList: TList;
    liIndex: Integer;
    begin

    lList := TList.Create;

    try
    for (liIndex := 0 to NumberOfReports - 1) do
    begin
    lReport := TppReport.Create(nil);
    lReport.Template.DataBaseSettings....
    lReport.Template.LoadFromDatabase;
    lReport.ModalPreview := False;
    lReport.Print;

    lList.Add(lReport);
    end;

    finally
    for (liIndex := lList.Count -1 down to 0) do
    lList[liIndex].Free;
    end;
    end;


    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2005
    yes had already spotted it foloowing your note . was assigning them to teh
    same PPreport (sorry)

    While your at it .. I have added an email buttin to the Preview Page . i
    need to run ExportToPdf(PPreport1.. code ..
    what is the paramater from the Customeviewer that gets me back to the report

    What i need is something like ExportToPDF(PPViewer1.Report,Filename) ..
    But Report points to a PPProducer not a PPreport

  • edited October 2005
    Hi Adrian,

    TppProducer is the ancestor of the TppReport object. If you typecast the
    Report property as a TppReport object, you will have full access to the
    report.

    --
    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.