Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert to Columns

Status
Not open for further replies.

SMosley804

Technical User
Oct 15, 2007
44
US
Crystal Reports ver11
DB-IBMDB2

I have a report that I need to display 3 values for by ServerName. Currently the report looks like:


Server-LBDDEV25
Resource Property Value
Partion0 freespace 37
Partion0 totalspace 64
Partion0 mountpoint D:\

I need to convert the rows into columns for each property, so that the report looks like this:


Server-LBDDEV25
FreeSpace TotalSpace MountPoint
partion0 37 64 D:\

is there a way that I can do this in Crystal?

Please help!
 
Insert a crosstab in the server group and add property as sthe column, resource as the row and maximum of value as the summary field.

-LB
 
thanks LB! that actually works, however when I attempted to convert the numeric values from string to number and then convert from bytes to GB, I get zero values in the crosstab.

Also a new requirement was added to calculate the space used based on the freespace and totalspace properties which would be just a simple calculation. But it seems as though I would need to convert the three properties into their own respective columns to accomplish this. Is there another technique that I can use to get the required result?
 
How did you do the conversion (Please show the formula). You would then have used the formula in the crosstab.

Because you have only three property values and you now need to do a calculation, I would instead create a manual crosstab. First insert a group on server and a second group on resource. Then create three formulas:

//{@freespace}:
if {table.property} = "freespace" then
tonumber({table.value})

//{@totalspace}:
if {table.property} = "totalspace" then
tonumber({table.value})

//{@freespace}:
if {table.property} = "mountpoint" then
{table.value}

Place these in the detail section and insert maximums on them at the resource group level. Then suppress the detail section and drag the groupname into the group footer. You can do the conversion to GB right in these formulas by dividing by the conversion factor.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top