Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: how to create group field on report Post Reply Post New Topic
Author Message
sur200
Newbie
Newbie
Avatar

Joined: 18 Feb 2009
Location: India
Online Status: Offline
Posts: 11
Quote sur200 Replybullet Topic: how to create group field on report
     Posted: 18 Feb 2009 at 9:28am

Hi,

I am new to this forum and even to crystal reports.
 
I will try to make my question clear, if any1 needs more information then please write back.
 
I have one main report and one sub report.
 
for sub report i am fetching data based on main report record Id.
 
now suppose i have fetched the following data from SQL server for sub report  and say I am showing 2 items on report
(select code,age from myTable order by code)
 
Code      Age     
1            12
2             15
3             14
3              16
3              17
4              20
4              25
5              30
 
here is the output that i want
Code      Age        RecNumber 
1            12           1
2             15          1
3             14          1
3              16          2
3              17          3
4              20          1
4              25          2
5              30          1
 
if I can fetch recNumber (shownabove) from SQL server itself then that will also be fine.
or if it is possible to group report on code and put a special field (don't know if any such field is available) on report and reset its value to 1 when group changes.
 
 
TIA,
Surinder Singh
 
 
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 18 Feb 2009 at 10:02am
Hi
 
In field explorer click the Running Total Node and Create running total
as follows
 
use the below settings for running total
 
Field to Summarize {Table.CodeFieldName}
Type of Summary Count
 
Evaluate
For Each Record
 
Reset
On Change of Field {Table.CodeFieldName}
 
Place the running total field in your details section and change the Label to RecNumber
 
Cheers
Rahul


Edited by rahulwalawalkar - 18 Feb 2009 at 10:04am
IP IP Logged
despec99
Newbie
Newbie


Joined: 10 Feb 2009
Online Status: Offline
Posts: 22
Quote despec99 Replybullet Posted: 18 Feb 2009 at 10:50am
Originally posted by sur200

Hi,

I am new to this forum and even to crystal reports.
 
I will try to make my question clear, if any1 needs more information then please write back.
 
I have one main report and one sub report.
 
for sub report i am fetching data based on main report record Id.
 
now suppose i have fetched the following data from SQL server for sub report  and say I am showing 2 items on report
(select code,age from myTable order by code)
 
Code      Age     
1            12
2             15
3             14
3              16
3              17
4              20
4              25
5              30
 
here is the output that i want
Code      Age        RecNumber 
1            12           1
2             15          1
3             14          1
3              16          2
3              17          3
4              20          1
4              25          2
5              30          1
 
if I can fetch recNumber (shownabove) from SQL server itself then that will also be fine.
or if it is possible to group report on code and put a special field (don't know if any such field is available) on report and reset its value to 1 when group changes.
 
 
TIA,
Surinder Singh
 
 


You could also group your report on "code", insert a summary and count records using a field in your table.

David
IP IP Logged
sur200
Newbie
Newbie
Avatar

Joined: 18 Feb 2009
Location: India
Online Status: Offline
Posts: 11
Quote sur200 Replybullet Posted: 19 Feb 2009 at 1:00am
Originally posted by rahulwalawalkar

Hi
 
In field explorer click the Running Total Node and Create running total
as follows
 
use the below settings for running total
 
Field to Summarize {Table.CodeFieldName}
Type of Summary Count
 
Evaluate
For Each Record
 
Reset
On Change of Field {Table.CodeFieldName}
 
Place the running total field in your details section and change the Label to RecNumber
 
Cheers
Rahul
 
 
 
wow! that was execellent, I was sure that there should be something like that in Crystal Reports because we do in the same way in Visual Foxpro reporting.
 
Thanks!
 
 
IP IP Logged
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