Report totals

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
daveb
User
Posts: 32

Report totals

Post by daveb »

I have several reports that contain a decimal number that represents minutes, which I use cell_rendering or page_rendering to covert the view value into HH:mm . However, this function is not activated in the sub total and total rows - they simply show SUM=12345 . Is there a way to apply the same formatting to the total lines? BTW I would also like to change the SUM= and COUNT= lables.

Thanks

Davod


mobhar
User
Posts: 11725

Post by mobhar »

You may post your code in that Cell_Rendering or Page_Rendering server event for more discussion.


daveb
User
Posts: 32

Post by daveb »

I have placed this code in Row_Rendered and it works fine in List pages and in Report detail rows :

 $h = floor($this->Flight_Time->CurrentValue/60);
 $m = 100 + ($this->Flight_Time->CurrentValue - ($h * 60));    // force leading zero on minutes
 $this->Flight_Time->ViewValue = $h . ":" . substr($m,1,2);

It also works in Summary items on the List pages, but does not work on Report summary rows, so I added:

    if ($Field->Name== 'Tow_Time')
   {
    $h = floor($CurrentValue/60);
    $m = 100 + ($CurrentValue - ($h * 60));    // force leading zero on minutes
    $this->ViewValue = $h . ":" . substr($m,1,2);
    }

in Cell_Rendered for the report, but there is no change.

If possible, I would also like to change the labels +SUM=", COUNT=" etc. in the summary lines.


arbei
User
Posts: 9384

Post by arbei »

daveb wrote:

$this->ViewValue = $h . ":" . substr($m,1,2);

There is no $this->ViewValue, you need to use the arguments of the Cell_Rendered server event.


daveb
User
Posts: 32

Post by daveb »

Correctred the code - It gives me correctly calculated times in HH:mm.

  if ($Field->Name== 'Tow_Time')
   {
    $h = floor($CurrentValue/60);
    $m = 100 + ($CurrentValue - ($h * 60));    // force leading zero on minutes
    $ViewValue = $h . ":" . substr($m,1,2);
    }

Thanks

David


Post Reply