views:

50

answers:

2

Hello,

I am looking for a way out in cross tab, so that if the columns exceed in cross tab, they shouldnt go on next page..rather a new cross-tab should repeat after the first one.

For example, two columns are displayed in a cross tab :

alt text

Now if a new column is added, and assuming that it could not be accomodated within the given page width limit, it will go to a page next to it in CR by default.

But in my report it is required to be shown below the first cross tab (and not on next page), which will look as follows:

alt text

Please do suggest me if there's a way out :)

Thanks in advance

+1  A: 

Your question is perfectly reasonable, but I'm pretty sure that in CR-XI, there is no automatic way to do this. I recommend skipping the cross-tab designer completely and just making your own:

  1. Make a new CR using a placeholder table that has exactly 1 record.
  2. In this CR, suppress everything but the details section. Add a new details section so you will have Da and Db.
  3. In Da, add a subreport. Use your real datasource and add Column1 and Column2.
  4. In Db, add a subreport. Use your real datasource and add Column3 and Column4.

I don't have time to test this, but I think it will display all the columns as you requested.

(Instead of step 1, you can probably use a placegrouper group in your report that only has 1 group. Then, when you add the subreports, make sure to not add any links to the main report.)

Edit

A dynamic number of columns makes this request much more difficult to do in Crystal.

  1. Maybe you could autogenerate the entire report from a script. I couldn't help you with that, but I'm sure someone else on StackOverflow will.

  2. You can use MS Excel to achieve something similar. Use MS Access or something similar to set up a crosstab of your data. Open a new Excel workbook and import your crosstabbed datasource using Data->Import External Data->Import Data (this imports the entire table, regardless of number of rows). In Page Setup, change settings to Fit to (blank) pages wide by 1 pages tall. You can format the data however you like and the format will be retained. This Excel method will squeeze all your columns into a 1-page wide area. It's not quite what you're asking for, but it will work.

  3. The number of columns may be dynamic, but do you know what the field names could be? For example, your columns include 0-50 US States, then you know what the column names will be, just not which ones or how many. If this is your situation, then use my first suggestion (check off the suppress if blank options to hide unneeded subreports). It won't be pretty (alot of white space), but it can get the job done.

PowerUser
Hi PowerUser, Thanks for they reply. This method works when we have known number of column count. But in my application the user enters some items, and for each item a column should be generated. And hence it can be only achieved using Cross-Tab.
Niraj Doshi
Hi, thanks for the reply. You are right its not possible directly. I too went around the problem for 2 days and visited all the forums. But my CLIENT is not ready to accept the format.. :(
Niraj Doshi
See my edit. You have a few options left, but not many.
PowerUser
What i want to achieve is possible, but it would just increase unnecessary coding :) Thanks again ..!!
Niraj Doshi
26 seconds after you responded, I put option #3 in there. What do you think of that one?
PowerUser
A: 

A possible solution can be a multi column report. But it can be difficult to make the row labels and values in the same line.

If you can create an additional row grouping then you have the solution that you want. For example if your columns have number like in your sample. Then you can add a formula like:

columnId \ 2
Horcrux7
Thanks guys, I solved it programmatically. I just saw how many columns can be fit in the pagewidth and passed the ColumnIDs to RecordSelection Fromula. Now if the column count exceeded, they would come in a new ReportHeaderSection below in a Sub report. This sub report has same cross tab as in ReportHeaderSection1. If column count are less, the ReportHeaderSection2 is suppressed.
Niraj Doshi