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;
 }
Exemplo n.º 2
0
 private void GetActionDetails()
 {
     this.m_actionDetails = new ActionDetails(true);
     this.m_actionDetails.Period = this.sPeriod.DateBegin;
     this.m_actionDetails.HouseHolders = (base.ParentForm as PaymentNoticesMainForm).GetHouseHolders();
     this.m_actionDetails.AreaId = (base.ParentForm as PaymentNoticesMainForm).GetAreaId();
     this.m_actionDetails.NoticeNoticeTemplateSettings = this.m_nnTemplateSettings;
     this.m_actionDetails.PrintTypeId = this.sfPrintType.SelectedFasetItem.Id;
     this.m_actionDetails.FilterMinDebt = System.Convert.ToDecimal(this.nudMinDebt.get_Text());
     this.m_actionDetails.FixedShowDebt = System.Convert.ToDecimal(this.nudFixedDebt.get_Text());
     if ((this.cbPDF.get_Checked() || this.cbIsShow.get_Checked()) || (this.cbDesign.get_Checked() || this.cbRenderOnly.get_Checked()))
     {
         this.m_actionDetails.IsGenerate = true;
     }
     this.m_actionDetails.IsExportPDF = this.cbPDF.get_Checked();
     if (this.cbPDF.get_Checked())
     {
         this.m_actionDetails.FolderExport = this.tbPDFPath.get_Text();
         this.m_actionDetails.IsFilePart = !this.cbIsFilePart.get_Checked();
         this.m_actionDetails.FilePartHouseMinCount = System.Convert.ToInt32(this.nudMinHouse.Value);
         this.m_actionDetails.FilePartPageMaxCount = System.Convert.ToInt32(this.nudMaxPage.Value);
         this.m_actionDetails.IsGroupByHouseHolder = this.cbIsGroupByHouseHolder.get_Checked();
         this.m_actionDetails.IsSkipExistFile = this.cbIsSkipExistFile.get_Checked();
         this.m_actionDetails.IsAlignToPage = this.cbIsAlignToPage.get_Checked();
     }
     this.m_actionDetails.IsShow = this.cbIsShow.get_Checked();
     this.m_actionDetails.EditInDesign = this.cbDesign.get_Checked();
     this.m_actionDetails.IsClearData = this.cbIsClearData.get_Checked();
     this.m_actionDetails.IsClearRendered = this.cbIsClearRender.get_Checked();
 }