Question

I have a datatable that looks like this (all columns have string datatype)

firstCol   secondCol  thirdCol

1_str1     1_str2     5,1  
2_str1     2_str2     5
3_str1     3_str2     
....       ....       ....

note that on the thirdCol, some fields are blank.

as for the crystal report, I have used the cross-tab feature

Columns:                firstCol

Rows:                   secondCol

Summarized Fields:      thirdCol

The columns and rows are okay. The only problem that I have is the summarized fields. As far as I have searched, it is only used for numeric data (correct me if I'm wrong).

I even created a sample datatable and bound it on the crystal report. Instead of string, it displays the "numeric" (or you may call it integer, decimal, etc) datatype which is not what I want. Is there any way to display it as a string ?

this is the actual datatable

my datatable

and this is the crystal report cross-tab output

cross-tab

nevermind the total column and row on the crystal report output. I just want to display "5,1" and "1" on the cross-tab, not the numbers.

Was it helpful?

Solution

Sure, you can display the summarized field as a string. When you created the crosstab, the default summary function is count() which is what you're seeing. Instead, go into your crosstab, select your summarized field, and hit the 'Change Summary' button. Instead of count you can use minimum or maximum (interchangeably, since I'm guessing that you will ever only have on entry for each row/column combination).

Once that change has been made, "5,1" will display for HCC and "5" will display for Legionella on Feb 14, and all other summarized fields will be null.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top