自己些的asp.net导成pdf的程序
没时间写注释了 总之很简单////修改打印程序:将报表导出为pdf文件 以方便在客户端打印   修改人:郑伟 2004-10-27
rd.ExportOptions.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile;
//导出成pdf的格式。
rd.ExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat;
DiskFileDestinationOptions opt = new DiskFileDestinationOptions();
//导出成pdf的文件名。
opt.DiskFileName =Request.ServerVariables["APPL_PHYSICAL_PATH"]+"c.pdf";
rd.ExportOptions.DestinationOptions = opt;
rd.Export();
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/pdf";
Response.WriteFile(opt.DiskFileName);
Response.Flush();
Response.Close();
System.IO.File.Delete(opt.DiskFileName);

解决方案 »

  1.   

    yourreport oCR4= new youreport();//你的报表文件实例化
    CrystalDecisions.Shared.DiskFileDestinationOptions diskopts4 = new CrystalDecisions.Shared.DiskFileDestinationOptions();
    oCR4.ExportOptions.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile;
    oCR4.ExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat;
    diskopts4.DiskFileName = "c:\\reporttype4.pdf";//导出的位置和文件名
    oCR4.ExportOptions.DestinationOptions = diskopts4;
    oCR4.Export();
      

  2.   

    如果用9.2或更高的版本的企业版就可以有直接的导出成pdf的方式