crystal9.2直接支持客户端导出和打印,安装crystal9.2后会自动取代vs.net本身带的crystal
解决方案 »
- .ashx文件的问题(见下面的注释);还有机器里装的CSDN如何使用(比如虚拟路径是VirtualPathUtility,那我怎么知道是这个呢)
- C#.net 项目可以让局域网的人访问吗?
- datalist中有一列放了textbox控件,如何在不按回车的情况下触发事件?急,谢谢
- 求源码
- 下拉列表 DropDownList 同时显示静态和动态数据
- js里ShowModalDialog传数组参数,后台能否取到?
- web.config 中设置了<identity impersonate="true"> 系统会拒绝访问???????
- 如何在HtmlTableCell控件里面加背景图片呀,50分求解
- C# 取得查询数据总条数问题。
- #是什么用的?
- 非常急!DataGrid 中怎么现实图片??
- 问一个数组的问题和问一个代码共享的问题
你可以把文件导出在服务端,然后下载到本地再打开
然后打印,你可以转换成pdf格式
如果你用到excel的模板,可是asp又不允许你在客户端复制文件,怎么办?
.....
rpt_abc rt = Bind();
ExportOptions exportOpts = new ExportOptions();
DiskFileDestinationOptions diskops = new DiskFileDestinationOptions();
exportOpts = rt.ExportOptions ;
exportOpts.ExportDestinationType=ExportDestinationType.DiskFile;
exportOpts.ExportFormatType=ExportFormatType.PortableDocFormat;
string strFolder ="C:\\temp";
createFolder(strFolder);
string fileName ="temp.pdf"; string path =Path.Combine (@strFolder,fileName);
diskops.DiskFileName =path;
exportOpts.DestinationOptions=diskops; exportOpts.ExportDestinationType=ExportDestinationType.DiskFile;
exportOpts.ExportFormatType=ExportFormatType.PortableDocFormat;
rt.Export();
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType="application/pdf";
Response.WriteFile(path);
Response.Flush();
Response.Close();
System.IO.File.Delete(path);
...
Dim mydiskfiledestinationoptions As New CrystalDecisions.Shared.DiskFileDestinationOptions()
Dim myexportfile As String = Server.MapPath(".") & "\temp\jcb.dbf"
mydiskfiledestinationoptions.DiskFileName = myexportfile
myexportoptions = jcb_report.ExportOptions
With myexportoptions
.DestinationOptions = mydiskfiledestinationoptions
.ExportDestinationType = .ExportDestinationType.DiskFile
.ExportFormatType = .ExportFormatType.PortableDocFormat
End With
jcb_report.Export()
'Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312")
HttpContext.Current.Response.Charset = ""
HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.UTF8
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile(myexportfile)
Response.Flush()
Response.Close()
刚生成的