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

Multiple report generation in one action

edited July 2003 in End User
D5, RB6.03 Ent

My end user designs and saves reports using the Report Explorer. Reports
have the normal pipelines, auto search criteria etc.

User previews individual reports via the Explorer and clicks 'OK' when the
Search criteria window shows. Fine for single reports.

How do I go about making it easy for the end user to select a number of
reports and have them all print while he goes and has a cup of tea.

Does anyone have examples or of code to achieve it preferably using the
Report Explorer to select the reports he wants to print.

Comments

  • edited July 2003
    The solution is to create a custom report explorer form replacement so that
    you can code this feaute into a menu option or popup option. Then you can
    allow the multi selection to take place. Then when you want to print the
    reports, you can print them all by loading each report in the selection and
    print them. Assuming you have the same autosearch criteria for each report,
    then for the first report, allow ShowAutoSearchDialog to be true so the user
    cna enter some values. Then grab these values in the OnAutosearchDialogClose
    event. Then when you programatically load the other reports
    (Report.Template.LoadFromDatabase) and set ShowAutosearchDialog to false and
    assign the autosearch values you've stored and apply them in the
    Report.OnGetAutosearchValues event.

    *See the Autoserach demos for an example of setting end user search criteria
    in code.

    *See the tutorials folder of our installation for an example of replacing
    the report explorer form.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited July 2003
    Sorry for intruding into other's topic, but I have a question.
    But what whould he needed to do in the case when the reports have different
    autosearch criterias?
    There must be some way to fill all AutoSearch values first and then print
    all the reports using inputted values.
    Is there a way?

    Thanks,
    MB.

  • edited July 2003
    You would have to load all of the reports to get hte autosearch fields, then
    build a list of them so you could construct a single autosearch dialog that
    showed all the fields. One way to do this is to create the autosearch fields
    dynmaically for the first report so that the auto-created autosearch dialog
    would create an all encompassing dialog and then grab the values entered
    after the user close the dialog and stick them in a list for other reports,
    just as the autosearch demos show how to get the values the user entered to
    apply to SQL WHERE clauses and filters. Then as each subsequent repor tis
    loaded, check the autosearch fields it needs and then apply the values
    accordingly. Create a new class to handle all of this for the report
    explorer. Basically, this class can be given a list of reports to be loaded
    and it can load them, do the autosearch stuff and then print them one by one
    with the appropriate search values. That way your code changes to a custom
    report explorer form are minimal as the real code is delegated to the helper
    class to print these reports from the database.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited July 2003
    Thanks for all the advice this is now working beautifully!

This discussion has been closed.