예제 #1
0
 protected virtual void PrintWordEx(TempletPrint templetPrint, string targetFile, bool reBuild)
 {
     LoggingService.DebugFormatted("将输出打印新WORD报表:{0}至:{1}", new object[] { templetPrint.Name, targetFile });
     PrintHelper.PrintWordEx(targetFile, ZipHelper.GZCompress(templetPrint.Data), this.GetReportDataSource(templetPrint), true, new SkyMap.Net.Util.PrintBySelf(this.PrintBySelf), new SkyMap.Net.Util.FormatColumnValue(this.FormatColumnValue), !templetPrint.PrintPreview);
 }
예제 #2
0
 protected void PrintRDLC(TempletPrint templetPrint, bool reBuild)
 {
     WaitDialogHelper.Show();
     try
     {
         if ((templetPrint.Data != null) && (templetPrint.Data.Length > 0))
         {
             DataSet reportDataSource = this.GetReportDataSource(templetPrint);
             PrintHelper.PrintOrShowRDLC(templetPrint.Name, templetPrint.PrintPreview, templetPrint.Data, reportDataSource, null, null, new Action<ReportViewDialog>(this.CustomReportViewDialog));
         }
     }
     finally
     {
         WaitDialogHelper.Close();
     }
 }
예제 #3
0
 protected virtual void PrintWord(TempletPrint templetPrint, bool reBuild)
 {
     LoggingService.DebugFormatted("将输出打印WORD报表:{0}", new object[] { templetPrint.Name });
     PrintHelper.PrintWord(templetPrint.Data, this.GetReportDataSource(templetPrint), true, new SkyMap.Net.Util.PrintBySelf(this.PrintBySelf), new SkyMap.Net.Util.FormatColumnValue(this.FormatColumnValue), !templetPrint.PrintPreview);
 }
예제 #4
0
 protected virtual DataSet GetReportDataSource(TempletPrint templetPrint)
 {
     if (!string.IsNullOrEmpty(templetPrint.Sql))
     {
         return templetPrint.GetReportDataSource(true, this.DataFormConntroller.SqlParams);
     }
     return this.dataFormController.DataSource;
 }
예제 #5
0
 protected virtual bool PrintBySelf(TempletPrint templetPrint)
 {
     return false;
 }
예제 #6
0
 public virtual void Print(TempletPrint templetPrint, bool reBuild)
 {
     string str;
     DataSet set;
     if (!this.PrintBySelf(templetPrint))
     {
         str = templetPrint.Type.ToLower();
         string str2 = str;
         if (str2 == null)
         {
             goto Label_0083;
         }
         if (!(str2 == ".doc"))
         {
             if (str2 == ".xslt")
             {
                 this.PrintXSLT(templetPrint, reBuild);
                 return;
             }
             if (str2 == ".rdlc")
             {
                 this.PrintRDLC(templetPrint, reBuild);
                 return;
             }
             if (str2 == ".wzx")
             {
                 this.PrintWordEx(templetPrint, reBuild);
                 return;
             }
             goto Label_0083;
         }
         this.PrintWord(templetPrint, reBuild);
     }
     return;
     Label_0083:
     set = this.GetReportDataSource(templetPrint);
     if (!PrintHelper.PrintByReportVistor(templetPrint.Type, set, templetPrint.Data, this))
     {
         throw new NotImplementedException("没有实现的报表打印方式:" + str);
     }
 }
예제 #7
0
 private void PrintXSLT(TempletPrint templetPrint, bool reBuild)
 {
     LoggingService.DebugFormatted("将输出XSLT报表:{0}", new object[] { templetPrint.Name });
     PrintHelper.PrintXLST(this.DataFormConntroller.DataSource, templetPrint.Data);
 }
예제 #8
0
 protected virtual DataSet GetReportDataSource(TempletPrint templetPrint)
 {
     Dictionary<string, string> vals = new Dictionary<string, string>();
     vals.Add("{ProjectId}", this.project_id);
     return templetPrint.GetReportDataSource(false, vals);
 }
예제 #9
0
 protected virtual DataSet GetReportDataSource(TempletPrint templetPrint, string projectId)
 {
     Dictionary<string, string> vals = new Dictionary<string, string>();
     vals.Add("{ProjectId}", projectId);
     return templetPrint.GetReportDataSource(true, vals);
 }
예제 #10
0
 protected void PrintRDLC(TempletPrint templetPrint, string projectId)
 {
     WaitDialogHelper.Show();
     try
     {
         if ((templetPrint.Data != null) && (templetPrint.Data.Length > 0))
         {
             DataSet reportDataSource = new DataSet();
             if (!string.IsNullOrEmpty(templetPrint.Sql))
             {
                 reportDataSource = this.GetReportDataSource(templetPrint, projectId);
             }
             using (MemoryStream stream = new MemoryStream(templetPrint.Data))
             {
                 Dictionary<string, object> dictionary = new Dictionary<string, object>();
                 foreach (DataTable table in reportDataSource.Tables)
                 {
                     dictionary.Add(table.TableName, table);
                 }
                 if (templetPrint.PrintPreview)
                 {
                     PrintHelper.ShowRDLC(templetPrint.Name, stream, dictionary, null);
                 }
                 else
                 {
                     string text = PrintHelper.PrintRDLC(null, null, stream, dictionary);
                     if (text != null)
                     {
                         MessageHelper.ShowInfo(text);
                     }
                 }
             }
         }
     }
     finally
     {
         WaitDialogHelper.Close();
     }
 }