Display Multiple Reports Per Page

Display Multiple Reports Per Page

You can create a report that displays multiple reports per page. To do this, you create a new Advanced Rule and include more than one underlying PACE Report Profile in it. You create one designer for each Report Profile, and then create a third designer which combines the two into one larger designer.

  1. In Reporting Center, click Build Report Components.

  2. Click the Components tab.

  3. Expand the Advanced Reporting folder under Report Rules.

  4. Click Compose to create a new Advanced Report Rule.
    You see the Advanced Report Rule dialog box.

  5. Complete the following fields and section on the Advanced Report Rule dialog box:
    Name: Enter a descriptive name for the Advanced Report Rule.
    Available Reports: This is associated with the Visual Basic portion of the Advanced Report Rule. Leave this section blank. You populate this section after the Visual Basic component is complete.
    Profiles section: Select the underlying PACE Report Profiles to associate with this Advanced Report Rule.

  6. Click New.
    You see the Select Profile dialog box.

  7. Double-click a PACE Report Rule.
    You see the Advanced Report Rule dialog box.

  8. Click inside the cell that corresponds with the Table column and type the name of the table that stores the Advanced Report Rule information so that it can be accessed within Visual Basic. The table name is limited to 29 characters and cannot contain spaces.

Add the Second Underlying Report Profile

To add the second underlying Report Profile to the Advanced Report Rule:

  1. Click New.
    You see the Select Profile dialog box.

  2. Double-click a PACE Report Profile.
    You see the Advanced Report Rule dialog box.

  3. Click inside the cell that corresponds with the Table column and the second PACE Report, and type in the name of the table that stores the Advanced Report Rule information so that it can be accessed within Visual Basic.

  4. Click Finish.
    You see a warning dialog box appears, containing a message about missing Visual Basic information.

  5. Click Yes.
    The Report Studio re-appears. The shell Advanced Report Rule is complete.

Create the Advanced Report Profile

Next, you create the Advanced Report Profile.

  1. Click Explore to return to the Report Studio.

  2. Click the Reports tab.
    You see the Interface Selection dialog box where you can select the PACE Advanced Reporting Add-in interface.

    Advanced Reporting Add In
  3. Select an interface, and click Enable.

  4. Click Compose and select Advanced Reporting.
    You see the Advanced Report Profile-Step 1 of 3 dialog box.

  5. Right-click under Selected Rules and click Add.

  6. Select the Advanced Report Rule that you created in the previous section and click OK to add it to the Selected Rules List.
    You return to the Advanced Report Profile-Step 1 of 3 dialog box.

  7. Select an Entity and add it to the Advanced Profile.

  8. Click Next.
    You see the Advanced Report Profile-Step 2 of 3 dialog box. Use this dialog box to schedule the report.

  9. Click Next.
    You see the Advanced Report Profile-Step 3 of 3 dialog box.

  10. Name the Advanced Report Profile. Click Finish.

  11. Double-click the completed report to open it.

  12. Click Export from the Report Viewer and save the report results in Microsoft Access format.

Build the Report Project

