gbrueckl / PowerBI.API.Client

A C# wrapper for the Power BI REST API which allows you to easily integrate the Power BI API into your C# application.
MIT License
39 stars 14 forks source link

Need help in Export report #18

Open phaniraj-t opened 4 years ago

phaniraj-t commented 4 years ago

After getting the Token I am calling the below Method private static void Test_Export(PBIAPIClient pbic) { PBIGroup myGroup = pbic; // "My Workspace"
PBIReport report = myGroup.GetReportByID("a0a9f709-dc56-496e-a409-639b100bc2ab"); report.Export("C:\Sample\MyReport.pdf"); } I am getting the below error in in GetReportByID Please find the attachment of the error. Please help me to move to next step.

ErrorWhileExport

TerjeSolem commented 4 years ago

I haven't tested groups yet, but I'm getting this too. Its poor handling of exception, at least was for the PBIAPIClient.SendApIRequest(). Should be another underlying error.. Sorry if that doesn't help you, but I have not tested groups yet.

gbrueckl commented 4 years ago

As described in https://azure.microsoft.com/en-us/updates/power-bi-support-for-transportlayer-security/ please add System.Net.ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; to the very beginning of your code

the Export-API also does not support exporting as .pdf but downloads a .pbix file