Working in the Design View

Home   Back   Next  

Designing and Printing Reports > Working in the Design View

 

The Design View is the first view you see when you create a new report.  It's the place where you can set up the report template with the fields and other text you'd like to use.  You can also perform standard text formatting in the Design View, as well as move fields to different cells or change column widths.  When working in the Design View, you can easily toggle to the Layout View (by clicking the Toggle View icon on the top right of the Navigation Bar or by selecting Layout from the View menu) to see how your template will look when printed or when saved as a PDF file.

 

 

report_design

 

Below we will discuss the following areas of the Design View:

 

Working with Report Sections
Working with Columns, Rows and Cells
Adding Fields and Other Text
Adding Subtotals, Page Numbers and Other Formulas
Creating a Quick Report

 

 

Working with Report Sections

 

A report is simply a template that repeats over and over again based upon certain triggers.  For instance, if we create a template that is a group with related detail, that template will repeat over and over in the report until we run out of groups.  In the most basic report, where we just have a single detail section, the detail section (each row/record) repeats over and over until all records are displayed.

 

So, in the example above, we have a group based upon City and State, with the Customer name and Total amount as the detail listed for that group. Click here to see the Layout View/Print Preview of this template.  When a report comes to a new group, the related detail is shown.  Then, when the detail for that group is exhausted, the report goes on to the next group and displays that detail.  It then continues in the same fashion until the end of the report.

 

The Design View enables you to create this repeating template.  The Layout View then lets you see what the actual report looks like when that template is filled out with actual data.  The following sections are available in the report template (note that many of these may be toggled on/off from the Report Settings dialog):

 

Report Header:  The report header appears at the very top of the report.  It only appears once per report; it does not repeat like other report sections.  It is often used for general report information or a report cover page.

 

Page Header:  The page header appears at the top of the page -- with the one exception being if the first page includes a Report Header section.  It repeats on every page of the report above the group and detail data.  It is often used for adding the names of the fields used in the detail section.

 

Group Header:  The group header will only be available if a group has already been defined and the "Group Header" checkbox checked.  The group header appears above the Detail section.  It repeats for every group and therefore, depending on the data, could repeat multiple times on a single page or only once per multiple pages.  It is often used for adding the name of a group.  You may have multiple group headers if you have defined multiple groups.

 

Detail:  The detail appears in the center of the template sections.  If no group is defined, the detail section repeats continuously.  If a group is defined, the detail repeats once per group.  It is used to add detail fields to the report.

 

Group Footer:  The group footer will only be available if a group has already been defined and the "Group Footer" checkbox checked.  The group footer appears below the Detail section.  It repeats for every group and therefore, depending on the data, could repeat multiple times on a single page or only once per multiple pages.  It is often used for adding a subtotal for a group of numbers.  You may have multiple group footers if you have defined multiple groups.

 

Page Footer: The page footer appears at the bottom of the page.  It repeats on every page of the report below the group and detail data as well as the report footer, if used.  It is often used for adding information like page number or date to each page of the report.

 

Report Footer:  The report footer appears on the last page of the report above the final page footer.  It only appears once per report; it does not repeat like other report sections.  It is often used to add summarized report information, like grand totals.

 

Since almost all the sections above repeat, any formatting or spaces placed in those sections will also repeat.  Therefore, if you have a detail row with data in it and include two blank rows below, this group of three rows will repeat for each detail record in the report (i.e., you will have two rows worth of space between each detail record in the layout view).

 

 

Working with Columns, Rows and Cells

 

The design view's controls work very similar to a spreadsheet:

 

Changing Column Width:  To change the width of a column, go to the edge of a column header, click and then drag your mouse to make the column wider or thinner.

 

Changing Row Height:  To change the height of a row, go to the edge or a row header, click and then drag your mouse to make the row taller or shorter.

 

Adding Rows to Sections:  Each section's size can be increased and decreased by adding or subtracting rows.  To change the rows that are displayed, select the gripper at the bottom left of every section and move the gripper up or down.

 

Moving Cell Contents:  If you have text in a cell and wish to move it elsewhere in the report, drag your cursor to the edge of the cell, click it and drag it to the destination cell.

 

Repeating Cell Contents:  If you have a cell with data in it and wish to repeat that data to an adjacent cell, move your cursor to the bottom right of a cell, click and drag to the adjacent cell(s).  Each cell will be populated with the original cell data.

 

Page Margin Indicator:  You'll notice a black bar on the top right side of the column selectors.  This indicates where your right page margin is set, so that you can ensure your fields will appear within the bounds of the report.

 

 

