Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I am setting up an apps own data embedded export to pdf using ExportToFileInGroup and then polling to see if the file is available and of course download the file.
However, I noticed when stepping through the code when I run the above steps (it doesn't appear to be consistent but always happens between the above 2) my embedded report resets. What I mean by that is I navigate to the embedded report, select the one I want, hit Export to PDF and then the report goes away to default from when i arrive at our site. Sometimes it exports and sometimes it doesn't.
I can't seem to find any error messages when it does this. I've turned on try and catch but no error messages.
var powerBIReportExportConfiguration = new PowerBIReportExportConfiguration
{
Identities = new List<EffectiveIdentity>
{
new EffectiveIdentity
{
Username = userName.ToString(),
Roles =new List<string> { "RLS" },
Datasets = new List<string> { DATSETID }
}
},
Settings = new ExportReportSettings
{
Locale = "en-us"
},
};
var exportRequest = new ExportReportRequest
{
Format = format,
PowerBIReportConfiguration = powerBIReportExportConfiguration
};
if (ExportFilter != "")
{
exportRequest.PowerBIReportConfiguration.ReportLevelFilters =
new List<ExportFilter>() {
new ExportFilter { Filter = ExportFilter }
};
}
try
{
var export = client.Reports.ExportToFileInGroup(groupId, reportId, exportRequest);
string exportId = export.Id.ToString();
Solved! Go to Solution.
Resolved it... the issue was in the javascript code that called the c# code. I removed this at the end: location.reload();.
Hi @Clampazzo ,
Can you please share some more detail information about this issue? They should help us clarify your scenario and test to troubleshoot.
How to Get Your Question Answered Quickly
In addition, any reload/refresh events are you triggered? They may reset the stored variables and effect the export function usages.
Regards,
Xiaoxin Sheng
Let me know if this helps.
I load my report in embedded so it can be seen IE below
Then I click on my new "Export to PDF" Button which executes the code above. When it gets to the step(s)
ExportToFileInGroup
or
GetExportToFileStatusInGroup
the embedded report 'resets' and basically goes back to what it looks like before I select a report.
The export works but if I wanted to continue working int hat report I'd have to load it again.
Resolved it... the issue was in the javascript code that called the c# code. I removed this at the end: location.reload();.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
2 | |
1 | |
1 | |
1 |
User | Count |
---|---|
24 | |
3 | |
2 | |
2 | |
2 |