Report Design and Layout
Now that you have located the appropriate view to use, copied and renamed an existing report, the next step is to edit the layout. Highlight and right click on the copied report you wish to edit, select the option to Edit the report and click on Layout. When you take the option to edit the Layout, you may be overwhelmed by the Report Designer. In this section we are going to briefly break down the different areas of the Report Design window.
First, at the bottom of the window, you will find two tabs of importance, Design and Preview. The layout can only be edited when in Design view. Check the appearance of you work in progress by using the Preview tab. The Preview tab often limits the data displayed. For a more accurate preview when you are close to completion, we suggest saving the report, close the report designer and actually publish and run a preview.
Note: The Preview tab does not display sub reports.
In the middle of the page you have the actual report layout pane made up of Sections and GroupHeadings with data fields inside. You may find some of these Sections and Group Headings have been given names by the DPSI Development team. These are used to keep parts of the report organized into areas such as the title, column headings, report body, totals and footer information. This is the pane where you physically place the fields and design the layout of the report.
Toolbar Functionality
Besides the regular Standard and Formatting toolbars you have most likely used before, the Report Designer has two toolbars with functions specific to creating and editing the report layout.
The toolbar on the left side of the window you will find the following functions that help you apply objects to your report design.
-
Create a Label
-
Create a Text Box
-
Create a Check Box
-
Create a Rich Text Box
-
Draw an Angular Shape
-
Insert a Picture
-
Draw a Line
-
Insert a Page Break
-
Insert a Bar Code
-
Insert a Sub Report
-
OLE Object
-
Chart Control
-
Report Info
Across the top of the page you will find the Alignment toolbar. In order to use these buttons you will need to select the fields you wish to apply the functions. Select fields by holding down your Control Key and clicking on each field. Notice the field with small blue square boxes. This is the field that will be used as the "guidepost" when aligning other field. This field's position does not change, though the other fields do.
-
Bring to the Front
-
Send to the Back
Align the boxes by using these functions. Align fields to the Grid which is a series of equidistant dots making a grid on the design surface. Aligning to grid forces all the elements selected to line up with these dots.
-
Align to Grid
-
Horizontally boxes to the left
-
Horizontally align boxes to the right
-
Horizontally align boxes to the centers
-
Vertically align boxes to tops
-
Vertically align to the bottoms
-
Vertically align to the middles
Use the Format menu to find the following options.
Resize fields by using these options.
-
Make same Width as the blue selected field
-
Make same Height as the blue selected field
-
Make same Size as the blue selected field
Change the Horizontal Space between selected labels/text boxes.
-
Decrease Horizontal Space between fields
-
Set the Horizontal Space between fields
-
Increase Horizontal Space between fields
Change the Vertical Space between selected labels/text boxes.
-
Decrease Vertical Space between fields
-
Set the Vertical Space between fields
-
Increase Vertical Space between fields
Lock the selected fields and labels in place by using the Lock Controls.
Drop Down Menu Bar Options
On the right side of the window, two panes are displayed. The Fields List allows you to select fields, from the Master View, to be included on the report. And below the Fields List, is the Properties List that offers various functions used to design your report.
If you are creating a new report for the first time the Fields list is blank. To populate this pane go to View on the toolbar and select Data Source.
Again, the Data Source of a report is very important! Data Source is actually the iMaint view that contains all the fields you will have the option to display on your report. A window will appear for you to select a view to attach to the report. Always, use a copy of an iMaint view or use a custom view. DPSI reserves the right to change our views and should you use one in a report, you will run the risk of your report not working after an upgrade.
Report Content Tree
Along the right side of your Design window you will find the Report Content Tree and Properties Box. Use these tools to navigate and define the sections within your layout. This area gives you a tree view of all the different sections within your report. Sections of a basic report generally include Page Header, Group Header, Details, Group Footer and Page Footer. When you copy an existing report, the sections from the original report are kept intact.
On reports you have copied, the same Master View of the original iMaint Report will still be attached. The Fields from the Master View will already appear under the Fields node of the Content Tree. Expand the Fields node to display all the fields within the view. You may see two sections Bound and Calculated. The Bound fields are what is available in your master view for you to use on your report. Drag and drop fields onto the layout and place them where you wish them to appear on the page of the report.
Note: Should you have trouble with the drop and drag feature, you may always add a text box and use the Properties to set the value of the Data Field.
Please, note that we do not recommend that you delete any of the existing fields on a report you wish to customize. Simply, use the Properties Box to set the field not to display. We call this hiding a field. It will be easier to hide a field, rather than delete it and accidentally remove potential data links.
Properties Box
The last area is one of the most important. The Properties List is where all the functions that define properties such as Appearance, Behavior, Data, Design and Layout. Everything in a report is defined using the Properties List. Properties are applied to entire sections like Page Headings or Group Headings and each individual field and labels within each section. When you add or edit an object such as a label, data field or section, place the focus on the object within the layout and the Properties list will allow you to define the attributes of the specific object. Expand each topic node to view and set each option. Depending upon the object selected on the layout area, the Properties include the following topics:
-
Appearance - offers controls to the fonts and colors used on your report.
-
Behavior - options to control word wrapping, hidden sections and field size.
-
Data - offers options to determine the value of fields.
-
Misc. - offers options to help you layout the column and row sizes.
-
Summary - offers options to help create and define totals and sub totals on data fields.
Note: When working in the Properties box, DO NOT use the DELETE key. This will remove the field from the layout grid entirely. Use the backspace key to remove anything in the Properties Box. You may use the delete key to remove items on the layout grid but using the delete key within the Properties Box will remove the object from the layout grid for which you are defining the properties.
To add a new object to the layout page click on the Insert menu, off the main toolbar. Some of the options are also accessed from the icon toolbar running down the side of the design window.
From here, you may add new sections to the report, labels, text boxes and pictures. Some of the options can also be added using the toolbar buttons running down the left side of the layout pane.
Making Changes to the Layout
Now that we have gone over some of the tools and panes, let’s start making changes to the layout. When you copy an original iMaint report the layout will default just as the original was designed. You don't have to create a report from scratch. Find one that is most like the report you wish to design. Make a copy and simply, edit the report to be just what you need.
Before any changes are made, we need to insert this important message that may save you a lot of trouble ahead of time.
Note: When setting the Properties of an object on the layout do not use the delete key. This will delete your object all together. However, if you do take the option to Delete you may use the Undo option under the Edit menu. Or short cut keys Ctrl + Z will undo the delete.
Report Sections
Don’t let the sections on the layout pane confuse you, they are simply used as organizational tools. For example, people typically add the title of a report in the ReportHeader section or add the page numbers to the ReportFooter. The Data Fields are usually added to the Details section in the middle of the layout. A basic, simple report might contain the following sections:
-
ReportHeader with the title
-
GroupHeader which contains the fields used to sort the report
-
Detail with all the data fields you wish to display
-
GroupFooter which may contain any report totals
-
ReportFooter which may contain a logo or page number
Note: Section names in existing iMaint reports may be confusing to anyone outside the DPSI Development team. Renaming and reordering the sections can cause the report not to work correctly.
Removing Extra White Space
If you would like to remove extra white space from a report try moving the fields within each sections as close together as possible. Then move each section up as close to the other sections without covering the fields inside. The goal is to tighten up all the objects on the layout page without overlapping.
For example, try to remove some of the extra white space on the Asset Part List. When you copy the report and open the layout, Section3_DetailSection2 is where all the data fields on the report are listed. There happens to be some extra space around the display data. To tighten up the data on the report, make sure all the fields are aligned to the top of the section, then simply click on the section title and drag it up to cover the extra space.
Do the same with the TSection1 and Section4 by moving each box up just slightly, and drag the section underneath each up to cover the extra space.
Properties of a Section
In this next section we will be using the Work Order by Supervisor report. Make a copy of the original report in iMaint and edit the layout to follow along.
Selecting a section will display the Properties specifically for that section. In this example, the section we have selected is called GroupHeaderSection1_GroupHeaderSection4. Remember, the names of each section DO MATTER and may be confusing but DO NOT change the names. Sections are often linked together and you may lose functionality if you rename a section.
The section GroupHeaderSection1_GroupHeaderSection4 we have selected to Sort the report by Supervisor. You can tell because in the Properties box, under the Data node, the setting called DataField is set to Supervisor ID. GroupHeaders are often used to sort the report. In the example of the Work Order by Supervisor report it’s sorted by the following fields.
-
Site-ID found in TSection1
-
Supervisor_ID in GroupHeaderSection1_GroupHeaderSection4
-
Work_Order_ID in GroupHeaderSection3
Sorting Reports
ActiveReports uses GroupHeadings to sort the reports. However, it will only sort in ascending order. For example, if you have a numeric value that you wish to see all the report records sorted by high to lowest values, do not use a GroupHeading to sort.
Tip: You may try using the sort feature inside the SQL View to set the report to sort in ascending or descending order. Or do not use GroupHeadings at all and use the Sort tab on the Filter window when running the report.
If you need to sort records in your report by a specific field, simply add a new GroupHeading section, and use the properties box to define the data field for which you wish to sort the report. Headings must be added in the correct order you wish to sort. For example, in an inventory report you would add a section for Site ID, then Warehouse ID, then Location.
Follow these steps to add a new section.
-
Add a new section by going under Insert and selecting GroupHeader. The new section will appear under the last GroupHeader on the layout.
-
Reorder the section, placing the new section higher on the layout page, by going under Edit and selecting Reorder Groups. Drag and drop the new section into the position on the tree you desire and click OK.
Again, iMaint reports are all most always sorted by Site ID first. Using the example of the Work Order by Supervisor report, if you want to sort by Site ID, Supervisor ID, Work Order Date Scheduled and then Work Order ID, make sure the new section you plan to add is moved above the section that contains the Work Order ID field. In our example, the new section will need to be placed below the GroupHeaderSection1_GroupHeaderSection4 and above GroupHeaderSection3.
-
Now that you have the sections in the correct order, from the field list, select the field. In this example we are adding Work Order Scheduled Date. Drag and drop wo_date_scheduled into your new section.
-
When you add a new field to the layout, simply drag the field name from the Report Content Tree and drop it onto your layout. For each field you drop onto your layout, you might need to use the Text Box or Label features on the Toolbar to add a label for your data field. Once all fields and labels have been added to the layout, click on each box to set their properties. Use the Properties box to define the appearance of the data value to display.
The Data Field properties are most important. You must set the DataField to the correct field name, which should default when you drag and drop the field from the Report Content Tree. DataField is what tells the report which field of data to sort by and display. When you click in the cell beside DataField, use the drop down box to select the correct field name if it does not already appear. In our example, we selected wo_date_scheduled. Now, the Work Order Date Scheduled should appear in this space on the report.
To format the label for this field, click on the Label box and key the title into the space called Text. Remember, here is where you will need to use the Backspace key to remove the word Label and replace it with your title. If you press Delete, you will remove the entire label box from the layout. In this example, we titled the field WO Date Sched. Under Appearance, you may also set Font for your label.
-
Back on the layout, click on the name of the new section, GroupHeader1, to display it’s properties. Set the DataField to match the name of the field added to the section, wo_scheduled_date.
Make a GroupHeader Display on All Pages
One of the properties of a GroupHeader allows you to set it to display on every page. If you want to see the report title and column headings on each page make sure they are added to a GroupHeading section. Set the field called RepeatStyle, under the Behavior section, to OnPage using the browse button. Below, we are setting the section GroupHeaderSection1_GroupHeaderSection4 to display on each page. When you click in the field, use the drop down menu to select OnPage.
Hide Sections from View
If you would like to remove a section of the report take the option in the Properties box to hide it. Set the field Visible, under Behavior, to False. In the example below, the TSection2 that contains the footer information is set to display. To remove it from the report, Visible will need to be set to False.
Note: Do NOT delete a section on the report, it may remove hidden code added by the DPSI Development team. If you don’t want a specific section or field on a report to display, use the option in the Properties box under Behavior called Visible. Set the Visible option to false.
More complicated reports will often have multiples of each type of section. Sections can be linked together, as in the case of totals and subtotals. Never delete a section or you risk loosing calculations and report functionality.
Adding a Field
Selecting fields to appear on your report is easy. Search for the fields under the Report Content Tree. Under the Fields node, click on Bound to display the list of fields. Drag and drop the appropriate fields onto the layout pane. Use the Properties box to define the fields. Remember, do not use the delete key to change information in the Properties box. Delete will remove the field you just added, instead use the Backspace button to edit properties.
In this section we are going to add the following fields:
-
A Field
-
A Field using sub reports
-
The date the report is printed
-
A logo or image
-
Page numbers
Adding Labor ID to a Craft Report
In this example we are going to use the Work Order Assignment List. This report lists all the work orders based on the Assign To field. What if you needed it to list the Resource ID instead?
Follow these steps to replace the Assign To with the Resource ID.
-
Locate the report 1820 Work Order Assignment List and make a copy to edit. Open the report layout.
-
The first thing we need to change is the title of the column. Look for the text box used to create the label Assigned To ID. In the Properties box, change the Text field to read Resource ID. We just changed the name of a label and will still need to add the data field after we make room on the layout.
-
Now, instead of deleting the data field that displays the Assign To ID, we will just shrink the box as small as we can and set Visible to False in the properties box. This is an easy and efficient way to stop objects from displaying on the report without the risk of deleting necessary functionality, such as totals and subtotals. To find the data field look in TSection3_DetailSection2.
-
The next step is to add the Resource ID field to this report. If the field is listed in the view it will display in the Report Content Tree, under Fields. Expand the Bound node to see if Resource ID is available.
-
If your field is available, simply, drag it from the list and drop it into the appropriate position on the layout. Check inside the Properties box to see if the DataField is equal to the field name you are adding to the layout.
Subreports
What if you don't see the field you are trying to add in the list of field names? Don't panic, this just means you will need to add a Sub Report to display the field. Sub Reports are simply a report within a report and a quick method we can use to add data not found inside the DataSource. Subreports don't have to be complex, they may contain just one field.
Using the same example above, the Resource ID and Description are not included in the existing view. We will need to add a Sub Report to display the Resource ID. Follow the steps below to add a subreport to your existing report.
-
Without saving and exiting the main report and we can create the sub report from scratch. Go back to the Main Report window and click New on the toolbar.
-
A blank layout page will display. Now, select a view to use with the new report, also known as selecting the Data Source. Under the View menu, select Data Source. A window will display that allows you to select existing views. When you select a view all the fields will display as well. In this example, we are going to use the view imrpt_wofs_labor, because we know it contains the Resource ID and other fields that link to the original report. Click OK when you have found the desired view.
-
This simple subreport will only contain one field of data. You will not need a Page Header or Group Header. You just need one field in the Details section. Once the data source is selecte, all the fields are listed under the Fields node of the Report Tree. Expand down to the list of Bound fields and drag and drop Resource ID onto the layout page in the Detail section.
-
Format the field and report to make it small enough to fit inside the main report. Under Properties, the DataField should be set to Resource ID. Use the Appearance section to set the font. Tighten up the layout by removing the PageHeader and PageFooter.
-
Save and close the subreport. Click on File and use the Save As option to save the report file. Save the report in a shared location so iMaint may have access and remember your file name for later. You will need it when we import our files into iMaint. In our example we used Resource_ID.rpx.
-
Back inside the layout of your main report, we will create a space in the Details section to add our subreport. Use the Insert option to add a Sub Report, then draw a box in the section where you wish the information to display.
-
In the Properties box, give your sub report a name. Right now the empty sub report box serves as a place holder, during the import process we will actually link the subreport to the main report.
-
Save all the changes to your main report in the same location as your subreport. Using the .rpx file extension, we called our example report WorkOrderAssignment.rpx.
-
Now that both reports are saved to a shared location, its time to import them into iMaint. Import the Work Order Assignment report to complete the link between the main report and the sub report. Under File on the toolbar, select Import.
-
Browse to the location of your .rpx files and select to import your main report. When the Configuration window displays, give the report an ID and Description.
-
The most important part of the configuration window is the Master View field. This is the same as the Data Source used in the report. Make sure you select the correct Master View from the drop down window.
-
Define all the report settings, such as, set the record limit to an accurate number, add a description and set at least one report category.
-
The configuration window will detect you have added subreports and will need to enter some information. Set the file location of your subreport using the browse button. When you select the .rpx file the name of the subreport will default.
-
Link Fields can be tricky but are absolutely necessary to make subreports work. These are two fields within the Parent (Master) view and the subreport view, that are identical in value. In our example a field both the Master View and the sub report View have in common is the Work Order ID. We will link both reports using the Work Order ID. So use the drop down menus to tell iMaint the Parent Link Field, View and Link Field.
-
Click Ok at the bottom of the window to complete the process. Run a Preview of the newly published report to make sure the Resource ID appears in the correct place. If necessary, you may go back into the layout to make adjustments.
Add a Calculated Field
To add a calculated field, open the report layout and create a Text box. Using the Text box properties, set the appearance and value of the field. Under the Data node, use the DataField to set the value to display. For example, two basic math calculations are add and multiply. You can add or multiply two fields within the report by typing in the following statements into the DataField.
=field_name_1+field_name_2
or
=field_name_1*field_name_2
Add Print Date
Let’s add the Report Print Date to the bottom of the Asset Part List. This is a field that can be added to any report you wish.
-
On the layout of your report locate the ReportFooter.
-
In this section, use the Insert menu to add a Label. When you click on Label you can now draw a box in the ReportFooter large enough to hold the title of your field.
-
Once you have the empty label box inside your ReportFooter, move to the properties box. In the Text field key in Print Date.
-
Back in the layout grid, use the Inset menu to add a Text Box. Draw a box in the layout grid where you want the Printed Date to display. Place the focus on the text box in the layout grid to display the properties.
The two fields that need to be set are DataField and OutputFormat. Under the section called Data, locate the DataField. Blank out the field and key in the following phrase exactly as it is typed below. Note that it is case sensitive.
-
-
System.DateTime.Now.ToString( )
-
Under the section called Appearance use the OutputFormat to set the date format. Use the browse button to select Date and the format. Click OK to return to the Properties box.
-
Back on the layout, Save the report. Exit, then run the Preview of the report to test the field added.
Add a Logo or Image
Adding a company logo to your reports can make it look more professional. Follow these steps to quickly add a logo or image to any report.
-
Open the report layout and select the section you wish to add the logo. Most of the time it is added to the ReportHeader or ReportFooter (PageFooter).
-
You can either use the toolbar button to add an image or the Insert menu. Draw the box inside the section with room for the logo or picture.
-
In the Properties box, use the browse button in the Image field to select the logo or picture file. Make sure there is enough room in the section to hold the logo.
-
Save the report, exit and run the Preview option to test the newly added logo.
Add Page Numbers to a Report
Follow these steps to add a page number to any report.
-
Open the report layout and find the ReportFooter. Click on Insert and add a Text Box. Draw the box inside the ReportFooter (PageFooter).
-
In the Text Box Properties, blank out the Text under the Data section. Move down to the Summary section and set the SumFunction to Count, the SumRunning to All and the SumType to Page Count.
-
You may also add a Label to indicate the number is the page number. Use the Insert menu to add a Label. Draw the label box directly in front of the page number text box. In the Properties box, clear out the Text field, under the Data section, and key in Page. Use the Appearance section to set the Font.
-
Save and exit the report to run the Preview.
Adding Report Totals
In our example we are going to add the total number of Work Order IDs to the Asset Due for Service report. The report lists all the Open Work Orders for the Assets due for maintenance. Currently, it totals the number of Asset IDs due for maintenance at the end of the report. We would like to see the total number of Work Orders there are for each Asset listed.
Make a copy of the Assets Due for Service report and open the layout to get started. Follow these steps to add the total number of Work Order IDs for each asset.
-
On the layout you will need to make room for the label and data field. Place these fields in a GroupFooter section on the report. In our example, we will add the label and data field in GroupFooterSection2, because it is directly under the section that contains all the details and matches the GroupHeaderSection2. Currently it’s not being used so we can move GroupFooterSection1 down to make room in GroupFooterSection2.
Note that you will not always find a report with an empty section. Use the Insert menu to add a new GroupHeader and GroupFooter when none is available.
-
Inside the GroupFooterSection2, insert and position a label box in front of the data box. Format the label, under the Properties box, key in Total Work Orders: in the Text field. Set the Font to Bold, 8pt.
-
Once again, inside the GroupFooterSection2, drag and drop the Work Order ID field from the Content Tree. Now, as the focus is on the data field, set the Summary Properties. The DataField will default to work_order_id.
Move down to the Summary area and set the DistinctField to work_order_id, this is the data field we wish to total.
We want the system to count the total number of Work Order IDs so we set the SummaryFunction to Count. A drop down menu lets you select from all the possible summary functions available. If you had selected Sum the system would try to add the Work Order IDs together to give you a total.
SummaryGroup should always be the GroupHeader that belongs with your GroupFooter. For example, you would match GroupHeaderSection1 to GroupFooterSection1 and not GroupFooterSection2 or 3.
SummaryRunning allows you to select from Group, All or None. In our example we selected None but if you needed to total information in a specific Group or All records on the report, this is where you would set it.
SummaryType can be GrandTotal, PageTotal, SubTotal, or PageCount. In our example we are Sub Totaling the number of Work Orders for each Asset.
When you have set the Properties of both the label and data field your GroupFooterSection2 will look as follows:
-
Once you have defined the label and the data field, save and Import the report to run the preview.
Using QR Codes
ActiveReports allows end users to select a variety of barcode fonts when creating reports or labels. It even supports the use of QR Codes. To replace the standard Code39 barcode fonts used in iMaint with a QR Code, follow the steps below.
Step 1: Copy any existing iMaint Barcode report and open the copy in Layout mode. Select the current barcode field and delete it from the layout. You will want to start with a clean barcode field, not just edit the existing barcode.
Step 2: Add a new barcode field. Using the Barcode option in ActiveReports, drag and drop a new barcode box inside the layout. Make sure to give enough space to display the QR Code.
Step 3: Set the Properties on your new field. With the focus on the Barcode field, inside the Properties, set the Style to QR Code. Under the Data section, make sure to map the Data Field to the correct value (such as Part ID or Location ID). Scroll down to the Misc section and expand on the QR Code properties. Define the following QRCode settings:
-
Connection = False
-
Connection Number = 0
-
Error Level = Q
-
Mask = Mask111
-
Model = Model2
-
Version = 3
Save the layout and print the report to create a test to scan with your device.