| Support Center

(Back to Website)

Support Center

Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Fields in PDF Export

Tom Fitz Apr 02, 2013 02:16AM PKT


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?


Up 1 rated Down
Abu Ghufran Apr 02, 2013 06:47AM PKT PHP Grid - Support Center Engineer

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

Up 2 rated Down
Tom Fitz Apr 07, 2013 09:21AM PKT

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

Up -3 rated Down
Abu Ghufran Apr 08, 2013 08:13AM PKT PHP Grid - Support Center Engineer
Can you check the response of HTTP call using firefox->firebug->response.
If your code is online somewhere, let me know the link.

Up 0 rated Down
Sreenath VN Jun 24, 2015 03:15PM PKT
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.

Sreenath VN

Post Your Public Answer

Your name (required)
Your email address (required)
Answer (required)

Contact Us

  • Post a Public Question
  • Email Us
  • Live Chat!
  • Ask the Community


    • Paste complete code that is involved in your question. You can use pastebin.com to share code link.

    Screenshots or Online link of webpage is helpful in resolution. You can also send email at address mentioned below.

    • To report an issue, Write steps to regenerate the case.

    • For email support or live chat, Use gridphp@gmail.com and add it in Google Chat.
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
Invalid characters found