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

Community site session details

Session Id :
Power Apps - Power Apps Experimental Features
Unanswered

HTML Text and PDF export

(0) ShareShare
ReportReport
Posted on by 4
Hello, I'm working on exporting a PDF from PowerApps. The export function works, but it doesn't capture the full content of the report. My HTMLText is placed inside a container, and the PDF only includes the visible portion—anything below the fold is excluded. I'm looking for a way to ensure the entire report is captured, including content that requires scrolling.
 
This is the code for my PDF button: 
PlantReport.Run({file:{name:"Plants", contentBytes:PDF(Container5, {ExpandContainers:true})}})
 
 
 
HTML Text:
"<div style='max-height:600px; overflow:auto; padding-right:10px;'>"
& (
"<table style='font-family:Arial; border-collapse:collapse; width:100%; margin-bottom:20px;'>
  <tr>
    <td style='background-color:#FFD700; color:black; padding:10px; text-align:center;'>Sunflower<br><b>" & SunflowerCount & "</b></td>
    <td style='background-color:#FFD700; color:black; padding:10px; text-align:center;'>Rose<br><b>" & RoseCount & "</b></td>
    <td style='background-color:#1E90FF; color:white; padding:10px; text-align:center;'>Daisy<br><b>" & DaisyCount & "</b></td>
    <td style='background-color:#800080; color:white; padding:10px; text-align:center;'>MorningDew<br><b>" & MorningDewCount & "</b></td>
    <td style='background-color:#228B22; color:white; padding:10px; text-align:center;'>Other<br><b>" & OtherCount & "</b></td>
    <td style='background-color:#228B22; color:white; padding:10px; text-align:center;'>Tree<br><b>" & TreeCount & "</b></td>
    <td style='background-color:#FF8C00; color:white; padding:10px; text-align:center;'>Ginger<br><b>" & GingerCount & "</b></td>
  </tr>
</table>"



// Daisy
& "<h3 style='font-family:Segoe UI, Arial, sans-serif; color:#228B22; margin-bottom:8px;'>Daisy Summary</h3>"
& Concat(
    Daisy,
    If(
        Label = "Summary",
        // Add incident header + normal label/value block
        "<div style='margin-top:20px; border-top:2px solid #228B22; padding-top:10px; font-weight:700; color:#228B22; font-size:16px;'>"
        & "<div style='font-family:Segoe UI, Arial, sans-serif; margin-bottom:12px;'>"
        & "<div style='font-weight:600; color:#333; margin-bottom:2px;'>" & Label & "</div>"
        & "<div style='color:#666; font-size:14px;'>" & Value & "</div>"
        & "</div>",
        // All other label/value pairs
        "<div style='font-family:Segoe UI, Arial, sans-serif; margin-bottom:12px;'>"
        & "<div style='font-weight:600; color:#333; margin-bottom:2px;'>" & Label & "</div>"
        & "<div style='color:#666; font-size:14px;'>" & Value & "</div>"
        & "</div>"
    )
)
& "<hr style='border:none; border-top:1px solid #ddd; margin:10px 0;' />"
 

// MorningDew Section
& "<h3 style='font-family:Segoe UI, Arial, sans-serif; color:#228B22; margin-bottom:8px;'>MorningDew Summary</h3>"
& Concat(
    MorningDew,
    If(
        Label = "Summary",
        // Add incident header + normal label/value block
        "<div style='margin-top:20px; border-top:2px solid #228B22; padding-top:10px; font-weight:700; color:#228B22; font-size:16px;'>"
        & "<div style='font-family:Segoe UI, Arial, sans-serif; margin-bottom:12px;'>"
        & "<div style='font-weight:600; color:#333; margin-bottom:2px;'>" & Label & "</div>"
        & "<div style='color:#666; font-size:14px;'>" & Value & "</div>"
        & "</div>",
        // All other label/value pairs
        "<div style='font-family:Segoe UI, Arial, sans-serif; margin-bottom:12px;'>"
        & "<div style='font-weight:600; color:#333; margin-bottom:2px;'>" & Label & "</div>"
        & "<div style='color:#666; font-size:14px;'>" & Value & "</div>"
        & "</div>"
    )
)
& "<hr style='border:none; border-top:1px solid #ddd; margin:10px 0;' />"
 

// Other Status Section
& "<h3 style='font-family:Segoe UI, Arial, sans-serif; color:#228B22; margin-bottom:8px;'>Other Summary</h3>"
& Concat(
    Other,
    If(
        Label = "Summary",
        // Add incident header + normal label/value block
        "<div style='margin-top:20px; border-top:2px solid #228B22; padding-top:10px; font-weight:700; color:#228B22; font-size:16px;'>"
        & "<div style='font-family:Segoe UI, Arial, sans-serif; margin-bottom:12px;'>"
        & "<div style='font-weight:600; color:#333; margin-bottom:2px;'>" & Label & "</div>"
        & "<div style='color:#666; font-size:14px;'>" & Value & "</div>"
        & "</div>",
        // All other label/value pairs
        "<div style='font-family:Segoe UI, Arial, sans-serif; margin-bottom:12px;'>"
        & "<div style='font-weight:600; color:#333; margin-bottom:2px;'>" & Label & "</div>"
        & "<div style='color:#666; font-size:14px;'>" & Value & "</div>"
        & "</div>"
    )
)
& "<hr style='border:none; border-top:1px solid #ddd; margin:10px 0;' />"

// Rose
& "<h3 style='font-family:Segoe UI, Arial, sans-serif; color:#228B22; margin-bottom:8px;'>Hazard Summary</h3>"
& Concat(
    Rose,
    If(
        Label = "Summary",
        // Add incident header + normal label/value block
        "<div style='margin-top:20px; border-top:2px solid #228B22; padding-top:10px; font-weight:700; color:#228B22; font-size:16px;'>"
        & "<div style='font-family:Segoe UI, Arial, sans-serif; margin-bottom:12px;'>"
        & "<div style='font-weight:600; color:#333; margin-bottom:2px;'>" & Label & "</div>"
        & "<div style='color:#666; font-size:14px;'>" & Value & "</div>"
        & "</div>",
        // All other label/value pairs
        "<div style='font-family:Segoe UI, Arial, sans-serif; margin-bottom:12px;'>"
        & "<div style='font-weight:600; color:#333; margin-bottom:2px;'>" & Label & "</div>"
        & "<div style='color:#666; font-size:14px;'>" & Value & "</div>"
        & "</div>"
    )
)
& "<hr style='border:none; border-top:1px solid #ddd; margin:10px 0;' />"



// Sunflower
& "<h3 id='Sunflower' style='font-family:Segoe UI, Arial, sans-serif; color:#228B22; margin-bottom:8px;'>Sunflower Summary</h3>"
& Concat(
    Sunflower,
    If(
        Label = "Summary",
        // Add incident header + normal label/value block
        "<div style='margin-top:20px; border-top:2px solid #228B22; padding-top:10px; font-weight:700; color:#228B22; font-size:16px;'>"
        & "<div style='font-family:Segoe UI, Arial, sans-serif; margin-bottom:12px;'>"
        & "<div style='font-weight:600; color:#333; margin-bottom:2px;'>" & Label & "</div>"
        & "<div style='color:#666; font-size:14px;'>" & Value & "</div>"
        & "</div>",
        // All other label/value pairs
        "<div style='font-family:Segoe UI, Arial, sans-serif; margin-bottom:12px;'>"
        & "<div style='font-weight:600; color:#333; margin-bottom:2px;'>" & Label & "</div>"
        & "<div style='color:#666; font-size:14px;'>" & Value & "</div>"
        & "</div>"
    )
)
& "<hr style='border:none; border-top:1px solid #ddd; margin:10px 0;' />"

// Treed
& "<h3 style='font-family:Segoe UI, Arial, sans-serif; color:#228B22; margin-bottom:8px;'>Tree Summary</h3>"
& Concat(
    Treed,
    If(
        Label = "Summary",
        // Add incident header + normal label/value block
        "<div style='margin-top:20px; border-top:2px solid #228B22; padding-top:10px; font-weight:700; color:#228B22; font-size:16px;'>"
        & "<div style='font-family:Segoe UI, Arial, sans-serif; margin-bottom:12px;'>"
        & "<div style='font-weight:600; color:#333; margin-bottom:2px;'>" & Label & "</div>"
        & "<div style='color:#666; font-size:14px;'>" & Value & "</div>"
        & "</div>",
        // All other label/value pairs
        "<div style='font-family:Segoe UI, Arial, sans-serif; margin-bottom:12px;'>"
        & "<div style='font-weight:600; color:#333; margin-bottom:2px;'>" & Label & "</div>"
        & "<div style='color:#666; font-size:14px;'>" & Value & "</div>"
        & "</div>"
    )
)
& "<hr style='border:none; border-top:1px solid #ddd; margin:10px 0;' />"

// Ginger
& "<h3 style='font-family:Segoe UI, Arial, sans-serif; color:#228B22; margin-bottom:8px;'>Ginger Summary</h3>"
& Concat(
    Ginger,
    If(
        Label = "Summary",
        // Add incident header + normal label/value block
        "<div style='margin-top:20px; border-top:2px solid #228B22; padding-top:10px; font-weight:700; color:#228B22; font-size:16px;'>"
        & "<div style='font-family:Segoe UI, Arial, sans-serif; margin-bottom:12px;'>"
        & "<div style='font-weight:600; color:#333; margin-bottom:2px;'>" & Label & "</div>"
        & "<div style='color:#666; font-size:14px;'>" & Value & "</div>"
        & "</div>",
        // All other label/value pairs
        "<div style='font-family:Segoe UI, Arial, sans-serif; margin-bottom:12px;'>"
        & "<div style='font-weight:600; color:#333; margin-bottom:2px;'>" & Label & "</div>"
        & "<div style='color:#666; font-size:14px;'>" & Value & "</div>"
        & "</div>"
    )
)
& "<hr style='border:none; border-top:1px solid #ddd; margin:10px 0;' />"
)
& "</div>"
I have the same question (0)
  • WarrenBelz Profile Picture
    150,771 Most Valuable Professional on at
    HTML Text and PDF export
    I assume here that you cannot size the container to display the full HTML text render ?
    Your issue is that a HTML text control will not expand inside a container (like a Gallery additional items). You might try a Rich Text control (although that will have a header)

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Tom Macfarlan – Community Spotlight

We are honored to recognize Tom Macfarlan as our Community Spotlight for October…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 1,019 Most Valuable Professional

#2
developerAJ Profile Picture

developerAJ 436

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 281 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics