11.3 Designing a Custom Query Report

After you have created a Custom Query Report, either through the Report Designer Query Editor or the Query Editor built into the browser-based administration interface, you can design the layout of the report.

NOTE:This exercise introduces you to some of the very basic design features of the Report Designer. Through familiarizing yourself with the basic features, you will become proficient enough in the interface to try more advanced features.

For a more detailed explanation of features in the Report Designer, refer to: https://devexpress.github.io/dotnet-eud/interface-elements-for-desktop/articles/report-designer/report-designer-for-winforms.html.

  1. From the listed Custom Query Reports, select the one you want to design.

  2. Click Design Report Layout.

  3. Create a report header.

    1. Place the pointer in the upper section of the layout grid.

    2. Right click and select Insert Band > Report Header.

      A new ReportHeader band appears on the grid.

  4. Resize Page 1 and add a page break.

    1. Place the pointer on the bottom border of the new band and using the vertical ruler as a guide, extend the band to fill the first page.

      For example, to fill the first page, you might extend the border down to the 8" mark.

    2. From the Standard Controls region, click and drag a Page Break to the bottom of the band.

  5. Insert and design a chart.

    1. From the Standard Controls region, click and drag a Chart to the band.

      The Chart Designer is launched.

    2. In the Chart Designer, below the Chart menu, click the + that pertains to the Series option and select the Bar option.

    3. Click the Date tab and expand Query Results.

    4. Click and drag Category to the Argument cell.

    5. Click and drag cat_size to the Value cell.

    6. Click the Options tab and in the Name field, replace Series 1 with Category Size.

    7. Below the Chart menu, click the XY-Diagram option.

    8. In the Options tab, select the Rotated check box.

    9. Below the Chart menu, select Titles, click the +, and select Title.

    10. In the Options tab, in the Lines field, replace Chart Title with a more descriptive name.

      For example, File Extensions by Category.

    11. Below the Chart menu, select Category Size.

    12. Click the Properties tab, scroll down and under the Elements heading and expand View.

    13. Change the Color Each setting to Yes.

    14. Click OK.

    15. In the upper right-hand corner of the newly-placed chart, click the arrow to access the Chart Tasks menu and select Run Designer.

    16. Click the legend and from the Options tab, deselect the Visibility check box so the legend no longer appears.

    17. Click OK.

    18. In the Report Designer, expand the view of the chart to take up more of the page.

  6. Insert labels.

    1. From the Toolbox, click and drag Label to a position centered below the chart.

    2. Double-click within the label and specify the label name.

      For example, Total Size.

    3. Adjust the font size and style to your preferences.

  7. Create new fields.

    1. From the Field List, expand the Query Results.

    2. Right-click Query Results and select Add Calculated Field.

    3. In the Design region of the Property Grid for claculatedField1, change the (Name) setting to cfTotalSize.

    4. While still in the Property Grid, under the Data heading, click the ellipses (...) pertaining to the Expression field.

      This launches the Expression Editor.

    5. In the bottom-left column, select Functions.

    6. In the empty field at the top of the middle column, type sum to locate the Sum function, then double click Sum to place the function in the top text box of the Expression Editor.

    7. In the bottom-left column, select Fields and then in the middle column, double-click cat_size.

    8. Click OK to save the new filed and close the Expression Editor.

    9. Right-click Query Results and select Add Calculated Field.

    10. In the Design region of the Property Grid for claculatedField1, change the (Name) setting to cfTotalSize_String.

    11. While still in the Property Grid, under the Data heading, click the ellipses (...) pertaining to the Expression field.

    12. In the top text box of the Expression Editor, type Byte so that ByteString() appears.

    13. From the middle column, double-click cfTotalSize that you created earlier and click OK.

  8. Place the new fields.

    1. From the Field List, hold down the Control key, select the two new fields you just created, then drag them to the Total Size label on the grid.

    2. Adjust the size so that both fields will appear to the right of the Total Size label.

    3. Adjust the font size and style to your preferences.

  9. Preview the report.

    1. Click Download All Data.

    2. When the warning dialog box appears, click Yes.

    3. Click the Print Preview tab to observe how the report is going to look at this point.

    4. Make any desired format changes.

  10. Create a header for Page 2.

    1. Click the Report Designer tab.

    2. In the Report Designer, scroll down below the page break so that you are working on Page 2 of the report.

    3. At the top of the page, right-click and select Insert Band > PageHeader.

    4. From the Tool Box, click and drag a Table to the location of the new page header.

    5. Replace the names of the three new table cells with the following names:

      • Category

      • Size

      • File Count

    6. Select the File Count cell, right-click, then select Insert > Column to Right.

    7. Change the table cell name to Percent of Total.

    8. Resize the table cells to your preferred width.

    9. Adjust the font size and style to your preferences.

    10. Resize the depth of the page header so it is limited to the depth of the table.

  11. Create a new calculated field for Percent of Total.

    1. Right-click Query Results and select Add Calculated Field.

    2. In the Design region of the Property Grid for claculatedField1, change the (Name) setting to cfPercentofTotal.

    3. While still in the Property Grid, under the Data heading, click the ellipses (...) pertaining to the Expression field.

    4. From the middle column of the Expression Editor, double-click cat_string.

    5. Hit the space bar and then enter the following string: * /100

    6. Complete the string by double-clicking cfTotalSize from the middle column of the Expression Editor.

    7. Click OK.

  12. Insert the table content.

    1. Click below the header, hold down the Control key, and from the Field List, select the following fields in this order:

      • category

      • cat_size_string

      • file_count

      • cfPercentofTotal

    2. Drag the fields to a location below the header.

    3. Line up the tables cells with the headings.

    4. Click the Print Preview tab to view how the report will look.

    5. Make any needed adjustments.

  13. Click Save > Save to Database.

    By saving the report to the database you enable the File Reporter Report Generator to use the report design for updated reports.

    In addition to saving the report to the database, you can save the report as a file where you can import it into another file, such as a Word file or PowerPoint presentation.