不清楚你用的是哪一版。但就我研究,2014v3与2015v1在这一块的运作机制上是有差别的。
在这个案例中,C:\Users\****\Documents\ComponentOne Samples\Studio for WinForms\C1Report\C1Preview\CS\SsrsViewer
需要修改代码才能看到这个报错。
在运行Generate()这个方法是,会有TimeOut的报错。
2014V3
MainForm.cs文件约209行位置
- c1SsrsDocumentSource1.DocumentLocation = new SSRSReportLocation(tbSSRSServer.Text, ci.Path);
- c1SsrsDocumentSource1.Credential = GetCredential();
- c1SsrsDocumentSource1.Open();
- c1SsrsDocumentSource1.Parameters[0].Value = DateTime.Parse("2014-01-01");
- c1SsrsDocumentSource1.Parameters[1].Value = DateTime.Parse("2015-01-01");
- c1SsrsDocumentSource1.ApplyParameterValues();
- c1SsrsDocumentSource1.Generate();
- c1PrintPreviewControl1.Document = null;
- c1PrintPreviewControl1.Document = c1SsrsDocumentSource1;
复制代码
2015V1
MainForm.cs文件约256行位置
- c1SsrsDocumentSource1.Credential = _credential;
- //c1SsrsDocumentSource1.DocumentLocation = new SSRSReportLocation(_reportServer, ci.Path);
- SSRSReportLocation rl = new SSRSReportLocation(_reportServer, ci.Path);
- c1SsrsDocumentSource1.Open(rl);
- c1SsrsDocumentSource1.Parameters[0].Value = DateTime.Parse("2014-01-01");
- c1SsrsDocumentSource1.Parameters[1].Value = DateTime.Parse("2015-01-01");
- c1SsrsDocumentSource1.ApplyParameterValues();
- c1SsrsDocumentSource1.Generate();
- c1PrintPreviewControl1.Document = c1SsrsDocumentSource1;
复制代码 |