KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Export to pdf with several reports in only one pdf document #2001

Open Ruth Cano opened this topic on on Mar 30, 2021 - 7 comments

Ruth Cano commented on Mar 30, 2021

Hello.

We need to create one pdf document with all the reports we have.

We are thinking of getting Export package and we want to know if we can create our pdf document by doing this: For each report, concatenate the export of each report into a variable ($pdf), like this: $report = new SakilaRental; $pdf .= $report->run()->export('SakilaRentalPdf')

And when the loop ends and we have all the exported reports in $pdf, do this to obtain our pdf document: $pdf ->pdf(array("format"=>"A4", "orientation"=>"portrait"))->saveAs("../storage/myreport.pdf");

Is this possible? Can we get it like this?

Thanks.

KoolReport commented on Mar 30, 2021

Do you mean you want to generate several pdfs and then merge them into one?

Ruth Cano commented on Mar 30, 2021

More or less, but I prefer not to create several pdf documents but to get the code for each report and create only one pdf as I explain. How can we get it?

KoolReport commented on Mar 31, 2021

I understand, there are several php library which allows you to merge pdf. So the way it works like this:

  1. You export several pdfs with Export package.
  2. You merge them into one.
  3. You delete those unnecessary pdfs and keep the merged one.
Ruth Cano commented on Mar 31, 2021

I understand, but I didn't want to have to create and delete pdfs. I want to create a single html code to export to a single pdf. Is there no way to do this? Do you mean that what I propose in my topic is not possible?

KoolReport commented on Mar 31, 2021

Currently I have not had any other solutions to complete what you need. My suggested solution has an advantage that I have not mentioned is the memory usage, when you output each pdf first, you will not need to store them in memory, hence reducing the memory needed. As a result, the application can work with bigger pdf.

Ruth Cano commented on Mar 31, 2021

Ok. But it would be nice if there was something like this that would return the html of each report to concatenate them in a variable and obtain a single html with all the reports and then be able to export it to a single pdf document. It's a suggestion.

Now I have a question about Export package license: We are building a software solution that will use the Export package, in the way I have commented above, creating a pdf document with all the reports created by the client and this pdf will be sent by email. This software solution will be installed on several different clients. What kind of license do we need to distribute our software solution and what do we have to do at the time of installation so that they can send an export pdf using Export package? Thanks.

KoolReport commented on Mar 31, 2021

Oh, actually your solution is working as well, even better than mine as we do not need to use other merge pdf library. You can create several sub report, combined into single main report and export the main using export package. It will work. You are brilliant.

There are two ways you get Export package:

  1. Purchase Export package separately following with Regular license. Advantage: it is cost effective. Disadvantage: you need to purchase Regular license for each clients you provide solution. If you deliver to 5 clients, you need 5 regular licenses.
  2. Get KoolReport Pro: KoolReport Pro contains Export package. Advantages (1) No need to purchase license for each clients you delivered (2) containing many other commercial packages like Pivot, drilldown and others (3) Priority Support and Free Upgrade (including new package added to pro).

If you have a lot of clients or you want to get other features as well then going with KoolReport Pro is better. If you have very few 1-2 clients and the task is solely to get above requirement done, go with Regular License of Export package.

Thank you very much, looking forward to serving you as our customer.

P.S: Today is last day of month, the sale team offer 20% OFF of KoolReport Pro when you purchase KoolReport Pro + Dashboard Framework together. If you are interested, please email to us at support(at)koolreport.com, we will send you purchase link.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

Export