Next, you start Visual Basic to build the Report Project and its associated designers - one designer for each Advanced Report Rule and a third designer that combines the two.

  1. On the File menu, click New Project.
    You see the New Project dialog box.

  2. Highlight ActiveX DLL and click Open.
    You see the PACE Advanced Reporting Add-in interface selection dialog box.

  3. Select the appropriate version and Database Library and click Enable.
    You see the main Project1-Microsoft Visual Basic (design) window.

    Project1-Microsoft Visual Basic (Design) Main Window
  4. On the Project window, at the top‑right corner of the window, right-click Class1 and select Remove Class1.

  5. You see a dialog box prompting you to Save Changes to the following files. Click No.

  6. On the Project window, highlight Project1. Then, on the Properties window, highlight Project1 and rename it.

  7. Add a blank designer. On the Project menu, click Add Data Dynamics ActiveReports.
    You see the Active Report1 window.

  8. Drag the corner of this window so that it fills the monitor, and then maximize the design window.

  9. Rename ActiveReport1. On the Project1 window, highlight ActiveReport1. Then, on the Properties‑ActiveReport1 window, next to Name, highlight ActiveReport1 and rename it.

  10. On the left menu, click the DAO button, .

  11. Click and draw a box about the size of the button in the Detail area. The button appears highlighted in the Detail section.

  12. Change two of the DAO properties located in the Properties-DAODataControl1 window.
    The RecordSet Type is currently set to 1=Dynaset. Click inside the value cell. Then, click the drop‑down list and change it to 2=Snapshot. The Dynaset setting requires going to the database to retrieve the records as they are accessed. The Snapshot setting retrieves the complete record and does not require accessing the database for each record. The Snapshot option is much faster, especially in bulk reports.
    This example illustrates a top 10 report so that only the rows with the top ten amounts are displayed. In the Properties-DAODataControl1 window, highlight the value cell next to MaxRows and change the value from 0 to 10.

  13. Now, sort the rows in descending order by value, so that the 10 rows displayed are the top 10 values.

  14. Right-click the highlighted button and select Properties.
    You see the DAOData Control Properties window.

  15. Browse by DatabaseName. This refers to the database name that you supplied when you created the Advanced Report Profile. The Select Database dialog box appears. Access the folder containing the .MDB, and click Open. The DatabaseName is populated.
    The RecordSource section defines how to obtain data from the table. This is the target table defined in the Advanced Report Rule. In this section, type:
    select * from TableName where [security description] <>’total’

  16. Click Apply and then click OK.

  17. Decrease the size of the Detail section so that the DAO button is hidden. To do this, move the cursor so that it is just touching the PageFooter section. A double arrow appears. Click and drag the section upward. Leave about a half inch of space within the section.

  18. Click the Fields button to display all possible fields as defined by the RecordSource.

  19. Add the fields to the Detail section by clicking and dragging each field into the section.
    To format each field either right-click the field and select Properties, or open the Properties window for that field and click the Output Format cell.

  20. Order the data by the Amount, so that you are displaying the top ten amounts when the number of rows to display is limited to ten. Open the Detail section again, right-click the DAO button and select Properties. The DAODataControl Properties window appears. Place your cursor at the end of the line in the RecordSource section and then click the spacebar to create a space. Type the following. As you type it, the new string moves to the next line in the section:
    order by [amount field name] desc
    The line of code should now read:
    select * from TableName where [security description] <>’total’ order by [# # # #] desc.

  21. Click Apply and then click OK. Minimize the Detail section so that only the fields are displayed.

  22. Add a report title to the report. To do so, you need to add a new section. Right-click in the design window and select Insert-Report Header > Footer. Two additional sections appear in the report: ReportHeader and ReportFooter.

  23. Add a report title and report column headers to the ReportHeader section. You may have to increase the size of the ReportHeader section to create room for the column headers.
    For each new column header, click the Label button,  to add a label. Change the name of the label by using the Caption property on the Properties window.
    You can format all of the column headers at once. Use your mouse to draw a rectangle that surrounds at least part of each label. All of the labels become highlighted. Use the buttons in the toolbar to change alignment and format. To align objects, highlight all of the objects, right-click and select Align. You also can use the Ctrl-Arrow keys on your keyboard to move several objects at one time after the items are highlighted.

Save the Project

To save the project:

  1. On the toolbar, click Save. Or, select Save Project from the File menu.
    You see the Save File As dialog box.

  2. Access the folder where you want to save the Designer file and click Save.
    You see a second Save File As dialog box where you can save the Exposer class file.

  3. Click Save.
    You see the Save Project As dialog box where you can save the project.

  4. Click Save.

Preview the Report

To preview the report:

  1. To preview reports, click Make ProjectName.dll on the File menu.
    You see the Make Project dialog. In this dialog box, the file name defaults to the Project Name.

  2. Click OK.

  3. From the Windows desktop, double-click the Advanced Report Tester button.
    You see the Advanced Report Tester dialog box.

  4. In the Report File (MDB or ADV) section, click Ellipsis and select the Access database created by the Advanced Profile.

  5. In the Select Report DLL Name section, enter the Project Name. The Select Report Name section is automatically populated with the name of your designer.

  6. Click View.
    The report appears in a window. View the report to determine if you need to make changes to the report, such as the positioning of certain fields or field formats

Create the Second and Third Designer

Next, create the second and third designer.

This example describes one possible use of the main Designer. In practice, this Designer can be created so that it contains and displays any data.

  1. Create the second Designer in this project. On the Project menu, click Add Data Dynamics ActiveReports. You see the Active Report2 dialog box. Duplicate and save the Designer.

  2. Create the third designer in Visual Basic in the same project. Use this designer to combine the other two designers into one report. On the Project menu click Add Data Dynamics ActiveReports.
    You see the Active Report1 dialog box. Drag the corner of this window so that it fits most of the window, and then maximize the design window.

  3. Rename ActiveReport1. On the Project window, highlight ActiveReport1. On the Properties window, click the Name and type the new name.

  4. On the left menu, click DAO. Click and draw a box about the size of the button in the Detail area.
    The button appears highlighted in the Detail section.

  5. With the DAO button still highlighted, click in the cell next to RecordSetType in the bottom right corner of the Properties window. The RecordSetType is currently set to 1=Dynaset. Click inside the value cell. Then click the pull-down menu and change it to 2=Snapshot. The Dynaset setting requires going to the database to retrieve the records as they are accessed. The Snapshot setting retrieves the complete record and does not require accessing the database for each record. The Snapshot process is much faster, especially in bulk reports.

  6. Right-click the highlighted button and select Properties.
    You see the DAOData Control Properties dialog box.

  7. Next to DatabaseName, click Ellipsis.
    You see the Select Database dialog box. The database name you select is the database name you supplied when you created the Advanced Report Profile.

  8. Access a folder, highlight the Access database, and click Open.
    The DatabaseName is populated.

  9. The RecordSource section defines how to obtain data from the table. In this case, access the PCRE_PKG table.
    This table contains information about the Advanced Report Profile Start and End date, the Advanced Report Profile ID, and the Advanced Report Profile name. This is added to the Designer when information such as page numbering and the effective date of the report need to be added to the report. In this section, type: select * from pcre_pkg.

  10. Click Apply and then click OK.

  11. Decrease the size of the Detail section so that the DAO button is hidden. To do this, move your cursor so that it is just touching the PageFooter section. A double arrow appears. Click and drag the section upward. Leave about half an inch of space within the section.

  12. Click the icon to display all possible fields as defined by the RecordSource.

  13. Add the end_date field to the PageFooter section by clicking and dragging the field into the section.

  14. To format the field right-click the field and select Properties, or access the Properties window for that field and click in the Output Format cell.

  15. Change the output format property of the End Date field to the Date category. Highlight a Type. Click Apply and then click OK.

  16. Add a report title to the PageHeader section. This title appears on each page in the report.

Link the Designers

To link the Designers together:

  1. Click Subreport Control . Draw a box the width of the page inside the Detail section.

  2. Click Subreport Control. Draw a second box the width of the page inside the Detail section, underneath the first box.

  3. Enter the following code:
    Set DAODataControl1.Recordset = m_db.OpenRecordset(DAODataControl1.RecordSource)

  4. Return to Visual Basic.

  5. In the Project-(one of the top ten reports) window, double-click the first designer.

  6. Click View Code.
    You see the Code window.
    Make sure that the two drop‑down menus at the top of this window read: ActiveReport and ReportStart, respectively. Once the drop‑down list are changed, the cursor blinks just above the line of code End Sub. Paste the line of code above into the window.

  7. On the Project window, double-click the second designer.

  8. Click View Code.
    The Code window appears.

    Make sure that the two drop‑down lists at the top of this window read: ActiveReport and ReportStart, respectively. Once the drop‑down list are changed, the cursor blinks just above the line of code End Sub. Paste the line of code above into the window.

  9. Copy the following code.
    Dim h# as new subreportname

    Set h#.m_db = m_db

    h#.m_id = m_id

    Set subreport#.object = h#

  10. Return to Visual Basic.

  11. On the Project window, double-click the third, main designer.

  12. Click View Code.

    You see the Code window.
    Make sure that the two drop‑down lists at the top of this window are ActiveReport and ReportStart, respectively. Once the drop‑down lists are changed, the cursor blinks just above the line of code End Sub. Paste the four lines of code from above into the window. Add a space and paste the second copy of the code.

  13. Make the following changes to the code just pasted:
    In the first four lines of code, change all of the #’s to 1.
    In the second four lines of code, change all of the #’s to 2.
    Change the subreport name in the first four lines of code to the First Designer name.
    Change the subreport name in the second four lines of code to the Second Designer name.

  14. On the toolbar, click Save, or click Save Project on the File menu to save the project.

  15. You see the Save File As dialog box allowing you to save the designer file.

  16. Navigate to the folder and click Save.

  17. On the File menu, click Make ProjectName.dll to preview the report.

    You see the Make Project dialog box. The file name defaults to the Project Name.

  18. Click OK.

  19. On the Windows desktop, double-click the Advanced Report Tester button.

    You see the Advanced Report Tester window.

  20. In the Report File (MDB or ADV) section, click Ellipsis and select Access database. This is the name of the database defined in the Advanced Report Profile.

  21. In the Select Report DLL Name section, type the Project Name. This is the name of the project that you created in Visual Basic. After you populate this field, the Select Report Name section populates with all of the designers of that project. In the Select Report Name section, click the drop‑down list and choose the main Designer.

  22. Click View.
    The report appears in the window. Make any necessary changes to the report, such as the positioning of fields or field formats.

  23. Copy the Project DLL (project) to the Auto Registry engine common files location directory on the PACE Server to finish the cycle. The file registers and moves to the destination directory automatically, and the names of the project and designers are added to the PACE_MASTER.DBO.ADV_REPORT_LIST table.

  24. Return to PACE and edit your Advanced Report Rule. Select the project and designer name from the Available Reports drop‑down list. Click OK. The report now appears in the Advanced Reporting folder in Reports Explorer.
    The following displays an example report that contains group levels.

    example of two reports per page

Create a Package of Reports

To create a package of reports:

  1. Click the Reports tab in the Report Studio.

  2. In the Advanced Reporting folder, highlight an existing Advanced Report Profile and click the Compose > Edit button. Or, highlight the Advanced Reporting folder and click Compose.
    You see the Advanced Report Profile-Step 1 of 3 window.

  3. In the Selected Rules section, right-click and select Add. Select an Advanced Report Rule to add to the Selected Rules list. If you are creating a new Advanced Report Profile, add a second Advanced Rule.

  4. From the Entity Name list, highlight an Entity and click Add. Then click Finish.

  5. View the report.