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!

adding background color (alternating) and numbers on Subreports

Status
Not open for further replies.

cero

Technical User
Oct 8, 2003
3
US
I just starting with crystal reports and need help on how to alternate background colors on 5 subreports all of them are on the same detail section(a).
I found out that adding this formula will do the job:
if Remainder(RecordNumber,2) <> 0 then silver else nocolor

And It does work for each record on the subreport but my problem is that each subreport grows differently. So I don’t have continuous background color “lines” going from start to end of each row.
Here is what I am getting
Subrep A Subrep B Subrep C Subrep D SubRep E
=ITEM X= =ITEM X= =ITEM A= =ITEM A= =ITEM X=
ITEM B ITEM A ITEM B
=ITEM A= =ITEM B=
ITEM M
=ITEM G=
This is what I am trying to get to display
Subrep A Subrep B Subrep C Subrep D SubRep E
=ITEM X===ITEM X===ITEM A===ITEM A===ITEM X=
ITEM B ITEM A ITEM B
=ITEM A============ITEM B=====================
ITEM M
=ITEM G=======================================

Also I am trying to add numbers to each line at the beginning and end of each row.
And here is what I found to solve it:
WhilePrintingRecords;
NumberVar Counter;
Counter:=Counter + 1
But then again I am having the same problem since on the first subreport I could have 50 records and on the last one could have only 10 or vice versa. So I will get 50 numbers on one side and 10 on the other one
This is what I am getting.
Subrep A Subrep B Subrep C Subrep D SubRep E
1=ITEM X= =ITEM X= =ITEM A= =ITEM A= =ITEM X=1
2 ITEM B ITEM A ITEM B
3=ITEM A= =ITEM B=
4 ITEM M
5=ITEM G=
This is what I am trying to get to display
Subrep A Subrep B Subrep C Subrep D SubRep E
1=ITEM X===ITEM X===ITEM A===ITEM A===ITEM X=1
2 ITEM B ITEM A ITEM 2
3=ITEM A============ITEM B===================3
4 ITEM M 4
5=ITEM G=====================================5

Any help is greatly appreciated!!!!
Thanks!

 
I would suggest trying to get your data into a single table.

You might be able to pass a shared variable between these subreports and conditionally suppress multiple sections to do this, but it's an ugly solution.

You may not even need subreports, consider posting crystal and database version information, example data, and expected output.

-k
 
It would be nice if I can insert the data in one table but my problem is that each subreport is a different query of a SQL view and I am getting 6 fields from each subreport.
 
Is a Union Query possible?

Regardless, if you have access to the database to build Stored Procedures, you can place them all in one table.

Since you don't want to post version info, example data and expected output, there's not much I can do to help.

-k
 
synapsevampire,
here is the missing info.
I am using version 9 with service pack 1 install.

Under detail &quot;a&quot; I have 5 subreports:
rep90p rep80p rep70p rep60p rep50p
here is an example of the data thatI have on the subreports :
> 90 %
Job Code % Codes
112503 90 PSNO
112525 92 P F
113001 91 P OF

> 80 %
Job Code % Codes
112603 85 P NO F
112825 83 P NO

the reports are align on the same line I just type them like that so you can see the info.
The expected output is:
> 90 % > 80 %
Job Code % Codes Job Code % Codes
1===112503=====90===PSNO===112603=====85===P=NO=F===1
2 112525 92 P F 112825 83 P NO 2
3===113001=====91===P==OF===========================3

Note.-the equal sign is simulating to be the background
color.

Thanks for your help and please let me know if you need more info.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top