Some very special features of crystal reports

  • 21

Some very special features of crystal reports

Visit: .comhttp://www.zonixsoft

Create a Watermark

A watermark is a graphical or textual element that is placed behind the rest of yourreport. Examples of useful watermarks are your company logo, the word “Draft,”or other items that you may want to appear right behind the rest of the elements of your report.

 

1. Open the report you wish to add the watermark to. Ensure that the Designtab is selected.

2. Position your mouse over the gray Page Header section name. Right-click.

3. Choose Insert Section Below from the pop-up menu. This will insert a second page header section (you’ll now see Page Header a and Page Header b).

4. Insert the graphic or text you want to appear behind the rest of the report into Page Header b (it’s helpful if the graphic has been lightened with a graphic editing program, or if the text is formatted with a light shade of font color).

5. If you want the watermark to appear more toward the vertical center of the page, make Page Header b taller and move the graphic or text farther down in the section.

6. If you want to repeat the watermark more than once on a page, insert it into Page Header b several times, or copy and paste the original item several times in Page Header b.

7. Position your mouse over the gray Page Header b section name. Right-click.

8. Choose Format Section from the pop-up menu in Crystal Reports 8.5, or Section Expert from the pop-up menu in Crystal Reports 9. This will display the Section Expert.

9. Choose the Underlay Following Sections check box for Page Header b in the Section Expert. Click OK to close the Section Expert.

10. If you wish to underlay items in the existing Page Header a section (field titles, the report title, and so forth), swap Page Header b and Page Header a by holding your mouse button down on either gray page header section name. When the mouse cursor changes to the hand icon, drag and drop the page header on top of the other page header. The sections will swap.

 

Change Graphics According to a Condition

Crystal Reports features the capability to format report objects (database fields, formulas, text objects, and so forth) conditionally, depending on the contents of a field, formula, or other condition. However, you may wish to actually insert several different graphic or picture files on your report and display them only when a certain condition occurs.

 

1. Open or create the report that you wish to add multiple conditional graphics to.

2. Add as many graphics to the report as are required. For example, if you want to display “thumbs up” and “thumbs down” graphics, add both graphic files to the report.

3. Place the graphics side by side, so that you may select each graphic individually.

4. Select the first graphic by clicking on it. Right-click. From the pop-up menu, select Format Graphic. The Format Editor will appear.

5. Select the Common tab. Next to the Suppress check box, click the Conditional Formula button. The Format Formula Editor will appear.

6. Add a Boolean formula to conditionally suppress the graphic. For example, to suppress the graphic if Last Year’s Sales is less than $50,000, enter a formula similar to this:

{Customer.Last Year’s Sales} < 50000

7. Click the Save button to close the Format Formula Editor. Click OK to close the Format Editor.

8. Repeat steps 4–7 for the remaining graphics, using “mutually exclusive” condition formulas, so that only one graphic at a time will display. For example, to suppress another graphic if Last Year’s Sales is greater than or equal to $50,000, enter a formula similar to this:

{Customer.Last Year’s Sales} >= 50000

9. Select each graphic and place it on top of the others, so that all graphics are placed in the same position. Because of the “mutually exclusive” conditional formatting, only one will appear at a time when the report is displayed.

 

Use WingDings and Other Symbol Fonts

By default, Crystal Reports uses a particular font face and size for report objects. While you can change the default font choices in the File | Options dialog box, you can also choose font face and size for individual report objects. You are not limited to standard letter-oriented fonts—you may choose symbol fonts such as Wingdings and Webdings as easily as you can choose letter-oriented fonts.

 

1. Add a database field, text object, formula, or other textual element that you wish to display as a symbol to the report.

2. Ensure that the object returns a character value that will “map” to the proper symbol. For example, to display a smile or frown with theWingdings font, you might create a formula similar to this:

If {Customer.Last Year’s Sales} < 50000 Then

“L”

Else

“J”

3. Select the object you wish to format with a symbol font.

4. Either using the Formatting toolbar or the Format Editor, select the symbol font (such as Wingdings or Webdings) that you’d like to use.

Tip: To determine what the proper character value is for the desired symbol, make use of the Windows Character Map. You may choose the symbol font and character you’d like to use and copy the character to the clipboard. Then, when you paste the character into a Crystal Reports formula or text object, the proper symbol will appear when you format the object with the symbol font. The Character Map is available from the System Tools submenu of the Accessories menu from the Start button Programs list.

 

 

Eliminate Blank Address Lines

Crystal Reports is often used for form letters, envelopes, or other mailing applications. In many cases, there is a need to eliminate blank address or “suite number” lines in an address for certain addresses. This can be accomplished in two ways: by embedding multiple address lines in a text object, or by using multiple report sections.

The text object method, while simpler in approach, will not automatically adjust vertical placement of objects that follow on the report. For example, if the address contains four lines in one form letter and three lines in the next, the remainder of the form letter below the text object will not move up or down automatically depending on the vertical size of the text object. For situations that require automatic vertical adjustment of text that follows the address, you’ll need to use multiple report sections.

 

Text Object

To eliminate blank lines using a text object, follow these steps:

1. Add a text object to your report. You will combine several database fields inside this text object.

2. Display the Field Explorer. Drag desired fields into the text object, separating database field with necessary characters, such as commas and spaces. In particular, drag the first address line (that might contain the street number) into the text object. Press ENTER to add a carriage return. Then, drag the second address line that will not always contain data (this might contain the suite number) into the text object. Press ENTER again. Then, drag in City, State, and Zip Code.

3. End editing by clicking anywhere outside the text object.

4. Select the text object you just created. Right-click and choose Format Text from the pop-up menu. The Format Editor will appear.

5. On the Common tab, click the Suppress Embedded Field Blank Lines options. This will suppress any lines in the text object that contain no data.

 

Shade Every Other Report Line

Although most companies have replaced mainframe “green-bar” or “blue-bar” reports with laser-printed output, there’s still a benefit to shaded sections when heavy textual information is being viewed. Shading lines in alternate colors or shades makes it easier for the eye to follow the line across the page. Crystal Reports enables this technique to be easily used for reports that may be printed on paper or viewed online.

By using the Mod function (which performs modulus arithmetic—returning the remainder of a division operation instead of the quotient), combined with the RecordNumber function (which simply numbers each report record sequentially), you may produce creative banded reports.

 

1. Point to the gray Details section name in the Design tab, or the gray D section name in the Preview tab. Right-click.

2. Choose Format Section from the pop-up menu in Crystal Reports 8.5 or Section Expert from the pop-up menu in Crystal Reports 9. The Section Expert will appear.

3. Ensure that the Details section is selected in the Section Expert. Click the Color tab.

4. Click the Conditional Formatting button. The Format Formula Editor will appear.

5. Enter a formula similar to the following (you may change the formatting color to your desired color):

If RecordNumber Mod 2 = 0 Then crSilver Else crNoColor

6. You may alter the frequency of the banding if you desire. For example, to shade every two lines, you can modify the formula as follows:

If RecordNumber Mod 4 In 1 To 2 Then crSilver Else crNoColor

Tip: Use of the crNoColor color constant instead of crWhite will show the alternating report sections with a certain degree of transparency. This may be helpful for certain reporting situations where you wish background information (such as a watermark) to appear behind the sections.

Courtesy: The Seo Guru, A Software Development Company, Best OOPS Blog Site, Link Submission, Thanks to Shopping  Site for Link Exchanging