Hi, I am trying to run crm report in a console application, but it gave me this error "Additional information: One or more data source credentials required to run the report have not been specified." where should I specify the credentials, is not the default credential?
static void Main(string[] args) { ReportingService2005 rs = new ReportingService2005(); ReportExecutionService res = new ReportExecutionService(); rs.Credentials = System.Net.CredentialCache.DefaultCredentials; res.Credentials = System.Net.CredentialCache.DefaultCredentials; string historyID = null; string deviceInfo = null; string format = "EXCEL"; Byte[] results; string encoding = String.Empty; string mimeType = String.Empty; string extension = String.Empty; SsrsExecution.Warning[] warnings = null; string[] streamIDs = null; string fileName = @"c:\samplereport.xls"; string _reportName = @"dev/CustomReports/457a0e9b-970e-e811-a81d-005056b5fefa"; string _historyID = null; bool _forRendering = false; SsrsReportService.ParameterValue[] _values = null; SsrsReportService.DataSourceCredentials[] _credentials = null; SsrsReportService.ReportParameter[] _parameters = null; try { _parameters = rs.GetReportParameters(_reportName, _historyID, _forRendering, _values, _credentials); SsrsExecution.ExecutionInfo ei = res.LoadReport(_reportName, historyID); SsrsExecution.ParameterValue[] parameters = new SsrsExecution.ParameterValue[1]; if (_parameters.Length > 0) { parameters[0] = new SsrsExecution.ParameterValue(); parameters[0].Label = "InvoiceID"; parameters[0].Name = "InvoiceID"; parameters[0].Value = "66D3BC7B-0926-E811-A81D-005056B5FEFA"; } res.SetExecutionParameters(parameters, "en-us"); results = res.Render(format, deviceInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs); using (FileStream stream = File.OpenWrite(fileName)) { stream.Write(results, 0, results.Length); } } catch (Exception ex) { throw ex; } }
*This post is locked for comments