craig
craig

Reputation: 26262

Create a Crystal Report cross-tab 'header' label

I'd like to create a 'header' label that 1) is centered over the cross-tab and 2) grows with it. Unfortunately, CR 2008 (or earlier for that matter) doesn't have this feature.

In image (below), I've added a text field above the cross-tab, but I can't think of a way to get it to grow/shrink (horizontally) with it.

enter image description here

Upvotes: 0

Views: 3620

Answers (1)

Ryan
Ryan

Reputation: 7287

If you're able to calculate, say by a summary function, the number of columns you will have then you can do this:

  1. In your crosstab, check to see the width of your columns. The columns should be set widths. Edit: The crosstab adds some padding, so you will have to figure out the column width by measuring in Crystal with another field and eyeballing until it's close enough to work
  2. Right-click on your label, and hit "Size & Position".
  3. Add a new formula for the "Width". The X,Y positions should stay the same.
  4. Use the summary function (You could create a SQL Expression or formula that only shows the month/year of your date fields and then distinctCount() them) to find out how many columns you will have multiplied by the width of each column. This will take some trial and error for sure, but I don't see why it wouldn't work.

Upvotes: 1

Related Questions