水晶报表导出为word,excel和pdf格式
来源:互联网 发布:mac玩的网络游戏 编辑:程序博客网 时间:2024/04/29 04:27
string filetype = "";
filetype = ddlFileType.SelectedValue;
string contenttype = "";
string myfilename = Request.MapPath(".")+"//ReportExportFile//"+Session.SessionID+"."+filetype;
CrystalDecisions.Shared.DiskFileDestinationOptions mydiskfiledestinationoptions = new CrystalDecisions.Shared.DiskFileDestinationOptions();
mydiskfiledestinationoptions.DiskFileName = myfilename;
CrystalDecisions.Shared.ExportOptions myExportOptions = myreport.ExportOptions;
myExportOptions.DestinationOptions = mydiskfiledestinationoptions;
myExportOptions.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile;
switch(ddlFileType.SelectedItem.Value)
{
case "pdf":
contenttype = "application/pdf";
myExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat;
break;
case "doc":
Response.ContentType = "application/ms-excel";
myExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.WordForWindows;
break;
case "xls":
contenttype = "application/vnd.ms-excel";
this.EnableViewState = false;
myExportOptions.ExportFormatType =CrystalDecisions.Shared.ExportFormatType.Excel;
break;
}
myreport.Export();
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = contenttype;
Response.WriteFile(myfilename);
Response.Flush();
Response.Close();
System.IO.File.Delete(myfilename);
- 水晶报表导出为word,excel和pdf格式
- 水晶报表导出为word,excel和pdf格式
- 水晶报表导出为pdf, word , excel 格式(已经测试过,实现了该功能)
- 水晶报表导出PDF or Excel
- 水晶报表导出PDF or Excel
- 水晶报表导出为word遇到问题。。
- Ireport 报表导出 Poi + ireport 导出pdf, word ,excel ,html 格式
- 关于水晶报表导出到PDF格式的一个注意事项
- 报表导出为CVS,pdf格式文件格式
- Firefox导出Excel报表为Html格式
- 限制水晶报表导出格式
- ActiveReports 报表控件 : 导出 PDF、Word 和 Excel文件到客户端
- 水晶报表导出到Excel
- 导出Word、Excel报表
- jfreechart一&二维报表导出为word&pdf&html-中文乱码和字体模糊问题(一)
- Asp.net 水晶报表之打印和导出格式
- 实战应用导出gridview到excel word pdf保留格式
- 实战应用导出gridview到excel word pdf保留格式
- Enterprise Library 2.0 -- Data Access Application Block
- 面试问题之 按单词反转字符串
- Enterprise Library 2.0 -- Logging Application Block
- 用javascript实现(页面正在加载的效果)
- Enterprise Library 2.0 -- Cryptography Application Block
- 水晶报表导出为word,excel和pdf格式
- Enterprise Library 2.0 -- Caching Application Block
- Ajax简单客户登陆验证
- 一寸河山一寸血
- C# 实现农历计算和转换
- linux+jboss4.0.3SP1配置
- RMI的几点补充
- 我的SQL在哪里--SQL跟踪工具P6Spy介绍(s00n原作)
- 早上出门时最怕什么?