Print Page | Close Window

Auto increment field

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=4843
Printed Date: 05 May 2024 at 7:16am


Topic: Auto increment field
Posted By: CLRP
Subject: Auto increment field
Date Posted: 20 Nov 2008 at 10:57am
Hi
Iam new to Crystal Reports.

I need to add a new column  in crystal report (XI), such that the number increments according to the number of rows in the report ( which depends on the output from database- SQL). Basically a serial no column.

Can someone help?



Replies:
Posted By: BrianBischof
Date Posted: 20 Nov 2008 at 12:47pm
To post data to a report without a database field, create a new formula and then drag and drop that formul to the report. Now, the question is, what should the formula be? You can do it two ways. The first, and easiest, is to use the RecordNumber function. Just type that into your formula and it displays the record numbers, which is the same as incrementing by one. Try that and see what happens!
 
Oh yeah - there is also a RecordNumber special field, and you can drag and drop that onto your report as well and you don't have to create a formula if you do that.
 
If you need to learn more about Crystal Reports, my Encyclopedia book is filled with tutorials that walk you through the steps of building all types of reports. You can find out more about my books at http://www.amazon.com/exec/obidos/ASIN/0974953601/bischofsystem-20 - Amazon.com or reading the http://members.crystalreportsbook.com - Crystal Reports eBooks online.


-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: CLRP
Date Posted: 22 Nov 2008 at 5:31am
Thanks a lot. Worked like a charm. :)



Print Page | Close Window