Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Dynamic Number of Columns

Dynamic Number of Columns

Dynamic Number of Columns

thread149-575997: Crosstab columns extending beyond one page

Regarding above thread I have dynamic number of employees as columns.How to deal with this?
Currently I have hard coated all of my employees as follows in the formula.

if ({command.EMP_NO} in ['219'to '512'])then 0
else if ({command.EMP_NO} in ['515'to '642'])then 1
else if ({command.EMP_NO} in ['678'to '736'])then 2
else if ({command.EMP_NO} in ['737'to '781'])then 3
else if ({command.EMP_NO} in ['791'to '840'])then 4
else if ({command.EMP_NO} in ['853'to '872'])then 5
else 6

RE: Dynamic Number of Columns

I would create enough columns + a few extra. Then dynamically assign the employees to the columns.

RE: Dynamic Number of Columns

Would you kindly illustrate it bit more.
How to count employees and add eight of them per group ?
A running distinct count of employees cannot be taken into the formula in crystal reports.

RE: Dynamic Number of Columns

You must be dealing with a report and not a database. I'd make every effort to get access to the source table(s), since dealing with a cross tab report as an analytic source is a royal pain.

As an alternative, export/import into Excel and use the following process to normalize your data into a useable table.

FAQ68-5287: NORMALIZE Your Table using the PivotTable Wizard


glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: Dynamic Number of Columns

As I understand it, you are trying to have a Report/Page header appear on all pages when the cross tab extends vertically across pages.

This is not something I have ever needed to do but using Ken Hamady's solution to the referenced earlier thread, and depending upon the complexity of the Header you want displayed, one possible solution is to formula that contains the text and include that as the first column of the Cross Tab.

Hope this helps.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close