crystal9.2直接支持客户端导出和打印,安装crystal9.2后会自动取代vs.net本身带的crystal

解决方案 »

  1.   

    你可以生成Excel和pdf文件然后打印
      

  2.   

    我前些天刚做过,
    你可以把文件导出在服务端,然后下载到本地再打开
    然后打印,你可以转换成pdf格式
      

  3.   

    to acewang(**^o^**) :
    如果你用到excel的模板,可是asp又不允许你在客户端复制文件,怎么办?
      

  4.   

    参考代码:
    .....
    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);
    ...
      

  5.   

    Dim myexportoptions As CrystalDecisions.Shared.ExportOptions
            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()
    刚生成的