Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Matthias_Tri001
New Member

Power BI Desktop: "Export to PDF" ist not wating for IVisualEventService.renderingFinished()

Hi,

I'm developing a custom visual that takes a few seconds for asynchronous rendering, so I'm calling the
IVisualEventService methods (see https://docs.microsoft.com/de-de/power-bi/developer/visuals/event-service)

- renderingStarted(options: VisualUpdateOptions) > synchronously in the update method)
- renderingFinished(options: VisualUpdateOptions) > at the end of the asynchronous rendering method
- renderingFailed(options: VisualUpdateOptions) > at the end of the asynchronous error handler callback

However, Power BI Desktop is not wating for the call
to renderingFinished() when it loops over the report's pages on "Export to PDF",
therefore the screenshot of my visual in the PDF document is incomplete. My custom visual is not yet certified.

My questions: Is this the known (and desired) behaviour of Power BI Desktop for uncertified custom visual?
Does Power BI Desktop waits for renderingFinished() on "Export to PDF" for certified visuals?
Or am I doing something wrong?

 

Best regards,
Matthias

2 REPLIES 2
mroot
Frequent Visitor

@Matthias_Tri001 - 

I am running into the same issue. Did you ever get this working as the documentation suggests? If so, what did you do?

Render events in Power BI visuals - Power BI | Microsoft Learn

 

Thanks,

Matt

mroot
Frequent Visitor

Hey Everyone!

I was wondering if anyone was able to get the Rendering Events API to work with their Power BI Custom Visual. The documentation seems super straight forward and I have a pretty simple use case- I have a custom visual that takes a few seconds for asynchronous rendering to complete and after it finishes I call the renderingFinished method. My source code looks something like below. The weird thing is when I compile the visual and test in Power BI Desktop the "Export to PDF" does not wait for the "renderingFinished()" call, thus the pdf snapshot does not include my asynchronous rendering. Is there anything I am missing?
Thanks for the help!

-Matt

public async update (options: VisualUpdateOptions) {
    // tell export to PDF rendering has started...
    this.events.renderingStarted(options);
    
    // this takes a few seconds to complete
    makeAsyncRenderCalls().then(() => {
            // rendering is finished tell export to PDF that my rendering is done...
            this.events.renderingFinished(options);
    });

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.