mpdf with dynamic data - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: mpdf with dynamic data (/showthread.php?tid=55258) Pages:
1
2
|
mpdf with dynamic data - El Forum - 10-22-2012 [eluser]Brad K Morse[/eluser] I used this library for domPDF in CI https://github.com/iamfiscus/Codeigniter-DOMPDF Code: // controller You need to use inline styles in the view, I removed them in my example I pasted here, so it is easier to read. I have the private function generate_pdf to take the output send_pdf function creates, it also generates a filename for the pdf and writes it to the designated upload directory. Hope this helps! mpdf with dynamic data - El Forum - 10-22-2012 [eluser]soyut[/eluser] Thanks. I will try as soon as i got home, in an hour mpdf with dynamic data - El Forum - 10-22-2012 [eluser]soyut[/eluser] Hi, Happy News!! OK, Now Id like to explain where have I done mistakes. I have used mpdf library. I had 2 functions in controller function reporting(), and function topdf() In my search page after i choose the options i simply click the submit button and that passes these form values to function reporting(), and in this function i call my model, in the model queries run, ....etc and finally results returned to the same function as an array. I use this array when i load the view function and Everything works fine, i get nice reporting page. Here is my mistake; I put a link in this page so that when i click it i can print it out as a pdf file. However in the anchor I called another function, function topdf(). Obviously im not passing any values to this function. Thats why i cant see the variables in pdf file. I copied all the content in the function topdf() into function reporting(), and when i click submit button i get pdf file automatically with the variables i need it. at this moment Im happy as I understood my mistakes. Now I need to find a way to pass any values from foreach function to controller function using anchor. Thanks for your help. mpdf with dynamic data - El Forum - 10-22-2012 [eluser]soyut[/eluser] forgot to add the function, sorry Code: public function report(){ |