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); }
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(); } }
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); }
protected virtual DataSet GetReportDataSource(TempletPrint templetPrint) { if (!string.IsNullOrEmpty(templetPrint.Sql)) { return templetPrint.GetReportDataSource(true, this.DataFormConntroller.SqlParams); } return this.dataFormController.DataSource; }
protected virtual bool PrintBySelf(TempletPrint templetPrint) { return false; }
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); } }
private void PrintXSLT(TempletPrint templetPrint, bool reBuild) { LoggingService.DebugFormatted("将输出XSLT报表:{0}", new object[] { templetPrint.Name }); PrintHelper.PrintXLST(this.DataFormConntroller.DataSource, templetPrint.Data); }
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); }
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); }
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(); } }