Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Auto increment field Post Reply Post New Topic
Author Message
CLRP
Newbie
Newbie
Avatar

Joined: 20 Nov 2008
Online Status: Offline
Posts: 2
Quote CLRP Replybullet Topic: Auto increment field
    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?
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet 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 Amazon.com or reading the Crystal Reports eBooks online.


Edited by BrianBischof - 20 Nov 2008 at 12:52pm
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>
IP IP Logged
CLRP
Newbie
Newbie
Avatar

Joined: 20 Nov 2008
Online Status: Offline
Posts: 2
Quote CLRP Replybullet Posted: 22 Nov 2008 at 5:31am
Thanks a lot. Worked like a charm. :)
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.