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 / PDF is not generatinge...
Power Apps
Answered

PDF is not generatinge for flexible height gallery

(1) ShareShare
ReportReport
Posted on by 10
Q : How can i make pdf for flexible height gallery?

Issue : Only visible portion of the gallery within the screen is prining for flexible gallery but i need all item to be printed for flexible height gallery.
sample code i have used for view pdf
Set(varpdf,PDF(Gallery6,{ExpandContainers:true}))
Categories:
  • Fardy_MADI_2 Profile Picture
    334 Super User 2024 Season 1 on at
     
    To solve your issue insert your gallery in a vertical container  and use this container in the PDF function.
     
     
    First you have to make a dynamic height for the gallery with this formula : 
    (Self.TemplateHeight + Self.TemplatePadding) * Self.AllItemsCount
     
    Then, because your gallery will be larger than your container you can set the LayoutOverflowY of the vertical container to LayoutOverflow.Scroll
     
    Finally you just have to use the PDF formula Set(varPDF, PDF(Container4, {ExpandContainers:true}))
  • CU25121618-0 Profile Picture
    10 on at
    @Fardy_MADI

    This method is not working. ( * ) is marked red.
  • koss054 Profile Picture
    2 on at
    I stumbled upon this post after running into the same issue.
     
    @Fardy_MADI_2's suggestion worked for me.
     
    @CU25121618-0 is also right - the multiplication gets underlined due to a circular reference.
     
    Update the gallery's TemplateSize property. Its formula uses the gallery's Height property by default, causing the circular reference error/underline.
  • Verified answer
    WarrenBelz Profile Picture
    156,958 Most Valuable Professional on at
    Firstly setting the Height of your Gallery to
    (Self.TemplateHeight + Self.TemplatePadding) * Self.AllItemsCount
    is valid (I am not sure where you are getting the error), but is more accurate setting the TemplatePadding to 0 (zero) as below.
     
    However this will not be accurate on a Flexible Height Gallery as the TemplateHeight being used in the formula is the minimum height (the one set in the gallery properties) and any expansion by AutoHeight of an element will make the gallery Height resulting too small.
     
    The rest of the suggested solution is correct regarding the Container.
     
    Please ✅ Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like ♥
    Visit my blog
    Practical Power Apps    LinkedIn  
     
     

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 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard