web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Generating Dynamic PDF's
Power Apps
Unanswered

Generating Dynamic PDF's

(0) ShareShare
ReportReport
Posted on by 4

Hi,

 

I have been working on a project where teachers will submit a bunch of information and generate school reports from the app.

 

I need to be able to generate PDF's with the data from my SharePoint Lists which are populated from the app.

I have found and tried a number of ways to accomplish this, but the issue is my pages need to dynamically change size, depending on how many rows exist with a specific ID

 

I have found a way to do with this the "Populate Word Document" plugin with power automate - but this requires premium for each user which the schools will not pay for.

I have also looked into Power BI Report Builder, which seems to do the trick - but it also paid per user.

Curious if there is any other ways I can accomplish this?

Can you generate documents with a dynamic number of pages with HTML?

Are there any other 3rd party document generation plugins that can be used (it can be paid, as long as it's not per-user)

Categories:
  • Irfan Profile Picture
    164 on at

    Hi @CTBailey 

     

    Try Plumail.

    https://plumsail.com/

     

    We had a similar requirement but it was for a spreadsheet. I have used tables in there and then passed the data as JSON to the table which generated rows with dynamic no of rows based on the data selected by the end user.

    I guess it gives you a one month trial. It requires an API to work but its not that expensive.

     

    We are using Sharepoint to store data.

     

    The issue you would face is you do not want to buy API's for each user. Workaround for us was to use a "service account" (a standard account but is not an end user account) which will have the API config (through Power Automate).

    This accounts keeps on tracking a certain sharepoint list. In our application, when the user clicks on print button, the data is pushed to this specific sharepoint list. The flow running through the service account reads the data, utilizes the plumsail connector which creates the final output for us. It than creates a file temporarily into sharepoint library location and opens it up on the users machine. In your case, you can skip this part and email the file generated by plumsail.

    In this way, you can bypass the requirement for getting API for each user as your service account will take care of it. Just bear in mind the no of API call's your service account will make as we currently are in the "transition period" which allows us to make 25K calls per account per day. This will reduce to 5K (depending on your license) when the transition period ends sometime early next year.

     

    The only other option you have is to define templates in collections and replace the values in it during runtime followed by resetting it back to default values.

    But in order to use that, you need to have a defined no of variations for the PDF's to be generated. I have used it in one of my apps where I had 5 different variations. It works fine but its a pain to develop and maintain. But, in the end, its free 🙂

     

    -Irfan

  • CTBailey Profile Picture
    4 on at

    Great reply, thanks heaps for that - I will check out Plumsail, it seems like exactly what we need.

  • CTBailey Profile Picture
    4 on at

    Unfortunately it looks like we are unable to use 3rd party apps - the Department of Education have locked them down..

  • KvB1 Profile Picture
    1,596 on at

    Very possible, but does require some knowledge on HTML.

     

    Summary of automate you need to build:
    - Store the relevant information in a HTML table

    - Create a HTML file on OneDrive using the HTML table as well as some format code you need. As the content of this file, you would need to use HTML code. If you're new to this check out: https://www.w3schools.com/html/tryit.asp?filename=tryhtml_intro

    - Use OneDrive convert file action to convert the HTML file to a PDF.

     

    You end up with a pretty basic but functional PDF.

     

    There are ways to populate fields in a PDF template as well while avoiding 3rd party apps, but I don't have any experience with them.

     

  • akandis Profile Picture
    on at

    Hi @CTBailey 

     

    Generate reports either in word pdf or any document it's a process that needs a lot of compute resource to be generated quickly and without any kind of problems.

     

    Power Apps and Power Automate limiations/issues:

    • PDF report with for example 150 records can take a big time on being generated.
    • Populate word document action have limiations and if you have to create a big document will give you some erros and big executions times.
    • Depending on you Report format you will have to create a complex Flow.
    • Onedrive conversion action can give you errors while generating big/complex reports.

     

    In short, using Power Apps or Power Automate is not the best scope. This have to be extended with a traditional code to avoid erros and also have our own service with their own compute resource to have good execution times.

    And also image where you have to manage the UX when the user clicks to a button called "Generate Report" then as a requisit you have to respond to the Power App saying if the report was generated succesfully or not... Sadly if the execution take more than 1 minute the Respond to Power Apps action will rise and error braking you Power Apps UX because never the execution will respond with somethin.

     

    Solution

    The best solution here is create an Azure Functions and a Custom Connector to be consumed from your app/flow from the user context. This is the most robust way and optimization.

     

    I was many times in this kind of scenarios and one day one customer was requesting to validated with 
    the Microsoft Power Platform support team and after reviewing it cautiously I was confirmed with the
    yes of the Msft techinicians (just to make you more confident)

     

    If you go with this approach please ensure that the library that you use doesn't have any OS dependency. If there is some OS dependency you have to go with Azure Functions Premium plan to avoid any problem. 

     

    Hope this is helpful 🙂

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 130

Last 30 days Overall leaderboard