- Open Crystal Reports XI
- Step 2Open the simple report you created rfom my previous how-to article.
- Step 3
Right clickOn the field explorer, right click on Formula Fields.
- Step 4
NewSelect "New" from the popup menu.
- Step 5
FullNameGive your formula the name, "FullName".
- Step 6
OkClick the ok button.
- Step 7
ExpandThe formula workshop window will appear. In here we are going to combine the last name database field, with the first name database field to create the formula "FullName." Expand the window that displays the database fields by clicking on the [+] plus sign. See image.
- Step 8
Get LastNameDouble click the "LastName" field. This will put it in the formula editor area.
- Step 9
ConcatenateAdd the amerpsand (&) symbol and then in quotations a comma followed by a space and then another ampersand. See the picture for how it looks. This will help separate the last name from the first name with a comma. The ampersand symbols concatenates two strings together.
- Step 10
Get FirstnameDouble click on the first name field to add it to the formula editor.
- Step 11
Check for ErrorsCheck to make sure the formula does not have any errors in it by clicking the (x+2) button with the green checkmark underneath.
- Step 12
No ErrorsYou will should receive the message box as shown in the picture. If you receive a different message it means there is an error. Go back through the steps, follow the pictures and try again before you continue.
- Step 13
Save and CloseClick the "Save and Close" button.
- Step 14
Formula CreatedThe formula has been created and exists in the Field Explorer window as shown in the picture.
- Step 15
Formula added to reportAdd the formula to the report by double clicking the formula name, dragging your mouse to the report and clicking the mouse button to drop it in the details section. Your report should now look like the picture.
- Step 16
Final ReportPress the "F5" key to see how the report with the formula looks. Click the Ok button if you get the message box asking if you wish to refresh the data. The picture shows the final results.
How to Create a Formula in Crystal Reports XI,VB.NET Crystal Reports Formula Fields
Formulas serve many purposes and in my example I am going to show you how I am able to combine to fields from a database to create one complete field. This How-To assumes that you have worked through my previous How-To article of creating a simple report. It is this simple report I am going to use.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Please Provide your feedback here