on 2008 Aug 07 4:43 AM
Hi All
I am working on a crystal report in which we need to display the data in such away that half of the records on the left and another half on the right.
as shown below
I am having the data like this with 3 columns.
*Name TimeShift Schedule*
Ashok 10.00-11.00 Football
Ashok1 09.00-11.00 Football
Ashok2 10.30-11.00 Cricket
Ashok3 10.00-11.30 Football
Ashok4 10.00-11.00 Football
Ashok5 10.00-11.00 Football
Ashok6 10.00-11.00 Baseball
Ashok7 10.00-11.00 Football
Ashok8 10.00-11.00 Football
Total 9 records I have. But I need to display
1st record on the left
2nd on the right
3rd on the left
4th on the right.......
Final Output should be like this.
*Name TimeShift Schedule Name TimeShift Schedule*
Ashok 10.00-11.00 Football Ashok1 09.00-11.00 Football
Ashok2 10.30-11.00 Cricket Ashok3 10.00-11.30 Football
Ashok4 10.00-11.00 Football Ashok5 10.00-11.00 Football
Ashok6 10.00-11.00 Baseball Ashok7 10.00-11.00 Football
Ashok8 10.00-11.00 Football
Appreciated ur help in advance.
Thanks.
Ashok
Why not use Format wiith Multiple Columns (in the section expert for the Details section) then you can set the width of the few columns you're displaying and the space between.
Be sure to set it to "Across then Down"
Edited by: Crystalier on Aug 7, 2008 4:20 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ashok,
Here is one way to do it:
1) Place "Name" in the details section.
2) Insert a Running Total... Count to create row numbers
3) Create the following formulas:
c1_Name = IF INT({#RTotal0} / 2) * 2 != {#RTotal0} THEN {Table.Name}
c2_Name = IF INT({#RTotal0} / 2) * 2 != {#RTotal0} THEN NEXT({Table.Name})
4) In Design View, right click to the left of the report, in the details area... choose Section Expert.
5) Make sure Details is highlighted. Click the X-2 button next to Suppress (No Drill down)
6) Enter the following formula:
IF {@c1_OrderID} = 0 THEN TRUE ELSE FALSE
7) Repeat step 3 for TimeShift and again for Schedule.
The end result... Odd number rows end up in the left columns and evens on the right.
Hope this does the trick for you,
Jason
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jason
I was in need of something like this too. I have tried your solution, but my 1st part number ( row 1) does not show in either formula (your #3). I assume I was supposed to place each formula in the details section.
Did I miss something?
here is the formulas I used based off your suggestions.... 1 called test the other test 2
test
IF INT({#RTotal0} / 2) * 2 = {#RTotal0} THEN {F4102.IBLITM}
test 2
IF INT({#RTotal0} / 2) * 2 = {#RTotal0} THEN NEXT({F4102.IBLITM})
I used this for my suppression formula
IF {@test} = "0" THEN TRUE ELSE FALSE // I added the " " because it was asking for a string
Did I follow your direction?
Travis,
The key here is that you have the row numbers. Were you able to get that?
Once you have that you can use the two formulas.
test
IF INT({#RTotal0} / 2) * 2 = {#RTotal0} THEN {F4102.IBLITM}
test 2
IF INT({#RTotal0} / 2) * 2 = {#RTotal0} THEN NEXT({F4102.IBLITM})
The formula is simply testing to see if {#RTotal0} is odd or even... Odd needs to be TRUE... Even Needs to be False.
Please be a ware:
1) my != means not equal, you used = which is equal. The reason I used != is because the angle brackets (which you'll actually want to use) don't show up in the posts on this sight... (Can we PLEASE get this fixed!!!)
... Why it matters... It keeps the odd's on the left and the even's on the right AND it keeps you from loosing the 1st record.
2) You may need to change the "{#RTotal0}" if your running total column has a different name (I just went with the CR default).
Once you have the fields in the Details section, the data in the new columns should look something like this:
Name Name
Name Name
Name Name
... with spaces in between...
The suppression formula needs to be changed for text (when I tested this last night I used a number value instead of text... sorry).
Try this:
IF {@Test} = "" THEN TRUE ELSE FALSE
See if it works now.
Jason
Hi Jason Thanks for ur reply.
In the reply u have given the suppression forumla as
IF {@c1_OrderID} = 0 THEN TRUE ELSE FALSE
what's this {@c1_OrderID} formula contains.
If I am right it should be #Rtotal0, if not please correct me.
One more thing if I am having only one record then it is displaying the same on both sides.(left and right). How to correct this.
Except that I got my answer.
Once again thanks.
Ashok,
That suppression formula is correct... well almost. It should be:
IF {@c1_OrderID} = "" THEN TRUE ELSE FALSE
because you are working with a text field.
Check my 1st post in this thread to see what "{@c1_OrderID}" is for.
It essentially checks to see if a row number is odd or even and put odd numbers in the left column and even numbers in the right column.
Jason
Hi Jason
As I'm almost done with the report, but there was a change request in the requirement.
They want to dipslay first half of the records on the left and another half on the right,not the alternative records on the left and and right side.
If they are 25 records, first half will be 13 and second half will be 12.
So they want the first 13 records on the left and next 12 on the right.
Can u please help me.
Thanks
-Ashok
Ashok,
To do this you would simply need a little modification.
First you would need to know your total number of records and divide by two...
HalfRowCount = RoundUp(Maximum(RecordNumber) / 2)
Then change your existing formulas to something like...
1st Column Set = IF RecordNumber <= {@HalfRowCount} THEN ...
2nd Column Set = IF RecordNumber > {@HalfRowCount} THEN ...
See how that works for you.
Jason
User | Count |
---|---|
57 | |
11 | |
7 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.