实际上你是调用IE浏览器的打印功能,而IE的打印接口是有返回值的!

解决方案 »

  1.   

    你要将报表里的0数据转成EXCEL,WORD格式的文件,然后再打印
    或着打印WEB窗体
    将数据导入EXCEL,PDF代码如下:
    SqlConnection sqlconn=new SqlConnection(_server_username_password)  
    if(sqlconn.State.ToString()!="Open")sqlconn.Open();
    DataSet set1=new DataSet();
    string selecomm="select * from xsfxph“
    SqlDataAdapter reader=new SqlDataAdapter(selecomm,sqlconn);
    reader.Fill(set1,"xsfxph");
    report111Report1 myReport=new report111Report1();
    myReport.SetDataSource(set1);
    crystalDecisions.Shared.DiskFileDestinationOptions files = new CrystalDecisions.Shared.DiskFileDestinationOptions();
    myReport.ExportOptions.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile;
    myReport.ExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.Excel;//输出文件格式选择
    files.DiskFileName = "c:\\output1.xls";
    myReport.ExportOptions.DestinationOptions = files;
    try
    {
    myReport.Export();
    }
    catch
    {}
    myReport.ExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat;;//输出文件格式选择
    files.DiskFileName = "c:\\output1.pdf";
    myReport.Export();
    if(sqlconn.State.ToString()=="Open")
    sqlconn.Close();