Working with Reports in ArcMap, Part II-Fields in the Layout

One of the most important aspects of designing a report layout is controlling how fields are displayed. The Report Designer is the tool for customizing your report layout and defining how fields look in your final report. Below are tips and tricks for aligning, positioning, formatting, and calculating fields in a report.

Aligning and Positioning Fields in a Report

The Report Designer makes it easy to reposition fields in the report. You can grab the text elements for field headings or values and position them wherever you like. A more effective way to place text elements is to use the grid on the report or the alignment toolbar.

Checking the Snap to Grid option constrains where elements can be placed in the report, but it makes designing a report layout much easier. It becomes easier to evenly space elements apart from each other or align new elements with existing elements.

 

 

Use the buttons on the Alignment toolbar to align more than one element at a time. These buttons are particularly helpful because you can align multiple elements from different sections in the report.

 

Formatting Text in a Report
All the elements that use text in a report have appearance properties for formatting the way the text is displayed. Most appearance properties are common for text over a variety of applications; if you’ve used a word processing application like Microsoft Word, then you are probably familiar with the font, color, character spacing, and alignment properties of text.

The Report Designer allows you to control the behavior of text in the report using a series of properties. Are the values in a field going to be too big to display on one line? Are the field values all different lengths? Use the Can Grow, Can Shrink, MultiLine, and Word Wrap text element properties to allow the elements to resize themselves when the report is generated.

Using Expressions to Calculate Fields
One question that I’ve often been asked is, Can I use a field expression to calculate the value of a field? The answer is yes. With a text element, you can generate a calculated field value by entering an expression in the Data Field property. One of the benefits of using an expression to calculate a field in the report is that you do not have to add a new field to your dataset; the field only exists in the report.

Within expressions, you can use existing fields and common functions from the Microsoft system libraries. Here is a table of expression examples:

 

Expression Type

Examples

Mathematical

 

=Quantity + 5

=Quantity – 3

=Diameter * 3.14

=Population / Area

=(double)System.Math.Round(CostPerUnit*Inventory)

 

Conditional

 

=(ValueField == 1)?”One”:”Not One”

=(Price < 10)?”Clearance”:”Price-Change”

=(SoilType == System.DBNull.Value) ? “No soil type specified” : SoilType

 

Date/Time

 

=System.DateTime.Now.ToString()

=System.DateTime.UtcNow.ToString()

 

Concatenated

 

=”Average Cost: ” + avgCostField

=ZipCode + ZipCode4Digit

 

String

 

=Name.Substring(0,4)

=Name.Replace(“Test”, “Final”)

=Name.ToUpper()

 

 

Setting Up Field Properties of Numeric Fields
If you are creating a report using numeric fields, remember to properly define your field properties. The reporting tools will honor the formatting options that you set in ArcMap. To set field properties

1. Open the Layer Properties dialog box and click the Fields tab.

2. Choose the field you want to format.

3. Under Appearance properties, click Number Format.

4. Click the ellipsis button to display the Number Format dialog box.

5. Choose from the list of categories and adjust the numeric options as you like.

One question that comes up often is, Why do my numeric field values take two lines to display in the report when they should only take one line? The reason for that is determined by the numeric options for a field. By default, numeric fields are aligned to the right and set to include 12 characters. If a number is smaller or larger than 12 characters, the number will display in the Table window or the Identify window as expected; however, this character setting has an effect on how symbology labels and report fields are displayed. This character property allows you to space out labels for range classes used with the graduated symbology renderers. The reporting engine respects all field properties as well and treats this character value as a buffer that is placed before the field value. If you don’t want your numeric fields to have any blank characters before the value, change the number of characters on the Numeric Options dialog box to 0.

Content Provided by Kent Marten

This entry was posted in Uncategorized and tagged , , , . Bookmark the permalink.

Leave a Reply

8 Comments

  1. mzweifler91 says:

    What do I need to do create reports that utilze tables related to a geature class? Do I need to create an MV View? How has that changed in Arc 10? thx

  2. dnc says:

    I see you copy/pasted the help file regarding expression types into this post. But these are too simple examples… for instance, how can we add a conditional expression with boolean operators and, or, etc.?

    Also, how to work with added fields? For instance, how can we group our report using an added field?

    One scenario for such a grouping:
    i) add a field to the report that classifies your records according to its size (area), eg AREA0; AREA>10=>1
    ii) summarize your report counting or summing your new field (0s and 1s)

    I must say the new report designer is really lacking documentation. It really feels like ESRI has just left its users on their own. Remove a killer app like Crystal Reports, add a feebly substitute, and not document it properly… would be expecting more from esri.

    • jacksonea says:

      I agree to go from Crystal to a poorly documented replacement is sad – even more sad that one would have to report lack of documentation as an enhancement or as a way to improve an application – really?

  3. Chris_Fox says:

    @dnc, thank you for your feedback and we understand the importance of providing good documentation and examples in helping our customers being successful with the software. I would encourage you to utilize Technical Support to report defects not only in terms of functionality, but also lack of documentation. In regards to the specific items you mentioned, below are the steps you can take to achieve both of your requests:

    i) add a field to the report that classifies your records according to its size (area), eg AREA0; AREA>10=>1
    1. In Report Designer right-click the detail heading and select “Insert > Group Header/Footer”
    2. Select Group Header and in the Data Field put the following expression: =(AREA < 10)?1:0
    3. Optionally add a new Text Box under the group header and apply the same expression in the Data Field

    ii) summarize your report counting or summing your new field (0s and 1s)
    1. Add a new TextBox in the Group Footer
    2. Set the Data Field equal to the field you wish to summarize
    3. Set the Summary Function to Count or Sum
    4. Set the Summary Group to the group we created above
    5. Set the Summary Running to Group
    6. Set the Summary Type to Sub Total

    • michaelneer says:

      Am trying to work with a 0′s & 1′s concept above but am unable to make it work per your outline above. Any way you could provide simple snap shots of your setting/configuration for the Group Header & Detail sections?

  4. gjorgenson says:

    I have a report created and am trying to prevent “widows” from occuring when my report runs. My columns need to have multiple lines to fit the text, but I do not want text to move on to the next page until a new record is at the top of the page. Can you tell me where to find the options to set this in my report template?
    Thanks

  5. santa_gaile says:

    How to add the current username to report?