Forum Discussion
Export SSRS report from Power BI using SSIS
Hi
SSRS report is migrated to power BI and below code I am using. On objRSExec.LoadReport() shows error "The path of the item 'https://<serverName>/Reports/browse/RapoRSReports/ExportReport.rdl' is not valid. The full path must be less than 260 characters long; other restrictions apply. If the report server is in native mode, the path must start with slash. ---> Microsoft.ReportingServices.Diagnostics.Utilities.InvalidItemPathException: The path of the item 'https://<serverName>/Reports/browse/RapoRSReports/ExportReport.rdl' is not valid. The full path must be less than 260 characters long; other restrictions apply. If the report server is in native mode, the path must start with slash."
byte[] objResult = null;
FileStream objStream = default(FileStream);
string strFileType = "EXCEL";
string strFileExtension = ".xls";
string strFullPathName = "D:/Output/Export.xls";
Warning[] warnings = null;
string[] streamIDs = null;
objParam1.Name = "User";
objParam1.Value = "Umesh"
objParam2.Name = "Year";
objParam2.Value = 2010
objParams[0] = objParam1;
objParams[1] = objParam2;
objRSExec.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
objRSExec.Url ="https://<serverName>/ReportServer/ReportExecution2005.asmx";
objRSExec.LoadReport("https://<serverName>/Reports/browse/RapoRSReports/ExportReport.rdl", null);
objRSExec.Timeout = 200000;
objResult = objRSExec.Render(strFileType, null, out strFileExtension, out encoding, out mimeType, out warnings, out streamIDs);
objStream = File.Create(strFullPathName, objResult.Length);
objStream.Write(objResult, 0, objResult.Length);
objStream.Close();
GC.Collect();
objStream.Dispose();