At the moment i am using VSTO to take a SQL Reporting Services report and display it in Excel 2003 using the ReportViewer control. So bascially on a winform hosted inside Excel.
目前,我正在使用VSTO获取SQL Reporting Services报告,并使用ReportViewer控件在Excel 2003中显示它。因此,最重要的是在Excel中托管的winform。
But i also need to be able to display it without the ReportViewer control i.e. just straight into the cells of my Excel sheet.
但我还需要能够在没有ReportViewer控件的情况下显示它,即直接进入Excel工作表的单元格。
I'm wonder how I should go about this.
我想知道我应该怎么做。
I can retreive the report in CSV format. So should I just loop through the cvs formatted report and insert directly into my Excel sheet one row after another or is there a better way?
我可以用CSV格式检索报告。那么我应该循环遍历cvs格式的报告并直接插入我的Excel表格中,或者有更好的方法吗?
3 个解决方案
#1
You might want to look at what I did trying to print a RS report without user input. It uses RS's web services endpoint to deliver the report into the application. The only difference is that instead of using an IMAGE format, you'd use an EXCEL format on the render call.
您可能想看看我在没有用户输入的情况下尝试打印RS报告时所做的事情。它使用RS的Web服务端点将报告传送到应用程序中。唯一的区别是,您不是使用IMAGE格式,而是在渲染调用中使用EXCEL格式。
#2
Viewing the Reporting Services reports in a web browser has an Export option right at the top of the report. Excel is one of those options. It even exports the formatting. Note that this is for SSRS 2005 - I do not know if anything changed in SSRS 2008.
在Web浏览器中查看Reporting Services报告,在报告顶部有一个“导出”选项。 Excel是其中一个选项。它甚至导出格式。请注意,这是针对SSRS 2005的 - 我不知道SSRS 2008中是否有任何变化。
#3
Can you not just dump the data directly into Excel using CopyFromRecordset
?
你能不能只使用CopyFromRecordset将数据直接转储到Excel中?
#1
You might want to look at what I did trying to print a RS report without user input. It uses RS's web services endpoint to deliver the report into the application. The only difference is that instead of using an IMAGE format, you'd use an EXCEL format on the render call.
您可能想看看我在没有用户输入的情况下尝试打印RS报告时所做的事情。它使用RS的Web服务端点将报告传送到应用程序中。唯一的区别是,您不是使用IMAGE格式,而是在渲染调用中使用EXCEL格式。
#2
Viewing the Reporting Services reports in a web browser has an Export option right at the top of the report. Excel is one of those options. It even exports the formatting. Note that this is for SSRS 2005 - I do not know if anything changed in SSRS 2008.
在Web浏览器中查看Reporting Services报告,在报告顶部有一个“导出”选项。 Excel是其中一个选项。它甚至导出格式。请注意,这是针对SSRS 2005的 - 我不知道SSRS 2008中是否有任何变化。
#3
Can you not just dump the data directly into Excel using CopyFromRecordset
?
你能不能只使用CopyFromRecordset将数据直接转储到Excel中?