示例#1
0
 private void AccountServicesNotificationReport(AccountReportType accountReportType)
 {
     Account currentAccount = this.CurrentAccount;
     if (currentAccount.Id != Account.Null.Id)
     {
         System.DateTime date = System.DateTime.Now.Date;
         System.Data.DataSet set = Mappers.SimpleReportMapper.GetAccountServicesNotification(currentAccount.Id, date, 0L, 0L);
         if (((set != null) && (set.Tables.get_Count() == 2)) && (set.Tables.get_Item(0).Rows.get_Count() != 0))
         {
             set.Tables.get_Item(0).set_TableName("dataHeader");
             set.Tables.get_Item(1).set_TableName("dataServices");
             StiReport report = new StiReport();
             if (accountReportType.Template.get_Length() > 0)
             {
                 report.LoadFromString(accountReportType.Template);
             }
             report.Compile();
             report.RegData((System.Data.DataSet) set);
             report.Render(true);
             if (accountReportType.Name == "Уведомление для Грозного, без долга")
             {
                 StimulsoftUtilsOptions options = new StimulsoftUtilsOptions(false);
                 report.Show((System.Windows.Forms.IWin32Window) this.ContentControl);
                 options.RestoreValues();
             }
             else
             {
                 report.Show((System.Windows.Forms.IWin32Window) this.ContentControl);
             }
         }
     }
 }
 public StiReport MakeReport(System.Data.DataSet ds, bool? showSaveButtons, string watermarkText, float? watermarkSize)
 {
     if (this.m_UseNoticeReportGenerator)
     {
         ObjectList<Organization> list = new ObjectList<Organization>();
         ObjectList<NoticeNoticeTemplateSetting> list2 = new ObjectList<NoticeNoticeTemplateSetting> {
             this.m_NoticeNoticeTemplateSetting
         };
         ActionDetails details = new ActionDetails(false) {
             Period = this.m_NoticePeriod,
             HouseHolders = list,
             AreaId = this.m_Area.Id,
             NoticeNoticeTemplateSettings = list2,
             FetchOnly = false,
             ForceGenerate = this.m_GenerateBeforeView,
             PrintTypeId = FasetItem.Null.Id,
             FilterMinDebt = (decimal) System.Convert.ToInt64(this.FilterMinDebt),
             FixedShowDebt = (decimal) System.Convert.ToInt64(this.FixedShowDebt),
             IsGenerate = true,
             IsExportPDF = false,
             IsShow = true,
             EditInDesign = false,
             IsClearData = false,
             IsClearRendered = false
         };
         details.Logger.UseFileLog = false;
         details.Logger.ExceptionLog.UseFileLog = false;
         NoticeGenerationWorker worker = new NoticeGenerationWorker {
             Action = details
         };
         worker.DoActionSync();
         if ((!worker.IsBreak && !worker.IsChancel) && (worker.Action.ReportResult != null))
         {
             return worker.Action.ReportResult;
         }
         return null;
     }
     StiReport report = new StiReport();
     if (showSaveButtons.get_HasValue())
     {
         this.m_StimulsoftUtilsOptions = new StimulsoftUtilsOptions(showSaveButtons.Value);
     }
     report.LoadFromString(this.m_NoticeNoticeTemplateSetting.Template.Template);
     report.ReportCacheMode = StiReportCacheMode.Off;
     if (watermarkText != null)
     {
         foreach (StiPage page in report.Pages)
         {
             page.Watermark.Text = watermarkText;
             if (watermarkSize.get_HasValue())
             {
                 page.Watermark.Font = (System.Drawing.Font) new System.Drawing.Font("Arial", watermarkSize.Value);
             }
         }
     }
     report.Compile();
     report.RegData((System.Data.DataSet) ds);
     report.ReportCacheMode = StiReportCacheMode.Off;
     report.Compile();
     return report;
 }