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.
In Reporting Center, click Build Report Components.
Click the Components tab.
Expand the Advanced Reporting folder underReport Rules.
Click Compose to create a new Advanced Report Rule.
You see the Advanced Report Rule dialog box.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.Click New.
You see the Select Profile dialog box.Double-click a PACE Report Rule.
You see the Advanced Report Rule dialog box.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:
Click New.
You see the Select Profile dialog box.Double-click a PACE Report Profile.
You see the Advanced Report Rule dialog box.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.
Click Finish.
You see a warning dialog box appears, containing a message about missing Visual Basic information.Click Yes.
The Report Studio re-appears. The shellAdvanced Report Rule is complete.
Create the Advanced Report Profile
Next, you create the Advanced Report Profile.
Click Explore to return to the Report Studio.
Click the Reports tab.
You see the Interface Selection dialog box where you can select the PACE Advanced Reporting Add-in interface.Select an interface, and click Enable.
Click Compose and select Advanced Reporting.
You see the Advanced Report Profile-Step 1 of 3 dialog box.Right-click under Selected Rules and click Add.
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.Select an Entity and add it to the Advanced Profile.
Click Next.
You see theAdvanced Report Profile-Step 2 of 3 dialog box. Use this dialog box to schedule the report.Click Next.
You see the Advanced Report Profile-Step 3 of 3 dialog box.Name the Advanced Report Profile. Click Finish.
Double-click the completed report to open it.
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.
On the File menu, click New Project.
You see the New Project dialog box.Highlight ActiveX DLL and click Open.
You see thePACE Advanced Reporting Add-in interface selection dialog box.Select the appropriate version and Database Library and click Enable.
You see the main Project1-Microsoft Visual Basic (design) window.On the Project window, at the top‑right corner of the window, right-click Class1 and select Remove Class1.
You see a dialog box prompting you to Save Changes to the following files. Click No.
On the Project window, highlight Project1. Then, on the Properties window, highlight Project1 and rename it.
Add a blank designer. On the Project menu, click Add Data Dynamics ActiveReports.
You see theActive Report1 window.Drag the corner of this window so that it fills the monitor, and then maximize the design window.
Rename ActiveReport1. On theProject1 window, highlight ActiveReport1. Then, on the Properties‑ActiveReport1 window, next to Name, highlight ActiveReport1 and rename it.
On the left menu, click the DAO button, .
Click and draw a box about the size of the button in the Detail area. The button appears highlighted in the Detail section.
Change two of the DAO properties located in theProperties-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 Snapshotsetting 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-DAODataControl1window, highlight the value cell next to MaxRows and change the value from 0 to 10.Now, sort the rows in descending order by value, so that the 10 rows displayed are the top 10 values.
Right-click the highlighted button and select Properties.
You see theDAOData Control Properties window.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’
Click Apply and then click OK.
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.
Click the Fields button to display all possible fields as defined by the RecordSource.
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.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. TheDAODataControlProperties 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.
Click Apply and then click OK. Minimize the Detail section so that only the fields are displayed.
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.
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 theProperties 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:
On the toolbar, click Save. Or, select Save Project from the File menu.
You see the Save File As dialog box.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.Click Save.
You see the Save Project Asdialog box where you can save the project.Click Save.
Preview the Report
To preview the report:
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.Click OK.
From the Windows desktop, double-click the Advanced Report Tester button.
You see the Advanced Report Tester dialog box.In the Report File (MDB or ADV) section, click Ellipsis and select the Access database created by the Advanced Profile.
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.
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.
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.
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.Rename ActiveReport1. On the Project window, highlight ActiveReport1. On the Properties window, click the Name and type the new name.
On the left menu, click DAO. Click and draw a box about the size of the button in theDetail area.
The button appears highlighted in the Detail section.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.
Right-click the highlighted button and select Properties.
You see theDAOData Control Properties dialog box.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.Access a folder, highlight the Access database, and click Open.
The DatabaseName is populated.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
.Click Apply and then click OK.
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.
Click the icon to display all possible fields as defined by the RecordSource.
Add the end_date field to the PageFooter section by clicking and dragging the field into the section.
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.
Change the output format property of the End Date field to theDate category. Highlight a Type. Click Apply and then click OK.
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:
Click Subreport Control . Draw a box the width of the page inside theDetail section.
Click Subreport Control. Draw a second box the width of the page inside the Detailsection, underneath the first box.
Enter the following code:
Set DAODataControl1.Recordset = m_db.OpenRecordset(DAODataControl1.RecordSource)
Return to Visual Basic.
In the Project-(one of the top ten reports) window, double-click the first designer.
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.On the Project window, double-click the second designer.
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.
Copy the following code.
Dim h# as new subreportname
Set h#.m_db = m_db
h#.m_id = m_id
Set subreport#.object = h#
Return to Visual Basic.
On the Project window, double-click the third, main designer.
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.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 theFirst Designer name.
Change the subreport name in the second four lines of code to the Second Designer name.On the toolbar, click Save, or click Save Project on the File menu to save the project.
You see the Save File As dialog box allowing you to save the designer file.
Navigate to the folder and click Save.
On the Filemenu, click Make ProjectName.dll to preview the report.
You see theMake Project dialog box. The file name defaults to the Project Name.
Click OK.
On the Windows desktop, double-click the Advanced Report Tester button.
You see theAdvanced Report Tester window.
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.
In the Select Report DLL Name section, type theProject Name. This is the name of the project that you created in Visual Basic. After you populate this field, theSelect Report Name section populates with all of the designers of that project. In theSelect Report Name section, click the drop‑down list and choose the main Designer.
Click View.
The report appears in the window. Make any necessary changes to the report, such as the positioning of fields or field formats.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.
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.
Create a Package of Reports
To create a package of reports:
Click the Reports tab in the Report Studio.
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.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.
From theEntity Name list, highlight an Entity and click Add. Then click Finish.
View the report.