当前位置: 首页>>代码示例>>C#>>正文


C# StiReport.LoadPackedDocument方法代码示例

本文整理汇总了C#中StiReport.LoadPackedDocument方法的典型用法代码示例。如果您正苦于以下问题:C# StiReport.LoadPackedDocument方法的具体用法?C# StiReport.LoadPackedDocument怎么用?C# StiReport.LoadPackedDocument使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StiReport的用法示例。


在下文中一共展示了StiReport.LoadPackedDocument方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Generate


//.........这里部分代码省略.........
             report2.Dispose();
         }
         report = new NoticeReport(renderedNotices);
         this.m_GeneratedReport = report;
     }
     if ((this.m_ThreadExceptions.Count > 0) || this.m_IsCancelled)
     {
         ex = null;
         this.m_ThreadExceptions.TryDequeue(out ex);
         this.AbortOperation(asyncOp, ex, (System.TimeSpan) (System.DateTime.Now - now));
     }
     else
     {
         if ((this.m_NoticeCache.get_Count() > 0) && (this.m_Exporter != null))
         {
             logger.Info("Экспорт по домам управляющих компаний");
             int num9 = (int) ((this.m_Exporter.MaxPageCount * this.m_Template.AccountsInTemplate) / this.m_Template.PageCount);
             CachedNoticeInfoComparer comparer = new CachedNoticeInfoComparer();
             try
             {
                 foreach (string str in this.m_NoticeCache.Keys)
                 {
                     this.m_NoticeCache[str].Sort(comparer);
                     logger.Info("Экспорт домов УК " + str);
                     for (int n = 0; n < this.m_NoticeCache[str].get_Count(); n = (int) (n + num9))
                     {
                         System.Text.StringBuilder builder = new System.Text.StringBuilder();
                         int num11 = this.m_NoticeCache[str].get_Count();
                         if (num11 != 0)
                         {
                             int maxPageCount = this.m_Exporter.MaxPageCount;
                             int num13 = (int) (num11 - (n + maxPageCount));
                             num13 = (num13 < 1) ? ((int) 0) : num13;
                             using (StiReport report3 = new StiReport())
                             {
                                 report3.IsRendered = true;
                                 report3.NeedsCompiling = false;
                                 report3.RenderedPages.Clear();
                                 System.IO.DirectoryInfo info = new System.IO.DirectoryInfo(System.IO.Path.Combine(this.m_Exporter.DestinationPath, str));
                                 if (!info.get_Exists())
                                 {
                                     info.Create();
                                 }
                                 string file = System.IO.Path.Combine(info.get_FullName(), string.Format("{0}_{1}.pdf", str, n / num9));
                                 for (int num14 = n; num14 < (num11 - num13); num14 = (int) (num14 + 1))
                                 {
                                     System.IO.FileInfo info2 = new System.IO.FileInfo(this.m_NoticeCache[str].get_Item(num14).CacheFilePath);
                                     if (info2.get_Exists())
                                     {
                                         byte[] bytes = System.IO.File.ReadAllBytes(info2.get_FullName());
                                         StiReport report4 = new StiReport();
                                         report4.LoadPackedDocument(bytes);
                                         report4.ReportUnit = report3.ReportUnit;
                                         foreach (StiPage page in report4.RenderedPages)
                                         {
                                             page.Report = report3;
                                             page.Guid = System.Guid.NewGuid().ToString().Replace("-", "");
                                             report3.RenderedPages.Add(page);
                                         }
                                         if (this.m_Exporter.DualPageExportMode && ((report4.RenderedPages.get_Count() % 2) != 0))
                                         {
                                             StiPage page2 = new StiPage(report3) {
                                                 IsRendered = true,
                                                 Orientation = report4.RenderedPages[0].Orientation,
                                                 Guid = System.Guid.NewGuid().ToString().Replace("-", "")
                                             };
                                             report3.RenderedPages.Add(page2);
                                         }
                                         builder.AppendLine(this.m_NoticeCache[str].get_Item(num14).FullAddress);
                                     }
                                 }
                                 report3.ExportDocument(StiExportFormat.Pdf, file);
                                 System.IO.File.WriteAllText(file + ".txt", builder.ToString());
                             }
                         }
                     }
                 }
                 logger.Info("Очистка дискового кэша");
                 System.IO.Directory.Delete(System.IO.Path.Combine(this.m_Exporter.DestinationPath, this.m_ExportCacheDirectoryName), true);
             }
             catch (System.Exception exception19)
             {
                 ex = new NoticeGenerationException("Ошибка при экспорте извещений, сгруппированных по УК", exception19);
                 this.AbortOperation(asyncOp, ex, (System.TimeSpan) (System.DateTime.Now - now));
                 return;
             }
         }
         System.TimeSpan timeSpent = (System.TimeSpan) (System.DateTime.Now - now);
         logger.Info("Операция успешно завершена. Время выполнения " + timeSpent.ToString());
         logger.Info("Всего отрендерено: " + ((int) this.m_TotalRendered));
         if (asyncOp != null)
         {
             GenerationCompletedEventArgs args = new GenerationCompletedEventArgs(timeSpent, null, false, asyncOp.get_UserSuppliedState()) {
                 GeneratedReport = report
             };
             asyncOp.PostOperationCompleted(this.onCompletedDelegate, args);
         }
         this.Reset();
     }
 }
开发者ID:u4097,项目名称:SQLScript,代码行数:101,代码来源:NoticeReportGenerator.cs

示例2: ToStiReport

 public StiReport ToStiReport()
 {
     if (this.m_StiReport != null)
     {
         return this.m_StiReport;
     }
     if (this.RenderedNotices.get_Count() == 1)
     {
         StiReport report = new StiReport();
         if (this.RenderedNotices.get_Item(0).HasResult)
         {
             report.LoadPackedDocument(this.RenderedNotices.get_Item(0).PacketReport);
         }
         this.m_StiReport = report;
         return report;
     }
     StiReport report2 = new StiReport {
         IsRendered = true,
         NeedsCompiling = false
     };
     report2.RenderedPages.Clear();
     foreach (NoticeRenderedNotice notice in this.RenderedNotices)
     {
         if (notice.HasResult)
         {
             StiReport report3 = new StiReport();
             report3.LoadPackedDocument(notice.PacketReport);
             report3.ReportUnit = report2.ReportUnit;
             foreach (StiPage page in report3.RenderedPages)
             {
                 page.Report = report2;
                 page.Guid = System.Guid.NewGuid().ToString().Replace("-", "");
                 report2.RenderedPages.Add(page);
             }
         }
     }
     this.m_StiReport = report2;
     return report2;
 }
开发者ID:u4097,项目名称:SQLScript,代码行数:39,代码来源:NoticeReport.cs


注:本文中的StiReport.LoadPackedDocument方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。