KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

PDF export #1441

Open George opened this topic on on May 14, 2020 - 1 comments

George commented on May 14, 2020

Hi guys,

I have a report that uses some function in view to determine if a value is greater or smaller than a value and changes the color in the css cell value (Table output) . I don't have the pdf export package but I wonder if it keeps the format of the css in it's output ?

my code in the view is like this :

"fw" => array(
            "label" => "Fresh Water",
            "formatValue" => function($value,$row)
            {
              $color = $row["daysoffw"]<=10?"#ff0000":"#000";
              return "<span style='color:$color'>".number_format($value)."</span>";
              }

In short, will I keep this formatting in my pdf export simple as that or there's more to consider ? Also what happens with cells that have 2 -3 lines of text ? I'm asking because now I use fpdf library to produce the pdf's and it needs heavy tweaking to implement the multicell function for the text and I haven't yet started to see if the coloring function can be made at all.

George

KoolReport commented on May 14, 2020

Your above requirement is possible.You can generate table inside pdf with color for specific cell. The way you did is correct.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
None yet

Export