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

Snaking Columns - Can I calculate how many in advance ?

Status
Not open for further replies.

sixtoesofdean

Programmer
Nov 6, 2002
26
GB
Hi

I have a sub-report that snakes data across and down.

I also have banding on my report to make it more readable.

I've had to amend the banding set up for snaking sub-report because everytime crystal writes a record out on a detail line, it increments my banding count. This in turn was causing the header and detail background colour event to incorrectly set the back ground colour (hence create the banding effect).

I've got around the problem by using another counter that is modulo'd by the number of columns I know to exist when running the report as a main report (4 in this case). I only increment my banding counter when ColCount mod 4 = 0. This works.

However, because it is a sub-report, this might not always be the case.

I could simply use a shared numbervar in the main report, setting the column count there, but I'd like to have it a bit slicker than that.

So I think my question is:
what Crystal commands/functions/predefined vars can I use to calculate the number of columns that are to appear in a snaking detail section, dynamically.

I presume I need to know what the width of the report was at run time, and set my colCount then.

Apologies if this doesn't make much sense - I've read it through a couple of times myself and it sounds like gibberish!!

Thanks in advance
 
The only way to know the result of a subreport is to run it. And Crystal cannot use the result in the same section, only a lower section.

For some purposes, one can do a work-round by running the sub-report twice, with the first version minimised. This is fine for supressing a subreport, see . But you seem to want to know the result in advance, which I don't think you can.

Madawc Williams
East Anglia, Great Britain
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top