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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CR XI: tracking highest value a variable reaches

Status
Not open for further replies.

glyrocks

Technical User
Nov 16, 2006
57
US
I'm trying to automate some footnote work, but need a way to find out the maximum value a certain number variable reaches at any point in the report. I need to be able to tell CR to leave room in the report footer for 7 footnote descriptions, or maybe just 3, or maybe only 1, or maybe 15, and so on.

The variable is recalculated at each detail; even if on line 5 I have a footnote number of 7, the last line could be footnoted with a 2. There is surely a better way to create footnotes, but I have a very limited skill set to work with right now... so I'd be satisfied if I could figure out the highest value my footnote variable/formula produces. Right now, I'm trying to use the same variable that produces the in-text footnote number, but because I'm a little out of my league, I only end up with room for whatever the last record's footnote is (so if it's a 2, I only get two lines- even if I have a 12 somewhere in the report). Thanks a lot for any suggestions or help!

dylan
 
Dylan:

Try posting technical information rather than descriptions.

Crytsal version
database/connectivity used
Example data
Expected output

Did you think that we knew what is in this formula that produces this variable?

Post anything that you make references to.

To learn the greatest value, add in anboht variable in the formula akin to:

whileprintingrecords;
numbervar MyHighestValue;
numbervar MyVariable;
<your code>
If <currentvaluevariable> > MyHighestValue then
MyHighestValue := <currentvaluevariable>

Now later you can use the folowing to use the largets value:

whileprintingrecords;
numbervar MyHighestValue

-k
 
Thanks a lot, that's exactly what I needed! Well, that's what I needed to get this to work. What I really need is to learn how to program.

The software version is actually in the subject (CRXI), probably not the best place for it though. Also, I apologize if there wasn't enough information posted, but your answer was exactly what I wanted to know how to do. I was afraid more details than what I gave would produce a solution too specific to the very bad code I had already written (which I hope to change). In fact, what I wanted was a broad answer that would apply to any number variable, which is exactly what I got! So thanks again, I always appreciate the help I get from everyone here. Cheers!

dylan

 
If you bother to post what I suggested people will give design advice and you'll learn, but it requires additional effort most people aren't willing to put in.

For instance a maximum function might work for you,but howcould we possibly know based on th4e fact that you don't want to share what you have or what you need becauseyou have a much better idea of how you can best further yourself and improve your code.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top