Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Crystal Reports: Cross-Tab Column Arrangements

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

like image 868
Marshal Avatar asked Nov 06 '22 07:11

Marshal


1 Answers

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.

like image 165
PowerUser Avatar answered Nov 26 '22 12:11

PowerUser