KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.

PDF Word wrap #917

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

Kasun Wijayamanna commented on Jun 11

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 6 days ago

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");
            }
        )
    )
))

Give tips to supporter for his good work

If you feel that supporter has done a good work, consider giving him some credit. Any amount put into the tips box below is appreciated. By doing so, you have contribtuted to the existence of KoolReport and the quality of support.

Tips box
help needed

Export