Using the keyword "global" to create custom record number
Okay. Let's open the crystal report application and follow these steps :
- Create a new report, take the datasource from the table named "Products" and "Categories"
- Click on icon "Group Expert" on the toolbar so the window titled "Group Expert" appear. In the box "Available Fields:", choose field "categories.CategoryID" and insert it into box "Group By", then click "OK".
- Inside the window "Field Explorer", Right click on "x+1 Formula Fields" and then choose "New" from the pop-up menu. When the window to input formula name appear, type "CategoryName" inside the available textbox and then click "OK".
- The window titled "Formula Editor" will then displayed, choose the "Basic Syntax" from the combobox at the top side and type the following command inside the formula editor :
formula = "Category : " & {categories.CategoryName}
Then place the above formula into the Group Header section