mpdf with dynamic data |
[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!
[eluser]soyut[/eluser]
Thanks. I will try as soon as i got home, in an hour
[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.
[eluser]soyut[/eluser]
forgot to add the function, sorry Code: public function report(){ |
Welcome Guest, Not a member yet? Register Sign In |