求教ASP.NET下的打印 比较麻烦.如果一定要通过asp.net打印,据我所知只能按你要求的格式做成水晶报表,转为pdf文件,由用户下载后再打印. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 刚才短消息发不出,只好贴在这里了:设计水晶报表不用我说了吧?看msdn:ms-help://MS.VSCC/MS.MSDNVS.2052/crystlmn/html/crconcrystalreports.htm//下面的代码可以将报表生成PDF文件:报表名称 myrpt=new 报表名称();myrpt.ExportOptions.ExportDestinationType=CrystalDecisions.Shared.ExportDestinationType.DiskFile;myrpt.ExportOptions.ExportFormatType=CrystalDecisions.Shared.ExportFormatType.PortableDocFormat;CrystalDecisions.Shared.DiskFileDestinationOptions opt=new CrystalDecisions.Shared.DiskFileDestinationOptions();opt.DiskFileName=@"PDF文件名";myrpt.ExportOptions.DestinationOptions =opt;myrpt.Export();//下载:string destFileName=@"PDF文件名";FileInfo fi = new FileInfo(destFileName);Response.Clear();Response.ClearHeaders();Response.Buffer = false;Response.AppendHeader("Content-Disposition","attachment;filename=" + Server.UrlEncode(Path.GetFileName(destFileName)));Response.AppendHeader("Content-Length",fi.Length.ToString());Response.WriteFile(destFileName);Response.Flush();Response.End(); 网站发布IIS,图片及验证码无法显示 离奇报错?? mvc 一个view内循环多个数据集问题 DropDownList查询如何写? C#跳转页面传参数类型转换问题,新手请帮帮忙。 ■ 可笑的 C# 请问我如何用程序把一个txt里的数据,插到sqlserver数据库内? treeView 刷新的问题!!! 急哭了!!! 菜鸟上路 .net初级问题,在线等,立即给分 asp.net 为什么我的asp.net程序无法显示? 有2个SQL语句,想把这2个语句的结果绑定在一个datagrid中,应该怎样实现?
ms-help://MS.VSCC/MS.MSDNVS.2052/crystlmn/html/crconcrystalreports.htm//下面的代码可以将报表生成PDF文件:
报表名称 myrpt=new 报表名称();
myrpt.ExportOptions.ExportDestinationType=CrystalDecisions.Shared.ExportDestinationType.DiskFile;
myrpt.ExportOptions.ExportFormatType=CrystalDecisions.Shared.ExportFormatType.PortableDocFormat;
CrystalDecisions.Shared.DiskFileDestinationOptions opt=new CrystalDecisions.Shared.DiskFileDestinationOptions();
opt.DiskFileName=@"PDF文件名";
myrpt.ExportOptions.DestinationOptions =opt;
myrpt.Export();//下载:
string destFileName=@"PDF文件名";
FileInfo fi = new FileInfo(destFileName);
Response.Clear();
Response.ClearHeaders();
Response.Buffer = false;
Response.AppendHeader("Content-Disposition","attachment;filename=" + Server.UrlEncode(Path.GetFileName(destFileName)));
Response.AppendHeader("Content-Length",fi.Length.ToString());
Response.WriteFile(destFileName);
Response.Flush();
Response.End();