Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

incrementing a value

Status
Not open for further replies.

adhhealth

Programmer
Jul 1, 2004
165
US
Every time I print a report I want to increment a field. 1001,1002 etc..
i know its just i=i+1 but i donot know the syntax and my help is not installed properly.please help!!
 
Hi
You can try using the special field RecordNumber to determine the current line number. That should work as long as you aren't conditionally suppressing any detail sections.

If you need to know the # of detail lines per group, you can do it with 2 formulas:

//@Init
//Put this in your Group Header
//(If you want to get the # of lines per page,
// then you can put this in the Page Header instead)
WhilePrintingRecords;
NumberVar lineNum := 0;

//@Increment
//Put this in your Details section
WhilePrintingRecords;
NumberVar lineNum := lineNum + 1;

To force a page break after a certain line number, use a formula for 'New Page After':

WhilePrintingRecords;
NumberVar lineNum;
If lineNum = [whatever your Max is] Then
True
Else
False

hope this will help you in some way

cheers

pgtek
 
My problem is I want to display something like a hit count.Each time I run this report I want to increment hit count like 1001 first time i run the report ..1002 when i run the report 2nd time and so on..thanku
 
Hi
you cant do this in crystal report
only in segate info

cheers

pg

pgtek
 
i am using crystal 8.0 version..we cant auto increment a number in this version??
 
Yes you can
but not how many time the report is been open.
you need an audit table or a report table with name of the
reports in it with a datestamp
there u can count how many time the report has been view by the number of time the report was open

cheers

pg

pgtek
 
Can you suggest me how I go about creating an audit or report table?? also I was thinking can we create another table in pervasive sql database with a sequence of numbers and display the numbers from there? However I am not sure how to link this table to the existing table in the report..new to using crystal!!
(v8)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top