Fields in PDF Export

QuestionsFields in PDF Export
Tom Fitz asked 7 years ago

Hi,

I have a table with many fields in it. On the grid, I use the select command to show only a few fields. But when I export to PDF, it is throwing the following exception: "TCPDF ERROR: Some data has already been output, can't send PDF file". I'm guessing that the error is because the PDF export is trying to include all the fields from the table, instead of just the ones I'm displaying.

Can you please provide information on how to resolve this?

Thanks,
Tom

4 Answers
Abu Ghufran answered 7 years ago

Hi,

This error usually come when some html or text is sent to output before the $grid->render() function call. Please recheck.

Thanks.

Tom Fitz answered 7 years ago

Abu,

I've doubled check and there is nothing being sent to output before the render.

This error appears to occur when I filter 823 rows down to 4 rows and use the following:
$grid["export"] = array("format"=>"pdf", "filename"=>"merchant-income-report", "sheetname"=>"test");
$grid["export"] = array("filename"=>"merchant-income-report", "heading"=>"Merchant Income Report", "orientation"=>"landscape", "paper"=>"a4");
$grid["export"]["range"] = "filtered";

Thanks,
Tom

Abu Ghufran answered 7 years ago

Can you check the response of HTTP call using firefox->firebug->response.
If your code is online somewhere, let me know the link.

Regards,

Sreenath VN answered 4 years ago

Hi Tom,

I had same issue "TCPDF ERROR: Some data has already been output, can't send PDF file". I have used custom export method. In custom export method, at the end method i have added ob_clean(), it solved the problem. Generally this error will appears when something is outputted before the pdf output, it may be space or some special chars.

Regards,
Sreenath VN

Your Answer

9 + 14 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating / 5. Vote count:

We are sorry that this post was not useful for you!

Let us improve this post!