cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Re: Power BI Export to file Error

In the main application, the C# simply won't move past that line - do not know why. Nothing I do will work to move it past there.

Highlighted
Frequent Visitor

Re: Power BI Export to file Error

I am stuck in the same spot as well.  The error I am getting is that the pageName is not declared

 

Pages = pageNames?.Select(pn => new ExportReportPage(pageName = pn)).ToList(),

 

does anyone know what pageName is supposed to be declared?

Highlighted
Regular Visitor

Re: Power BI Export to file Error

Good news:
If you don't specify the pages there, it'll print the full report every time.

It also seems to default to "en-us" as the locale if you don't specify.

It actually needs very minimal configuration

Just giving it a format in the export request is enough for the configto be done and complete.

Highlighted
Frequent Visitor

Re: Power BI Export to file Error

can you provide a code snippet of this part so that I can see?

 

var powerBIReportExportConfiguration = new PowerBIReportExportConfiguration
{
Settings = new ExportReportSettings
{
Locale = "en-us",
},

Pages = pageNames?.Select(pn => new ExportReportPage(pageName = pn.ToString())).ToList(),

};
var exportRequest = new ExportReportRequest
{
Format = fileFormat,
PowerBIReportConfiguration = powerBIReportExportConfiguration,
};

Highlighted
Regular Visitor

Re: Power BI Export to file Error

var fileFormat = FileFormat.PDF
var exportRequest = new ExportReportRequest
{
Format = fileFormat
};

 

here you go. this should work

Highlighted
Frequent Visitor

Re: Power BI Export to file Error

So I figure out my issue.  I was trying to export as .PNG.  When I did .PDF it works just fine.  Apparently there is a setting that need to be set in the admin portal for .PNG but I can't find it.  Does anyone have any luck enabling .PNG?

Helpful resources

Announcements
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Don't miss the Power BI Dev Camp this week!

August Community Highlights

Check out a full recap of the month!

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.