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

report explorer - several reports

edited December 2004 in End User
Hello,
in report explorer end-user can select several reports at the same time
(multi select), but if the end-user press Print or Print Preview, then shows
up only the last report, not all. Do i need implement that part myself and
how, or what to do ?

Regards,
Simonas

Comments

  • edited December 2004

    You can create a custom report explorer form by copying the existing one and
    registering it with RB. For an example, check out
    RBuilder\Tutorials\Complete\Applications\Custom ReportExplorer.


    --
    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited December 2004
    Hello,
    at first in procedure TrbReportExplorerForm.PrintPreview; we have
    if (FListView.ItemName = '') then Exit;
    FReportExplorer.PrintPreview(FListView.ItemName,
    FListView.FolderId{FListView.ItemId});
    and we should have
    FReportExplorer.PrintPreview(FListView.ItemName, FListView.FolderId); to
    work correctly.

    Now question is how to get selected items id's ?
    we have FListView.SelectionCount property, but we don't have Selections or
    any like that property.
    So how to get these selected items ?

    Regards,
    Simonas
  • edited December 2004
    ok, i've found solution:

    procedure TrbReportExplorerForm.Print;
    var
    i: Integer;
    begin

    if FListView.SelectionCount<=0 then Exit;

    for i := 0 to FListView.Items.Count-1 do
    if FListView.Items[i].Selected then
    FReportExplorer.Print(FListView.Items[i].Caption,
    integer(FListView.Items[i].Data));

    end; {procedure, Print}

    now i've got another problem. How to print all selected items(reports)
    without showing printer dialog? And how to shoe printer dialog for all these
    reports user has selected?

    Regards,
    Simonas
  • edited December 2004

    Simplest approach would be to set Report.ShowPrintDialog to true for the
    first report and set it to false for the rest of the reports. For the first
    report, also set Report.SavePrinterSetup to true. Then after the firtst
    report prints, you can assign the Report.PrinterSetup.PrinterName from the
    first report to the subsequent reports.


    --
    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited December 2004
    Hello,

    how do I get the right Report object in procedure
    TrbReportExplorerForm.Print;?
  • edited December 2004


    There is only one TppReport instance - the one on the form. The TppReport
    can load templates from the database.

    The relationship is...

    Report <-- Designer <-- ReportExplorer

    Programmatically...

    myReportExplorer.Designer.Report





    --
    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited December 2004
    Hello,
    it does not work. PrinterDialog shows again and again.
    I work with v7.04

    "Nard Moseley (Digital Metaphors)" wrote :
  • edited December 2004

    Please create a simple, minimal example. You can use one of the end-user
    examples or the custom report explorer tutorial as a starting point. Modify
    it to show what you are doing. Send in zip format to
    support@digital-metaphors.com and we can check it out.

    The other approach is to work thru it incrementally. For example, place a
    report on a form and set Report.ShowPrintDialog to False. Now call
    Report.Print from a button click event. Does that work? (Answer should be
    yes). Now from there incrementally add complexity to process a list of
    reports.

    --
    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.