Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
CRW_REF.PDF
Скачиваний:
5
Добавлен:
13.02.2015
Размер:
13.99 Mб
Скачать

&Click the PRINT PREVIEW button on the standard toolbar to preview the form letter.

It should look similar to the following:

How to format objects conditionally

You may want to create a report that uses different formats based on field values. For example, you may want to print an international report that prints currency values for each country in the format that is common in that country. You can do that using multiple sections.

Create your report. See Tutorial - Customer List, Page 165, and Reporting 101, Page 95.

224

Seagate Crystal Reports User’s Guide

Create one Details section for each country that requires a unique format. See How to add, delete, move, and merge sections, Page 89.

!Make certain that each of the Details sections contains the same data. For example, every field that you place in the Details A section, you must also place in the Details B section, Details C section, etc.

"In the Details A section, click the currency field to select it, then click the OBJECT PROPERTIES button on the supplementary toolbar. The Format Editor appears.

#Set the currency values you want to use for the first country. See Formatting, Page 231.

$ Click OK to return to your report.

%Click the SECTION EXPERT button on the standard toolbar. The Section Expert appears.

&Select the Details A section in the Sections list box. Toggle the

Suppress (No Drill Down) option on.

'Click the Conditional Formula button to the right of the Suppress option and create a formula that specifies the conditions under which the section should be suppressed.

For example, if the Details A section contains currency values for the UK, you would create a formula that specified that the country value is not equal to UK. In other words, suppress the section when the country value is not UK. This would make the section print only when the record contained a UK value.

Repeat Steps 4 through 9 for each additional section.

Now when you print your report, the date and currency data for each country will appear in the format that is expected for that country. See Conditional formatting, Page 235.

How to print conditional messages in form letters

Many times you may want to print conditional messages in form letters. For example, you may want to encourage customers with available credit to buy more and those who are over their credit

Multiple Section Reports

225

limit to bring their accounts down below the limit once again. You can create both of these letters in a single report.

Insert a second Details section in your report using the Section Expert. See How to add, delete, move, and merge sections, Page 89.

Create two form letters. Place a letter that encourages customers to buy more in the Details A section of your report; place a letter that encourages customers to bring their balance down in the Details B section of your report. See How to create a form letter using a text object, Page 218.

!Using the Section Expert, format the Details sections so that each is suppressed under certain conditions. For example:

Format this section to be suppressed when the balance is less than the credit limit.

Format this section to be suppressed when the balance is more than the credit limit.

Now, when a record indicates available credit, the buy more letter will print. When the account is over limit the over limit letter will print. And when the customer is right at the credit limit, nothing will print at all.

Related Topics

How to format objects conditionally, Page 224

Conditional formatting, Page 235

How to alternate background colors for rows

Another typical use of multiple sections is to vary the background color in alternating lines for the Details section of your report to improve readability (a greenbar-paper effect).

226

Seagate Crystal Reports User’s Guide

Using the Section Expert, insert a second Details section. You should now have Details A and Details B sections. See How to add, delete, move, and merge sections, Page 89.

While in the Section Expert, highlight Details A in the Sections list box, click the Color Tab, and set the background color to White. See Formatting, Page 231.

!Click the Common Tab, click the Conditional Formula button to the right of the Suppress (No Drill Down) option, and type the following formula in the Formula Editor when it appears:

Remainder (RecordNumber,2)<>0

«This formula divides the Record number by 2 and if the remainder is something other than zero (which will happen for every odd numbered record), it tells the program to suppress the section.»

" Now select Details B and set the background color to Green.

#Using the technique from Step 3, set the Suppress option conditionally for this section using the following formula:

Remainder(RecordNumber,2) = 0

«This formula divides the Record number by 2 and if the remainder is equal to zero, it tells the program to suppress the section.»

$Create your report and make certain that the information and layout of each of the Details sections is identical. In other words, whatever you put in Details A, put it in Details B as well.

Now when you run the report, the program will print every even numbered line with a white background and every odd numbered line with a green background.

How to eliminate blank lines

It is very common to have two address lines in a customer table, one (Address 1) for street address and one (Address 2) that can be used for suite number or mail stop. Address 1 usually contains a value but Address 2 is often blank. If you create a customer list

Multiple Section Reports

227

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]