vs2005的水晶报表如何使用??
怎么实现用代码控制水晶报表的显示等等功能,而不是拖个控件,来通过向导绑定。
还有个问题是,怎么将水晶报表导出到word格式的文件,通过方法实现。谢谢。
添加水晶报表的过程最好详细点,多谢谢!!!
------解决方案--------------------Asp.net2.0水晶报表(CrystalReports)实例源码大全(C#)
http://www.51aspx.com/CV/CrystalReports/
------解决方案--------------------http://www.huij.net/html/Net_jishu/tubiaoqu/19990722/20161.html
------解决方案--------------------参考下VS2003中使用水晶报表
http://blog.csdn.net/zhulei2008/archive/2007/03/15/1530112.aspx
------解决方案--------------------怎么实现用代码控制水晶报表的显示等等功能,而不是拖个控件,来通过向导绑定。
不是很明白你的需求,CrystalReportViewer是一定要的,不然水晶報表是不會顯示出來的,顯示與否跟控件沒有關系,卻跟控件屬性有關,CrystalReportViewer不綁定水晶報表的時候,水晶報表就不顯示出來,這是代碼可以做到的。就是設置CrystalReportViewer的ReportSource屬性
怎么将水晶报表导出到word格式的文件
水晶報表工具欄有導出按鈕,你可以導出成各種格式,如果想用代碼控制,可以這樣寫代碼:
private ReportDocument hierarchicalGroupingReport;
private string exportPath;
private DiskFileDestinationOptions diskFileDestinationOptions;
private ExportOptions exportOptions;
hierarchicalGroupingReport = new ReportDocument();
hierarchicalGroupingReport.Load(@ "C:\Test.rpt ");
crystalReportViewer.ReportSource = hierarchicalGroupingReport;
exportPath = Server.MapPath( "./ ");
diskFileDestinationOptions = new DiskFileDestinationOptions();
exportOptions = hierarchicalGroupingReport.ExportOptions;
exportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
exportOptions.FormatOptions = null;
exportOptions.ExportFormatType = ExportFormatType.WordForWindows;
diskFileDestinationOptions.DiskFileName = exportPath + "Word.doc ";
exportOptions.DestinationOptions = diskFileDestinationOptions;
------解决方案--------------------private ReportDocument hierarchicalGroupingReport;
private string exportPath;
private DiskFileDestinationOptions diskFileDestinationOptions;
private ExportOptions exportOptions;
hierarchicalGroupingReport = new ReportDocument();
hierarchicalGroupingReport.Load(@ "C:\Test.rpt ");
crystalReportViewer.ReportSource = hierarchicalGroupingReport;
exportPath = Server.MapPath( "./ ");
diskFileDestinationOptions = new DiskFileDestinationOptions();
exportOptions = hierarchicalGroupingReport.ExportOptions;
exportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
exportOptions.FormatOptions = null;
exportOptions.ExportFormatType = ExportFormatType.WordForWindows;
diskFileDestinationOptions.DiskFileName = exportPath + "Word.doc ";
exportOptions.DestinationOptions = diskFileDestinationOptions;
学习