Report Writer

<< Click to Display Table of Contents >>

Navigation:  Concordance > Concordance Administration > Reporting >

Report Writer

With the Report Writer, you can create simple reports, exploded sort reports, complex reports from concatenated databases, or reports where you need to print tens of thousands of records. The reports are based on a sort query.

You can select the fields to use, column widths, and page and individual column formats and alignment. The report columns can contain stacked fields, truncated fields, calculated data, and combined data and quoted text with tab alignment. The Report Writer supports date and math calculations, and advanced if-then-else logic. While many of these features are powerful, the report writer was designed to be easy and flexible.

In Concordance, the Report Writer is only available in the Table view, but you can also use the Report Writer in conjunction with CPL (Concordance Programming Language) scripts.

Report Writer UI

ReportWriterSample

Editable Areas

The Report Writer screen is divided into four horizontal edit areas:

Page Header - The top edit box is the page header. It is printed at the top of every page. Any text can be typed into the page header. The header can be pulled down to give you more room for a large header or font. There is no limit to the number of lines in the header. If you do not want a page header, just pull it up until it disappears.

Column Headers - The next row of the report contains the column headers. These are printed at the top of every page, above the data columns. As with the page header, the column headers are resized by grabbing the window borders and pulling them up or down. There is no limitation on the number of lines of text they can hold. Make them as large or small as you need. Resizing one column header will resize all column headers, they are always uniform in height.

Data Columns - The next row contains the data columns. These contain the actual data printed in your reports. The data columns are interpreted; if you place a field's name--it must be in upper case--in the column, then that field's data ends up in the report. If you place something like, "Data: " + SUMMARY into the column, then the word "Data: " precedes the text from the field named SUMMARY. Any text or function or mathematic operator defined in the programming language can be used in a data column. This allows you to do things like convert data to upper or lower case, print only the first 100 characters, or calculate dates and other values in your reports.

Page Footer - The bottom edit box is the page footer. The page footer is printed at the bottom of every page. Any text can be typed into the footer. The footer can be pulled up or down to give you more or less room for text or type size. Make the footer's window smaller if too much room appears between the footer and the page numbers or dates.

Report Writer Toolbar

Button or Field

Description

Browse view button

Opens the Open dialog box. Click the Open button to open an existing .arp report file in the Report Writer.

Table view button

Saves your latest report changes to the .arp file currently opened.

Review view button

Opens the Save As dialog box.

All button

Inserts a column to the left of a selected column. Click a column in the report and click the Insert button to open the  Report Columns dialog box. Type the number of columns to insert and click OK to insert the new columns.

RW_Delete_button

Deletes a selected column.  Click a column in the report and click the Delete button to open the Report Columns dialog box. Type the number of columns to delete and click OK to delete the selected column, and if you entered more than one column, the remaining number of columns you entered to the right of the selected column.

Edit view button

Deletes a selected column.  Click a column in the report and click the Delete button to open the Report Columns dialog box. Type the number of columns to delete and click OK to delete the selected column, and if you entered more than one column, the remaining number of columns you entered to the right of the selected column.

Print button

Opens the Page Setup dialog box. In the Page Setup dialog box, you can edit the report's page setup settings,including the paper size, source, orientation, the page margins, and printer.

Report button

Opens the Justify dialog box. Select the check box that applies to the text you want to format, click OK to open the Text Alignment dialog box, click the alignment option you want to use, and click OK.

Tools button

Opens the Font dialog box. Select the check box that applies to the text you want to format, click OK, modify the font, and click OK again.

Help button

Opens the report in the print preview screen. The print preview screen allows you to browse through up to 100 pages of your report before printing the report.

RW_Print_button

Opens the Print dialog box. Select you printer settings and click OK to print the report.

RW_Exit_button

Closes the Report Writer in Concordance. You will be prompted to save the report if any changes were made.

RW_field_list

Contains a list of the database fields you can add to the report.

RW_coding_list

Contains a list of available CPL functions and operators you can add to the report.

Adding Field Titles and Data

There are two drop-down lists on the Report Writer toolbar.  The first list contains a list of every field in the database. The second list contains a list of useful CPL functions and operators. When adding fields to a report, you should always select fields from the list box.  It will automatically include necessary conversions for you, such as converting dates to text so that they can be printed.  For instance, selecting the date field DATE will actually place dtoc(DATE) into the report column.  This uses the date-to-character function to convert a numeric date into text.  To add a field, function, or operator to a report, click on the report where you want to add a field, function, or operator and make a selection from the field or function list.

Warning

If you need to type field names manually, make sure that you use upper case letters. The report writer will not recognize field names unless they are in upper case.

Stacked Fields and Other Useful Tricks

The Report Writer is very powerful and flexible. It can use any of the CPL (Concordance Programming Language) operators and functions. With the Report Writer, you can create some wonderful and complex reports. There are however, just a handful of functions and operators, like the plus sign, which you will use most of the time. This section describes the most useful functions and how to use them.

The first thing you may want to do is to combine some text with a field or two. The following example does just that. It stacks two fields in one column with titles for data:

"Date  "+dtoc(DATE)+newline()+

"Customer "+CUSTOMER

Enclose any static text in quotes. Combine quoted text and other data with the plus sign. The newline() function forces anything that follows it onto the next available line. Also included in the example, but not shown, are tabs. The quoted text includes a tab character to align the two data fields--there are no spaces in the line.

Always remember to use plus signs to combine everything with everything else. Leaving one out, or putting two plus signs in a row, are the two most common report errors.

Sometimes you may have a very large field which would use a lot of paper if it were printed. The next example uses the substr() function to print the first 200 characters of the summary field, it sub-strings it.

substr(DIGEST,1,200)

The example about uses the substr() function to grab 200 characters, starting with the first character. For this scenario, it would be really useful if we could check first to see if the brief field was actually more than 200 characters long. Then we could append ellipses (…) to show that we truncated the entry, if we need to truncate it at all.

(len(DIGEST)>200?substr(DIGEST,1,200)+"…": DIGEST)

This example uses two new features: the len() function and the conditional operator. The len() function determines the length of the text in any field. The conditional operator allows us to embed if-then-else logic into a report column. The conditional operator has the following format: (statement?true-response:false-response). The Report Writer tests the statement. If it is true, the true-response is the result, otherwise the false-response is the result. In our example the Report Writer determines if the length of the digest field is greater than 200 characters. If it is, the true-response returns the first 200 characters of the field with ellipses appended to show that it was truncated. If the statement is false, the entire field is printed. The parentheses around the conditional operator are required.

Use if-then-else syntax is (:?) and put literal text within quotes

If a date = 00/00/0000, then you can place quotes around “no date available”

Stack fields with newline()

“Beg Bates : ”+BEGNO+newline()+“End Bates : ”+ENDNO