Too many columns creates unwanted extra width, how to achieve wrapping?

Posted on 2004-09-27
Last Modified: 2010-11-11
I have created a crosstab report that selects all the data correctly. There is a variable number of columns and rows. If all the data fits onto one page everything is fine. If there are more rows than will fit onto one page it is handled correctly. However if there are more columns than will fit onto the page they flow onto the virtual page and print on a separate sheet with no headers or footers, no page number, and of course the row headers are not printed.
How can I control the number of columns selected for the crosstab, and make the whole table repeat for the excess columns?
I am using Crystal Reports 10 and selecting my data from an Access database.

Many thanks,
Question by:BleedinFingers
LVL 10

Expert Comment

Comment Utility
check these out

LVL 10

Expert Comment

Comment Utility
Also read this :

Printing Cross-Tabs that span multiple pages
When you create a Cross-Tab that is wider or longer than the specified page size, the program automatically spans the printing across enough pages to accommodate the size of the Cross-Tab. In the Preview tab, a line will appear at each page break. For ease in reading, column headings will be repeated on subsequent pages. Row headings can also be repeated using the Keep Columns Together option.

To repeat row labels
Right-click the blank top-left area of the Cross-Tab and select Cross-Tab Expert from the shortcut menu.
The Cross-Tab Expert appears.

Click the Customize Style tab.
Select the Repeat Row Labels check box, if desired.
Crystal Reports lets you designate report objects that don't expand horizontally, such as text objects, field objects, OLE objects, charts, maps, lines, boxes, and so on, to be repeated on each additional horizontal page that a Cross-Tab creates. For more information, see Repeating report objects on horizontal pages.
LVL 10

Assisted Solution

ebolek earned 100 total points
Comment Utility
To repeat objects on horizontal pages
Right-click the report object you want to repeat.
On the shortcut menu, click Format Field, or the appropriate format option.
Note:    Formatting options are not available if the object you select is connected to the Crystal Repository. For information about modifying an object in the repository, see Modifying objects in the repository.

On the Common tab of the Format Editor, select the Repeat on Horizontal Pages check box.
For a line or a box, the Repeat on Horizontal Pages option appears on the Line or Box tab.

Click OK to save your changes.
Now, if a cross-tab or OLAP grid makes your report expand horizontally, the object you formatted is repeated on each horizontal page.

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

LVL 77

Expert Comment

Comment Utility
Hello BleedinFingers,

Given that you are using the first version of CR where almost all this is possible then what a shame ...

Right click on the object you want to repeat and 'format field'.
On the common tab, select 'repeat on horizontal pages'.

I don't know how you can work out how mant columns there will be; but if you want to creat a lopp then you will have to do it outside of CR in a VB (or similar) front-end.

LVL 26

Accepted Solution

Kurt Reinhardt earned 400 total points
Comment Utility

If you want your report to paginate horizontally, then check out the comments above.

To directly answer your question, "How can I control the number of columns selected for the crosstab, and make the whole table repeat for the excess columns?":

You have two options:

1)  Identify sets of columns values (10 values, for example).  Select data with these values only using the Records Selection Criteria.  Since you may have additional values, you would then need to create one or more subreports** , each of which has a specific set of values.  You could then format the container report and subreports, so that your overall presentation shows multiple vertical crosstabs, each of which has a finite number of columns.  This approach works, but may not look as professional as it should.  The reason is because one crosstab might only have 2 columns, but another might have 10.

2)  Create manual crosstabs.  This can be pretty complex and tedious, but it works well if you want a finite set of columns.  Since you want multiple vertical crosstabs, you'll also need to use subreports** for this solution.

To create a manual crosstab, you'll need to Group by your row field.  Next, create text column headers for as many columns as you want.  Then, you'll create a series of formulas, one for each column.  A sample formula might look something like this:

//@sample column formula
//assuming a numeric Qty field
  {table.field} = 'Column Value 1'

You'll place these formulas in the detail section of the report, in their respective columns (identified by the Headers you created).  You'll then right click on each formula and Insert Summary in the Group Footer for the Row Group.  Lastly, you'll hide the detail section.  Voila!  You have a manual crosstab.

**Since you want multiple vertical crosstabs, each of which with a finite set of columns, you'll need to use subreports.  Save the report you just created.  Then save the report again as a different name. Modify the newly saved report by changing the column values in the Record Selection Criteria (Option 1) or in the formulas and text headers (Option 2) to be equal to the next set of columns you need.  Save the new report.  Repeat for as many subreports as you need.  

Insert each new subreport into the Report Footer of the container report.  If it helps, create multiple Report Footer sections, one for each subreport.  This keeps things tidy.  If your report is parameterized, then you'll need to link the subreports, otherwise you won't need to.


Author Comment

Comment Utility
Many thanks for all these wonderful responses.  I will get back to you all soon once I've had a chance to evaluate them.

Author Comment

Comment Utility
Hi all,

Kurt, I think your response most directly addresses the question I posed, however ebolek's 2nd response was the most helpful.  Can you both help me a little further?

Where the crosstab has spanned additional pages horizontally and I print I get 4 pages.  The first page is labelled "pg 1 of 2" and contains the first rows of the table, the second page is not labelled and contains the spanned columns.  The third page is labelled "pg 2 of 2" and contains the later rows and a fourth page is not labelled and contains the last rows and spanned columns. (Hope that's not too convoluted.)

I think the whole report would work if I could get the spanned horizontal pages numbered (ie "pg 2 of 4").  I'm sorry that the context of this question is moving, this will be the only modification to the above question.

I have no help files or manuals, although the version I'm using is based upon version 10, I'm using a third party's implementation of it.

Thank you for your patience and help.

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now