Solved

Difference between First and last record

Posted on 2008-06-25
13
965 Views
Last Modified: 2012-08-13
Could any one tell me how to find the difference between first and last record in crystal reports
0
Comment
Question by:P_Ramprathap
  • 5
  • 5
  • 3
13 Comments
 
LVL 5

Expert Comment

by:analliah
ID: 21868585
what is the field type
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 21869417
I assume you mean the difference between the value of a field in the first record and the same field in the last record.

Try this idea.  I assume it is a numeric field?
In the report header add a formula
Name - GetFirstValue
WhilePrintingRecords;
GLobal NumberVar FirstRecordValue := {YourFIeld};

In the report footer
WhilePrintingRecords;
GLobal NumberVar FirstRecordValue;
FirstRecordValue - {YourFIeld}

mlmcc
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 21869434
If you mean between the whole records then you would need to use a variable for each field and do the appropriate comparison in the report footer

mlmcc
0
 
LVL 5

Author Comment

by:P_Ramprathap
ID: 21871602
Hi mlmcc

 iam new to crystal reports , i got what your saying , but the think is how to i add a formula field in Header and footer , do we have formula field seprate for Header and footer , if so , could you please tell me how to do it .
0
 
LVL 5

Expert Comment

by:analliah
ID: 21871633
Formulas are created the smae way regadless where they are being used.

just create 2 formula, first
Name - GetFirstValue
WhilePrintingRecords;
GLobal NumberVar FirstRecordValue := {YourFIeld};
 then
 second
WhilePrintingRecords;
GLobal NumberVar FirstRecordValue;
FirstRecordValue - {YourFIeld}


Now just drag your first formula and drop it in the header and the second formula in the footer...

How to create a formula?
 on your report field, left or right depends.. you should see formula in the tree...right click and choose new formula
0
 
LVL 5

Author Comment

by:P_Ramprathap
ID: 21871832
Do you mean , i drag the formula field into Header and hide it if i dont require to show it right ? am i correct
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 5

Expert Comment

by:analliah
ID: 21874945
Yes
0
 
LVL 5

Author Comment

by:P_Ramprathap
ID: 21875464
Great , it worked thanks a lot
0
 
LVL 5

Author Comment

by:P_Ramprathap
ID: 21875826
How do i do the same if i nee to insert the section 2 into page header ?
0
 
LVL 5

Expert Comment

by:analliah
ID: 21877077
could you explain more about your situation.
0
 
LVL 5

Expert Comment

by:analliah
ID: 21877084
If you have a screen shot of your design view that would be great. or just attach your report and change the extension to .doc
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 21879990
You can add a "second" report header section (if that is what you mean) by right clicking the report header in the left margin and clicking INSERT SECTION BELOW

mlmcc
0
 
LVL 5

Author Closing Comment

by:P_Ramprathap
ID: 31470678
Thanks a lot , it worked
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now