Michael | |
Is there a format string I can use to replace cells with just a single zero with a blank? The zero cells are distracting. I only want to see non-zero values in the cells.
Posted Aug 27, 2016
Kool
|
|
Michael | |
For now, I'm doing the following which is working:
<?php $htmlstring=$pivot->Render(); $newhtmlstring=str_replace("<td class='kptDataCell text-right '>0</td>","<td class='kptDataCell text-right '> </td>",$htmlstring); echo $newhtmlstring; ?>
Posted Aug 27, 2016
Kool
|
|
David | |
Hi Michael,
One way to remove the zero cell is to filter out the zero value in your sql select query. For example: select row_field, column_field, data_field from table where data_field != 0 Note that this only works correctly if all your data_field's values are greater than or equal to 0. Thanks!
Posted Aug 29, 2016
Kool
|
|
David | |
I almost forgot. There's also another way to change a field's value by overriding a pivot field's DisplayFormat method. Say you use a PivotSumField for data field, what you could do in your case is like:
Thanks!
Posted Aug 29, 2016
Kool - 2 people like this post
|
|
Michael | |
Yes, that worked perfectly! I didn't even know you could extend a class like that! I'm sure this technique is much more efficient that my replacing a zero string with
Thanks for the PHP lesson!!! Mike
Posted Aug 29, 2016
Kool - 1 person likes this post
|
|