Exemple #1
0
        private void butFormReport_Click(object sender, EventArgs e)
        {
            if (!GeneralRep.CheckOneSheet(false))
            {
                return;
            }
            var d = DateTime.Now;
            var t = new TimeInterval(Different.MinDate.AddYears(1), d.AddMilliseconds(-d.Millisecond));

            if (!_book.OnlyAbsolute)
            {
                t = _book.CheckPeriodTime(PeriodBegin.Text, PeriodEnd.Text);
                if (t == null)
                {
                    return;
                }
            }
            var fill = FillPages.Text;
            var save = SaveToArchive.Checked;

            _book.IsReportForming          = true;
            _book.Interval                 = new ArchiveInterval(IntervalType.Single, t.Begin, t.End, IntervalName.Text);
            GeneralRep.Application.Visible = false;
            SetCalcMode(true);
            if (_book.ThreadId == 0)
            {
                FormingReport(fill, save);
            }
            else
            {
                if (!_book.PrepareController())
                {
                    Different.MessageError("Ошибка запуска расчета");
                }
                _task = new Thread(() => FormingReport(fill, save))
                {
                    Priority = ThreadPriority.AboveNormal
                };
                _task.Start();
            }
        }
Exemple #2
0
 //Заполнение отчета
 private void FillReport()
 {
     _book.IsReportForming = true;
     _book.Interval        = new ArchiveInterval(IntervalType.Single, _periodBegin, _periodEnd);
     if (_book.ThreadId == 0)
     {
         FormingReport();
     }
     else
     {
         if (!_book.PrepareController())
         {
             Different.MessageError("Ошибка запуска расчета");
         }
         _task = new Thread(FormingReport)
         {
             Priority = ThreadPriority.AboveNormal
         };
         _task.Start();
     }
 }