Adding Fields and Other Text

 

Once you have defined your report settings and groups, you can now start to add the text that will be displayed in the report.

 

Adding Fields

 

The most important type of text are the data fields.  Fields can be added into any cell by using an equal sign (=) in front of the field name:

 

=fieldname

 

When you switch to the Layout View, the report will show the actual data from this field, and repeat it as defined in your sections.

 

In addition to typing the names of the fields in the cells, you can use the Fields Panel.  The Fields Panel shows a list of all the fields in your Source Table.  You can simply double-click or drag fields from the Field Panel to the cells in your report.  Or, to add multiple fields at once, highlight multiple fields in the Field Panel and then drag them into the report.

 

To open the Fields Panel, either select Fields Panel from the View menu or click on the Fields Panel icon on the bottom left side of your screen, in the status bar.

 

Adding Text

 

In addition to fields, you can add other text by just typing into the cells.  This is useful for creating a name for your report or adding names for your fields.  If you add text to sections that repeat, the text will also repeat based on the section. So, for example, if you placed the following into your Detail section:

 

Customer Name:

=Customer

 

Your layout view would appear as follows:

 

Customer Name:

CORMIN

Customer Name:

ROGEN

Customer Name:

BAKER'S FRIEND

 

 

Adding Page Numbers, Subtotals and Other Formulas

 

In addition to adding fields and text, you can also add other information using formulas.

 

Informational Functions

 

Often when creating a report, there is a need to provide additional information such as the date the report was created or the page numbers.  The information options as follows:

 

Page Number:  Add the page number to each report page.
Page Count:  Add the page number total to the report.
Current Date:  Add the current date to the report.
Data Source:  Add the source table name to the report.

 

The respective function syntax for each of these are as follows:

 

=pagenumber()

=pagecount()

=curdate()

=datasource()

 

Aggregate Functions

 

In addition, you can create subtotals within group headers and footers or totals in a report footer.  To do this you simply need to add an aggregate formula in a cell.  Aggregate functions perform calculations on each group.  The following functions are available in the report writer:

 

Min:  Returns the minimum value in the group.  For numeric fields, it returns the smallest number in the group; for character fields, it returns the minimum alphabetical character (closest to "a").
Max:  Returns the maximum value in the group.  For numeric fields, it returns the largest number in the group; for character fields, it returns the maximum alphabetical character (closest to "z").
Sum:  Returns the sum of all values in a group.
Avg:  Returns the average of all values in a group.

 

The respective function syntax for each of these aggregate functions are as follows:

 

=min(fieldname)

=max(fieldname)

=sum(fieldname)

=avg(fieldname)

 

A "group" in this case can also mean the entire dataset.  Therefore, you can create a total in a report footer section on the entire report in the same way you can create a subtotal based on a specifically defined group in a group footer section.

 

Using Formulas in Report Cells

 

As we've seen above, you can create simple formulas in a cell using the equal sign ("=") to preface the function.  So, if you wanted to just show text in the layout view, such as for a header, you just type in the text you wish to show.  However, if you wish to use a variable (such as a record in a field) or a function (such as a page number), you simply need to preface it by using the equal sign, such as:

 

=pagecount()

=myfield

=sum(myfield)

 

However, you may also create more advanced formulas using any of the functions normally offered for other data processing tasks. Click here for an overview of using formulas to create calculations.  So, in a report you could create formulas such as:

 

A simple calculation, that would result in a "4" appearing in the layout view:

 

=1 + 3

 

A calculation that subtracts one field from another, such that the net amount would appear in the layout view:

 

=gross_amt - discount

 

A calculation that parsed a single item out of a text field:

 

=strpart(packsize,3)

 

Variables within a string of text, such that a result like "Page 2 of 23"

 

="Page " + str(pagenumber()) + " of " + str(pagecount())

 

NOTE:  In the above example, the pagenumber() and pagecount() functions are numeric by nature, so in order to use them in a text string, you need to convert them to text.  Hence we used the STR() function.  Also, please note that we added spacing within the text itself ("Page ") to produce the proper spacing in the layout view.

 

Quick Formulas

 

In addition to creating formulas within cells, you can also add quick, pre-built formulas via the right-click menu.  Right-click on any cell and select Insert Formulas.  The menu will expand and you can select formulas such as "Page Number of Page Count" or "Date" which will populate your cell with the appropriate formula syntax.

 

 

Learn More

 

For further information, see the following sections:

 

Working with Groups

Formatting a Report

Working in the Layout View