Crystal Reports – Row headers for mutli-column data

crystal-reports

Please help!

I need to produce a Crystal Report with multiple data columns, but need to show row headers as well.

e.g.

(Fieldname)        (DataColumn1)        (DataColumn2)       (DataColumn3)
Animalname         Elephant             Dog                 Mouse
Animalsize         Large                Medium              Small

I have successfully got the data columns to display using the 'Format with multiple columns' option in the details section, but is there any way of displaying the headers (Animalname / Animalsize)?

(I am using Crystal Reports 2008 inside Visual Studio 2008)

Best Answer

If the table columns are name and size, you vertically arrange the details fields like...

name  {name_field}
size  {size_field}

but i think the problem with that is when you "format with multiple columns" it would turn into this...

name  {name_field}  name  {name_field}  name  {name_field}
size  {size_field}  size  {size_field}  size  {size_field}
name  {name_field}  name  {name_field}  name  {name_field}
size  {size_field}  size  {size_field}  size  {size_field}
name  {name_field}  name  {name_field}  name  {name_field}
size  {size_field}  size  {size_field}  size  {size_field}

is that the problem? How to only display the "row header" in the first column? Because I'm not sure if that's possible. And even if you could do it, is this what you really want?

name  {name_field}  {name_field}  {name_field}
size  {size_field}  {size_field}  {size_field}
name  {name_field}  {name_field}  {name_field}
size  {size_field}  {size_field}  {size_field}
name  {name_field}  {name_field}  {name_field}
size  {size_field}  {size_field}  {size_field}

Wouldn't it be easier to just go the standard way of...

name          size          name          size          name          size
{name_field}  {size_field}  {name_field}  {size_field}  {name_field}  {size_field}
{name_field}  {size_field}  {name_field}  {size_field}  {name_field}  {size_field}
{name_field}  {size_field}  {name_field}  {size_field}  {name_field}  {size_field}
{name_field}  {size_field}  {name_field}  {size_field}  {name_field}  {size_field}
{name_field}  {size_field}  {name_field}  {size_field}  {name_field}  {size_field}

Am I missing something?

EDIT

Create a formula for each field like so...

if remainder(recordnumber, 3) = 1 then
"Field Name    " + {some_field}
else
{some_field}

might want to put the conditional into a function, in case you ever want to display more than 3 columns.

Related Topic