- Open Crystal Reports XI
- Step 2Open the simple report you created rfom my previous how-to article.
- Step 3On the field explorer, right click on Formula Fields.
- Step 4Select "New" from the popup menu.
- Step 5Give your formula the name, "FullName".
- Step 6Click the ok button.
- Step 7The 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 8Double click the "LastName" field. This will put it in the formula editor area.
- Step 9Add 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 10Double click on the first name field to add it to the formula editor.
- Step 11Check to make sure the formula does not have any errors in it by clicking the (x+2) button with the green checkmark underneath.
- Step 12You 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 13Click the "Save and Close" button.
- Step 14The formula has been created and exists in the Field Explorer window as shown in the picture.
- Step 15Add 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 16Press 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