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 / Dynamic Flexible heigh...
Power Apps
Unanswered

Dynamic Flexible height gallery - containers - PDF

(0) ShareShare
ReportReport
Posted on by 56

Hello there, 

I have another crazy request - I am attempting to create a dynamic PDF that will include a Header section, Contact section, Details section, and Footer section. 

This is a Flexible Height Gallery with 4 containers for each of my sections.

ITEMS = Sequence(12)

Header container VISIBLE = If(ThisItem.Value=1,true,false)

Contact container VISIBLE = If(ThisItem.Value=2,true,false)

Details container VISIBLE = If(ThisItem.Value=3,true,false)

Footer container VISIBLE = If(ThisItem.Value=4,true,false)

(These visible properties will become more dynamic for when there is more than 1 page in my PDF.)

 

My goal to make the Details section more dynamic, which is the issue - 

Within my Details container, I have a nested flexible height gallery.

If I have a MAX gallery height on pg 1 (350), I only want to show the topN rows whose heights SUM <= 350. The next detail rows should then be visible in Details section on Pg2 (max height 622) - with the same type of calculation. 

(Page 2+ will only include header, details and footer, which is why my MAX height is more.)

 

Broken down:

Page 1 - Max details gal height 350, only show topN rows whose heights SUM <=350.

Page 2 - Max details gal height 622, show next topN rows whose heights SUM <= 622 and arent already shown on page 1.

Page 3 - Max details gal height 622, show next topN rows whose heights SUM <= 622 and arent already shown on page 1 or 2.

 

 

Here is what pg1 looks like with out all my notes and commentary:

kpechal150_1-1704312120545.png

 

 

Here is a bit more info about what all is going on.

 

kpechal150_2-1704312219790.png

 

I was able to get it to limit the number of rows visible, but cant figure out how to make it dynamic based on SUM row heights.

 

PDF screen ON VISIBLE

UpdateContext(
 {
 pageCounter: RoundDown(
 PDF_Layout_galDetails.Height / PDF_Layout_galDetails.TemplateHeight,
 0
 )
 }
);
UpdateContext(
 {
 galleryRowTotal: RoundDown(
 PDF_Layout_galDetails.Height / PDF_Layout_galDetails.TemplateHeight,
 0
 )
 }
);

 

Nested Flexible Height Details gallery ITEMS

LastN(
 FirstN(
 colSTDetails_Indexed,
 pageCounter
 ),
 galleryRowTotal
)

This gives me the top 10 rows --- gallery height (350) / gallery template height (35). Which would work if this were a regular gallery.

 

Any thoughts on how I could make my details dynamic? Please let me know if clarification is needed.

 

Any help is much appreciated. Thank you!

Kristina

Categories:
  • MissingLink Profile Picture
    236 on at

    Hi @kpechal150 

    I have NO idea if this will solve the problem or not, but here goes anyway.

     

    In the Gallery, could you set the TemplateSize=CountOfRecords?   

     

    You may need to do some 'jiggery_pokery' in each parent gallery by using CountRow() to determine the number of rows for the subset below it.

    Then in the Child Gallery, set TemplateSize= ParentGallery.CountRows() value.

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

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard