KoolReport's Forum

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

PDF Word wrap #917

Open Kasun Wijayamanna opened this topic on on Jun 11, 2019 - 1 comments

Kasun Wijayamanna commented on Jun 11, 2019

Hi team, I have created PDF , there many links i have kept. But column alignment was missing when export data. I did added the query when getting data like

->pipe(new CalculatedColumn(array(

  "document_name"=>function($row){
    if ($row['document_name'] != null ){
      $document = str_replace(',','',$row['document_name']);
       return wordwrap($document,35,"<br>\n");
    }
  }
  )))

But it was not working as expected. Please refer the below screen shot and give the solution .Thanks in advance.

KoolReport commented on Jun 12, 2019

It is better that you do the wordwrap() in the formatValue of Table. You can set the custom function to formatValue

Table::create(array(
    "columns"=>array(
        "document_name"=>array(
            "formatValue"=>function($value)
            {
                  $value = str_replace(',','',value);
                   return wordwrap($value,35,"<br>\n");
            }
        )
    )
))

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
help needed

Export