Editing and formatting a report =============================== Interactive Viewer provides you with the flexibility to modify the presentation properties of reports. This section discusses the editing and formatting options available to you. **How to select an element for formatting** In a report table, you can format column headers as well as data in the columns. Select the element, then choose the formatting option from the menu that appears. Choose a column header to highlight it. To select data for formatting, select the entire column by clicking in the column area. A box appears, highlighting the selected element. Formatting a column ------------------- You can use Interactive Viewer to define new font properties and change text alignment for a selected report column, or for the report table. You can also specify these style properties for one column, and copy the style to other columns. You can highlight report data based on certain defined conditions and format data strings depending on the type of data in a column. For example, you can format data strings into currency, telephone number, postal code, date-and-time, or decimal formats. Working with data in a merged column ------------------------------------ Sometimes reports contain data that can be presented more effectively when you~merge one or more report columns. For example, a report listing customers and their addresses is easier to read when the address, city, state, and postal code items are merged to present this information in a single column. Interactive Viewer does not allow you to merge columns, but you can modify data in existing merged columns using Interactive Viewer. You can change font properties, create conditional formatting rules, and format data in merged columns. When working with a merged column, if you choose *Format > Font*, or *Format > Conditional Formatting*, from the context menu, Select Data Item appears, providing a list of data items, or columns, in the merged column, as shown in *Figure 3-1*. .. image:: images/figure_31.png *Figure 3-1: Select data item* From the list, select a data item on which to perform an action. Choose OK. You can now modify font properties, format data strings, and so on, for the selected column, as described in the following sections of this document. To modify all the data rows in the merged column, you must repeat this step for each data item, and implement the change in format, font, and so on, each time. Changing font properties and alignment -------------------------------------- In Interactive Viewer, you can change the font properties and alignment of editable labels, column headers, and data in a report column. The properties you can modify include the font type, size, color, and background color. You can also display the font in bold, italic, or underlined style. As you modify these properties, you can view the appearance of the data in the column, in the *Preview* field. You can choose to apply these properties to a single column, the entire table, or share the properties with other columns, without reapplying the style to each column. **How to change font properties** 1. Select the item, such as table label, column header, or column to highlight it. Choose *Format > Font* from the context menu. Font displays the current font property values, as shown in *Figure 3-2*. A value of Auto indicates that the default value is used. .. image:: images/figure_32.png *Figure 3-2: Defining font properties* 2. Use the drop-down lists to change the font properties for the selected element. * Select a font type and size. * Select a font color. 3. To set a color, complete the following steps: * Accept the default value of Auto, or select a different color in *Basic Colors*, as shown in *Figure 3-3*. .. image:: images/figure_33.png *Figure 3-3: Selecting an available color* * Select Custom Colors, and use the spectrum bar to specify a color group. Then, select a shade in the gradient square, and choose *Pick Color*, as shown in *Figure 3-4*. .. image:: images/figure_34.png *Figure 3-4: Selecting a custom color* 4. To apply the selected properties to the entire report table, select *Apply to table*. 5. To apply the selected properties to the selected column, select *Apply to column*. Choose OK. **How to change the alignment of text** In Interactive Viewer, select the table label, column header, or column to highlight the element. From the context menu, choose *Alignment*, then choose *Left*, *Center*, or *Right*. **How to copy font and alignment properties to other columns** 1. Select the column from which you want to copy font and alignment properties. From the context menu, choose *Format > Copy Style*. *Copy Style* appears, as shown in *Figure 3-5*. .. image:: images/figure_35.png *Figure 3-5: Sharing font and alignment properties with other columns* 2. Select a column to which you want to copy the font and alignment properties. To select multiple columns, press *Ctrl*, then select each column. Choose OK. The report displays the copied style properties in the specified columns. Formatting report data based on conditions ------------------------------------------ When you format data in a selected column, the format applies to all the values. Often, it is useful to change the format of data when a certain condition is true. For example, you can display sales numbers in red if the value is a negative number and in black if the value is a positive number. Conditional formatting is the formatting of data according to defined conditions. You also can change the format of data in a column according to the values in another column. For example, in a report showing customer names and the number of days each customer.s invoice is past due, you can highlight in blue any customer name that has an invoice past-due value between 60 and 90 days. Then, you can highlight in red and bold any customer name that has an invoice past-due value greater than 90 days. To apply conditional formatting, you create a rule defining when and how to change the appearance of data. You can apply conditional formats only to data in columns. The rule consists of the condition that must be true, and the text attributes to apply to column entries that satisfy the condition. You can define up to three conditions or rules for a single column and remove or modify conditional formatting for a column. You can also influence the formatting of one column based on values in another column. For example, in a sales inventory report, when you apply conditional formatting to the Product column, you can define the condition based on the Quantity in Stock column, such that conditional formatting is applied to the Product column if the quantity in stock is below a specified value. After you create the condition, you define the format in which to display data that satisfies the condition. The formatting appears on the selected column and not on the column on which you based the condition. **How to set conditional formats** 1. To define the condition, select the data column on which to display conditional formatting. From the context menu, choose Format.Conditional Formatting. Conditional Formatting appears, as shown in *Figure 3-6*. The example shown in *Figure 3-6*, highlights all customers with a credit limit of less than $100,000. The report in *Figure 3-7* displays conditional formatting for the data fields in the Credit Limit column that satisfy the defined conditions. .. image:: images/figure_36.png *Figure 3-6: Defining conditional formatting* .. image:: images/figure_37.png *Figure 3-7: Customers with credit limits below $100,000* 2. On *Conditional Formatting*, create a rule specifying the following information, then choose OK: * The format to apply, such as bold style. Choose Format to select formatting options. * The condition that must be true to apply the format, such as *Credit Limit Less than or Equal to 100000*. Specifying a format for the data ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To define text attributes for the selected data column, complete the following steps: 1. Choose *Format > Conditional Formatting* from the context menu. On *Conditional Formatting* the *Selected Column* field contains the name of the column that displays the conditional format. 2. Choose *Format* and select the text attributes to display for the *Credit Limit* column. As you define the format, you can view how the data in the column appears in the *Preview* field, as shown in *Figure 3-8*. Choose OK. .. image:: images/figure_38.png *Figure 3-8: Defining the format* Specifying a condition ~~~~~~~~~~~~~~~~~~~~~~ The condition in a conditional formatting rule is an *If* expression that must evaluate to *True*. For example: :: If the order total is less than 1000 If the customer credit limit is between 100000 and 200000 If the sales office is Tokyo If the order date is 7/21/2008 The *Conditional Formatting* dialog box helps you construct the If expression by breaking it down into its logical parts. In *Figure 3-6*, the expression consists of three parts. In *Figure 3-9*, the expression has four parts. In *Column Name*, select a column. This column contains the value that determines when conditional formatting takes effect. The column you select here does not have to be the same as the column that you selected for formatting in the report. For example, if *Product Name* is the column selected for formatting, you can select *Profit* in this field to indicate that for a certain profit amount, conditional formatting applies to the product name. .. image:: images/figure_39.png *Figure 3-9: Selecting data fields between two values* In *Condition*, select the comparison test, or operator, to apply to the column you selected. You can select *Equal to*, *Less than*, *Less than or Equal to*, and so on. If you select *Is Null*, *Is Not Null*, *Is True*, or *Is False*, the *If* expression does not require additional information. If you select an operator that requires a comparison to one or more values, one or more additional fields appear. For example, if you select *Less than* or *Equal to*, a third field appears. In this field, type the comparison value. If you select *Between* or *Not Between*, a third and fourth field appear. In these fields, type the lower and upper values, respectively, as shown in *Figure 3-9*. Comparing to a literal value ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The conditional expression, as shown in *Figure 3-9* in the previous section, evaluates the Credit Limit column and compares each value to determine if it matches a value between 100000 and 200000. The 100000 and 200000 values are literal values that you type. Alternatively, you can select a value from the list of values in the Credit Limit column. Selecting from a list of values is useful if the comparison value is a customer name and you do not know the exact customer names, or if the comparison value is a date and you do not know the date format to type. If the comparison value is a date, Interactive Viewer also provides a calendar tool, which you can use to select a date. **How to select a comparison value from a list of values** 1. On *Conditional Formatting*, choose *Change Value*, below the *Condition* field. *Select Values* appears. Choose *Specify literal value*, then choose *Select Values*. The values in the selected column appear. *Figure 3-10* shows an example of the values in the credit limit column. .. image:: images/figure_310.png *Figure 3-10: Selecting values* 2. Select a value from the list, then choose OK. The value appears in the comparison value field on *Conditional Formatting*. Comparing to a value in another column ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In a conditional expression, you can compare the values of one column with the values of another column. For example, in a report that displays products, sales prices, and MSRP (manufacturer suggested retail price), you can create a conditional formatting rule that compares the sale price and MSRP of each product, and highlight the names of the products whose sales price is greater than MSRP. **How to compare to a value in another column** 1. On *Conditional Formatting*, choose *Change Value*, below the *Condition* field. 2. On *Select values*, select *Use value from data field*. A list of columns used in the report appears. 3. Select a column from the list, then choose OK. The column name appears in the comparison value field on *Conditional Formatting*. *Figure 3-11* shows a condition that compares the sales price with the MSRP value. If the sale price value is greater, the product name displays in bold. .. image:: images/figure_311.png *Figure 3-11: Comparing data to a value in another column* You can now define up to two additional rules for the report column on *Conditional Formatting*. Choose OK. *Figure 3-12* shows the conditional formatting applied to the report column. .. image:: images/figure_312.png *Figure 3-12: Report displaying conditional formatting* Specifying multiple conditional formatting rules ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You can create up to three conditional formatting rules for a single column. You can, for example, create three rules to set the values of a profit column to one of three colors, depending on its value. *Figure 3-13* shows this example. .. image:: images/figure_313.png *Figure 3-13: A report with multiple conditional formatting rules* For each row of data in the report, Interactive Viewer evaluates the rules in the order in which they appear in the list of rules. As it evaluates each rule, Interactive Viewer applies the specified format properties if the condition is met. When creating multiple rules for a column, be careful that the conditions do not cover overlapping values. Consider the following scenario: * The first rule sets a profit value to blue if the value exceeds 5000. * The second rule sets the profit value to green if the value exceeds 1000. If the profit value is 6000, the value appears in green, not blue as you expect, because the condition in both rules is true (6000 exceeds 5000 and 1000), and the second rule supersedes the first rule. For the rules to make sense, the second rule should set the profit value to green if the value is between 1001 and 5000. Deleting a conditional formatting rule ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This section describes how you can delete conditional formatting rules from a report column. **How to delete conditional formats** 1. Select the column, then from the context menu, choose *Format > Conditional Formatting*. 2. On *Conditional Formatting*, choose *Delete Rule* for each conditional formatting rule that you want to remove. Choose OK. Formatting data strings ----------------------- Interactive Viewer provides common formats to change how numbers appear. You can, for example, display numbers with or without decimal values, in scientific notation, as a percentage, or as currency with the appropriate symbol. Sometimes, even though a column displays numbers, the data can have a string data type. Postal codes, for example, are frequently stored as string data. Numeric formats do not apply to numbers of string type. To help you understand what format you can apply to a report column, when you select a column for formatting the title of the formatting dialog box identifies the type of data in the column. This section discusses numeric data formats, date-and-time formats, and string data formats, and describes how you can apply these formats to data in a report. When you work with merged columns, select each column from the drop-down list of columns in the merged column, and define a new format each time, based on the column.s data type. When working with multiple columns containing the same data type, you can use Interactive Viewer to specify a format for the data in one column, and copy the format to other columns. This section also explains how to copy formatting properties. About data formats ~~~~~~~~~~~~~~~~~~ Data types are types of values.numbers, strings, and Booleans, for example.that you can manipulate in any programming language. Every element of report data has a certain data type, and every expression that you create returns a value of a particular data type. This concept is important because, if the expression you type does not handle data types properly, you do not obtain the expected results. For example, you cannot perform mathematical calculations on numbers if they are of string type, and you cannot convert values in a date field to uppercase characters. If you type an expression to manipulate a data field, make sure you verify its type, particularly if the data consists of numbers. Numbers can be of string type or numeric type. For example, databases typically store postal codes and telephone numbers as strings. Item quantities or prices are always of numeric type so that you can manipulate the data mathematically. IDs such as customer IDs, or order IDs are usually of numeric type so that the application can store them in numeric order, such as 1, 2, 3, 10, 11, rather than in alphanumeric order, such as 1, 10, 11, 2, 3. To view the data type of a column, select the column and choose *Format > Format Data* from the context menu. The name of the dialog box that appears tells you the type of data in the column. For example, if you select the credit limit column, the dialog box that appears is called Number column format. Applying a number format ~~~~~~~~~~~~~~~~~~~~~~~~ This section describes how to format numeric data by applying a standard number format or a custom number format. **How to apply a number format** 1. Select a column that contains numeric data. 2. From the context menu, choose *Format > Format Data*. Number column format appears, as shown in Figure *3-14*. .. image:: images/figure_314.png *Figure 3-14: Setting number column format* 3. On Number column format, in Format Number as, select a format. For example, you can format the credit limit column as currency in dollars ($) as shown in *Figure 3-14*. Select the appropriate options from the remaining drop-down lists on Number column format. Choose OK. You can select a standard format or define a custom format. Standard and custom formats are described in the next sections. Selecting a standard number format ################################## *Table 3-1* shows the standard number formats that Interactive Viewer supports. The examples in the table reflect the English (United States) locale. If you work in a different locale, the data displays differently. For example, a number that appears as 1352.45 in the English (United States) locale appears as 1352,45 in the French (France) locale. *table 3-1: Standard number formats* +-----------------+-----------------------------------------------------------------------------------------------------------+ | **Format** | **Example of data display** | +-----------------+-----------------------------------------------------------------------------------------------------------+ | General Number | 6066.45 or 6066.5 or 6067, depending on the original value. This format displays up to two decimal places.| | | Whole numbers and numbers with one or two decimal places appear in their original format. | +-----------------+-----------------------------------------------------------------------------------------------------------+ | Currency | dollar or pound or euro, depending on the symbol, symbol position, decimal place, and thousands separator | | | values that you set. | +-----------------+-----------------------------------------------------------------------------------------------------------+ | Fixed | 6067 or 6067.5 or 6,067.45, depending on the decimal place and thousands separator values that you set. | +-----------------+-----------------------------------------------------------------------------------------------------------+ | Percent | 45% or 45.8% or %45, depending on the symbol position and decimal place values that you set. This format | | | multiplies the original value by 100 and adds the percent (%) symbol. | +-----------------+-----------------------------------------------------------------------------------------------------------+ | Scientific | 2E04 or 2.67E04, depending on the decimal place value you set. The number after the E represents the | | | exponent of 10. For example, 2.67E04 means 2.67 multiplied by 10 raised to the fourth power. | +-----------------+-----------------------------------------------------------------------------------------------------------+ Defining a custom number format ############################### You can define a custom number format using special symbols to construct a format pattern. A format pattern shows where to place currency symbols, thousands separators, decimal points, or commas. *Table 3-2* shows examples of custom format patterns and their effects on numeric data. *Table 3-2: Results of custom number formats* +--------------------+--------------------------+--------------------------+ | **Format pattern** | **Data in the database** | **Result of formatting** | +--------------------+--------------------------+--------------------------+ | 0000.00 | 12.5 | 0012.50 | | +--------------------------+--------------------------+ | | 124.5 | 0124.50 | | +--------------------------+--------------------------+ | | 1240.553 | 1240.55 | +--------------------+--------------------------+--------------------------+ | #.000 | 100 | 100.000 | | +--------------------------+--------------------------+ | | 100.25 | 100.250 | | +--------------------------+--------------------------+ | | 100.2567 | 100.257 | +--------------------+--------------------------+--------------------------+ | $#,### | 2000.00 | $2,000 | | +--------------------------+--------------------------+ | | 20000.00 | $20,000 | +--------------------+--------------------------+--------------------------+ | ID # | 15 | ID 15 | +--------------------+--------------------------+--------------------------+ Applying a date-and-time format ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You can choose from several common formats to display date-and-time data. You can, for example, display dates as January 19, 2008 11:00:00 AM PST; Jan 19, 2008; or 1/19/08, and so on. This section describes how to select standard and custom date-and-time formats. How to apply a date-and-time format ################################### 1. Select a column that contains date-and-time data. 2. From the context menu, choose *Format > Format Data*. 3. On *Date column format*, select one of the formats from the list. You can select a standard format or define a custom format. The standard and custom formats are described in the next sections. * If you select a standard format, proceed to step 4. * If you select a custom format, specify a format code in the next drop-down list, then proceed to step 4. 4. Select a locale from the next drop-down list. Choose OK. Selecting a standard date-and-time format ######################################### *Table 3-3* shows the supported standard date-and-time formats. The examples in the table reflect the English (United States) locale. If you work in a different locale, the date displays differently. For example, a date that appears as March 5, 2008 in the English (United States) locale appears as 5 mars 2008 in the French (France) locale. *Table 3-3 Standard date-and-time formats* +--------------+------------------------------+ | **Format** | **Example of data display** | | | | +--------------+------------------------------+ | General Date | March 5, 2008 4:42:00 PM PDT | | | | +--------------+------------------------------+ | Long Date | March 5, 2008 | | | | +--------------+------------------------------+ | Medium Date | Mar 5, 2008 | | | | +--------------+------------------------------+ | Short Date | 3/5/08 | | | | +--------------+------------------------------+ | Long Time | 4:42:00 PM PDT | | | | +--------------+------------------------------+ | Medium Time | 4:42:00 PM | | | | +--------------+------------------------------+ | Short Time | 16:42 | | | | +--------------+------------------------------+ Defining a custom date-and-time format ###################################### You can define a custom date-and-time format using special symbols, shown in *Table 3-4*, to construct a format pattern. Use custom date formatting only for reports viewed in a single locale. Custom formats always display dates in the format you set, which can be inappropriate in other locales. For example, if you use the format MM-dd-yy, the date January 10, 2006 always appears as 01-10-06, regardless of the locale in which you view the report. For locales that customarily display dates in date-month-year format, Interactive Viewer interprets the date 01-10-06 as October 1, 2006. *Table 3-4 Symbols for defining custom date-and-time formats* +------------+-------------------------+-------------+ | **Symbol** | **Description** | **Example** | | | | | +------------+-------------------------+-------------+ | yy | Short year | 08 | | | | | +------------+-------------------------+-------------+ | yyyy | Long year | 2008 | | | | | +------------+-------------------------+-------------+ | MM | Month as a number | 07 | | | | | +------------+-------------------------+-------------+ | MMM | Short month name | Jul | | | | | +------------+-------------------------+-------------+ | MMMM | Full month name | July | | | | | +------------+-------------------------+-------------+ | d | Day in month | 10 | | | | | +------------+-------------------------+-------------+ | W | Week in month | 2 | | | | | +------------+-------------------------+-------------+ | w | Week in year | 28 | | | | | +------------+-------------------------+-------------+ | DD | Day in year | 192 | | | | | +------------+-------------------------+-------------+ | E | Short day of week | Thu | | | | | +------------+-------------------------+-------------+ | EEEE | Long day of week | Thursday | | | | | +------------+-------------------------+-------------+ | H | Hour in day (0 - 23) | 0 | | | | | +------------+-------------------------+-------------+ | k | Hour in day (1 - 24) | 24 | | | | | +------------+-------------------------+-------------+ | K | Hour in AM/PM (0 - 11) | 0 | | | | | +------------+-------------------------+-------------+ | h | Hour in AM/PM (1 - 12) | 12 | | | | | +------------+-------------------------+-------------+ | a | AM/PM | 12:00:00AM | | | | | +------------+-------------------------+-------------+ | mm | Minutes | 30 | | | | | +------------+-------------------------+-------------+ | ss | Seconds | 55 | | | | | +------------+-------------------------+-------------+ *Table 3-5* shows examples of custom formats and their effects on a date stored as April 15, 2006 12:15:30 PM in the database. *Table 3-5 Results of custom date formats* +----------------+---------------------------+ | Format pattern | **Result of formatting** | | | | +----------------+---------------------------+ | MM-dd-yy | 04-15-06 | | | | +----------------+---------------------------+ | E, M/d/yyyy | Fri, 4/15/2006 | | | | +----------------+---------------------------+ | MMM d | Apr 15 | | | | +----------------+---------------------------+ | MMMM | April | | | | +----------------+---------------------------+ | yyyy | 2006 | | | | +----------------+---------------------------+ | W | 3 (the week in the month) | | | | +----------------+---------------------------+ | w | 15 (the week in the year) | | | | +----------------+---------------------------+ | DD | 105 (the day in the year) | | | | +----------------+---------------------------+ | h:mm:ss | 12:15:30 | | | | +----------------+---------------------------+ Applying a Boolean format ~~~~~~~~~~~~~~~~~~~~~~~~~ A Boolean expression evaluates to True or False. For example, consider a calculated column displaying values for the following expression: :: ActualShipDate <= TargetShipDate If the actual ship date is before or on the target ship date, the expression evaluates to *True*. If the actual ship date is after the target ship date, the expression evaluates to *False* . If you do not format a column of *Boolean* data type, the column displays the values *True* and *False* . To specify different labels, select the column, and from the context menu, choose *Format > Format Data*. Type the new labels on *Boolean column format,* as shown in *Figure 3-15* . .. image:: images/figure_315.png *Figure 3-15: Specifying display values for True and False* Applying a string format ~~~~~~~~~~~~~~~~~~~~~~~~ You can format string data to correct text that contains inconsistent capitalization, or to include characters, such as a space or a punctuation mark, at a specific place in the string. For example, you can display United States telephone numbers in one of the following formats: :: (415) 555-2121 415.555.2121 415-555-2121 This section describes how you can select a standard string format, and how you can define a custom string format for data in a report. **How to apply a string format** 1. Select a column that contains string data. 2. From the context menu, choose *Format > Format Data*. 3. On *String column format*, select one of the formats from the list. You can select a standard format or define a custom format. Standard and custom formats are described in the next sections. Choose OK. Selecting a standard string format ################################## *Table 3-6* describes the string formats that you can choose and illustrates how the formatted data appears. *Table 3-6 Standard string formats* +-----------+------------------------------------------------------+ | Format | Description | | | | +-----------+------------------------------------------------------+ | Lowercase | The string displays in all lowercase, for example: j | | | *ohn smith* | | | | +-----------+------------------------------------------------------+ | Uppercase | The string displays in all uppercase, for example: | | | *JOHN SMITH* | | | | +-----------+------------------------------------------------------+ Defining a custom string format ############################### You can define a custom string format using special symbols to construct a format pattern. *Table 3-7* describes these symbols. *Table 3-7 Symbols for defining custom string formats* +--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Symbol | Description | | | | +--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | @ | Character placeholder. Each @ character displays a character in the string. If the string has fewer characters than the number of @ symbols that appear in the format pattern, spaces appear. Placeholders are filled from right to left, unless you specify an exclamation point (!) at the beginning of the format pattern. See Table 3-8 for examples. | | | | +--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | & | Same as @, except that if the string has fewer characters, spaces do not appear. See Table 3-8 for examples. | | | | +--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | ! | Specifies that placeholders are to be filled from left to right. See Table 3-8 for examples. | | | | +--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | > | Converts string characters to uppercase. | | | | +--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | < | Converts string characters to lowercase. | | | | +--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ *Table 3-8* shows examples of custom string format patterns and their effects on string data. *Table 3-8 Results of custom string formats* +-------------------------+-------------------------+-----------------------+ | Format pattern | Data in the data source | Results of formatting | | | | | +-------------------------+-------------------------+-----------------------+ | (@@@) @@@-@@@@ | 6175551007 | (617) 555-1007 | | | | | | | 5551007 | ( ) 555-1007 | | | | | +-------------------------+-------------------------+-----------------------+ | (&&&) &&&-&&&& | 6175551007 | (617) 555-1007 | | | | | | | 5551007 | () 555-1007 | | | | | +-------------------------+-------------------------+-----------------------+ | !(@@@) @@@-@@@@ | 6175551007 | (617) 555-1007 | | | | | | | 5551007 | (555) 100-7 | | | | | +-------------------------+-------------------------+-----------------------+ | !(&&&) &&&-&&&& | 6175551007 | (617) 555-1007 | | | | | | | 5551007 | (555) 100-7 | | | | | +-------------------------+-------------------------+-----------------------+ | !(@@@) @@@-@@@@ + ext 9 | 5551007 | (555) 100-7 + ext 9 | | | | | +-------------------------+-------------------------+-----------------------+ | !(&&&) &&&-&&&& + ext 9 | 5551007 | (555) 100-7 + ext 9 | | | | | +-------------------------+-------------------------+-----------------------+ | >&&&-&&&&&-&& | D1234567xy | D12-34567-XY | | | | | +-------------------------+-------------------------+-----------------------+ | <&&&-&&&&&-&& | D1234567xy | d12-34567-xy | | | | | +-------------------------+-------------------------+-----------------------+ Revert to default format ~~~~~~~~~~~~~~~~~~~~~~~~ To revert a data column back to its default font formats, select the column. From the context menu, choose *Format > Font*. Select *Auto* from each drop-down list. To reset text alignment, select the element, and choose the appropriate alignment option. If you applied a number, date-and-time, or string format to a column of data, you can restore these formats to those in the original report. Select the column. From the context menu choose *Format > Format Data*. Then, select *Unformatted* from the drop-down list. Copying a format to other columns ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When working with columns of similar data types, you can apply a format to data in one column, and copy the format to data in other columns. For example, consider a simple report that lists price of each (sale price), profit, and revenue for products sold in a region. If you format the price of each column as currency in US dollars, you can copy this format for data in the profit and revenue columns, so that all amounts are formatted as currency in US dollars, in one simple step. **How to copy a data format** 1. Select the column containing the formatting properties you want to share. From the context menu, choose *Format > Copy Format*. *Copy Format* appears, as shown in *Figure 3-16*. .. image:: images/figure_316.png *Figure 3-16 Sharing font and alignment properties with other columns* 2. Select the column to which you want to copy the current formatting properties. To select multiple columns, press Ctrl, then select each column. Choose OK. The report displays the copied formatting properties in the specified columns. Editing column and group headers ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Column and group headers are label elements that contain static text. In a typical report, some labels are editable, while others are not. Examples of labels you can edit include report titles or author names. Examples of non-editable labels include standard copyright or confidentiality statements. You can change the content of the column header by choosing the Header option from the context menu. You can modify properties such as the font, the font size, the background color, and so on. You can also edit the text of the label. **How to edit a header** 1. Select the column. To delete existing text, choose *Header > Change Text* from the column menu, as shown in *Figure 3-17*. Type the text to display and press *Enter*. The edited text appears on the header. .. image:: images/figure_317.png *Figure 3-17 Modifying column labels* 2. Select the column. From the column menu, choose *Header > Alignment*, or *Header > Font* and modify the properties as needed.