Export PDF & CSV

QuestionsExport PDF & CSV
Gary Brett asked 9 years ago

Hi Abu, I have been trying to use grids with both export to csv & pdf, the pdf exports with columns all different sizes & no right margins, unless I remove the options to export to csv, excel etc.

When I try your demo to export all it says 'couldn't load plugin', both locally & on your site. Is it possible to have the option of exporting both excel & pdf?




3 Answers
Gary Brett answered 9 years ago

Sorry Abu, please ignore above the demo had crashed my adobe plugin.

However running the code here it allows me to export to pdf but has no right margin and column widths are out. – http://pastebin.com/KrjkWXUD

This however does out correctly but does not allow export to csv – http://pastebin.com/znHDfHNH

Thank you

Abu Ghufran answered 9 years ago

For proper width adjustment in pdf, you must define width setting for all columns of grid. I see in code that few have missing width settings.

For export csv, you should remove format=>pdf.
$grid["export"] = array("format"=>"pdf", "filename"=>"my-file", "heading"=>"Invoice Details", "orientation"=>"landscape", "paper"=>"a4");

After that it would use the set_actions sent data.

Gary Brett answered 9 years ago

Brilliant Abu

Your Answer

5 + 6 =

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 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

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

Let us improve this post!

Tell us how we can improve this post?