Ejemplo n.º 1
0
 public void Print(RecordSet data, string fileName)
 {
     IReportGen gen = new TecITGener();
     this.filePath = this.folderPath+"/"+fileName;
     this.taskConfig.Printer += filePath;
     gen.Print(data, this.taskConfig);
 }
Ejemplo n.º 2
0
 public void Print(RecordSet data,string printer_name=null,string copy=null)
 {
     IReportGen gen = new TecITGener();
     ReportGenConfig config = new ReportGenConfig()
     {
         Printer = string.IsNullOrEmpty(printer_name) ? this.Name : printer_name,
         NumberOfCopies = string.IsNullOrEmpty(copy) ? this.Copy : int.Parse(copy),
         PrinterType = (PrinterType)this.Type,
         Template = this.TemplatePath
     };
     gen.Print(data, config);
 }
Ejemplo n.º 3
0
 public ReturnMsg<string> Print(RecordSet data, ReportGenConfig printerConfig)
 {
     ReturnMsg<string> msg = new ReturnMsg<string>() { result = false };
     try
     {
         IReportGen gen = new TecITGener();
         gen.Print(data, printerConfig);
         msg.result = true;
         msg.content = "打印成功";
         msg.level = MsgLevel.Successful;
     }
     catch (Exception e) {
         msg.content = e.Message;
         msg.level = MsgLevel.Mistake;
     }
     return msg;
 }
Ejemplo n.º 4
0
 public ProcessMsg Print(Hashtable printConfig, PrintDataMessage pmsg)
 {
     ProcessMsg msg = new ProcessMsg();
     try
     {
         IReportGen gen = new TecITGener();
         foreach (PrintTask task in pmsg.PrintTask)
         {
             task.Config.Printer = printConfig["PrinterName"].ToString();
             task.Config.NumberOfCopies = int.Parse(printConfig["Copy"].ToString());
             task.Config.Template = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, printConfig["Template"].ToString());
             gen.Print(task.DataSet, task.Config);
         }
         msg.result = true;
         msg.AddMessage(ReturnCode.OK, "打印成功!");
     }
     catch (Exception e)
     {
         msg.result = false;
         msg.AddMessage(ReturnCode.Fail, "打印错误:" + e.Message);
     }
     return msg;
 }