public void Rptdanhsach()
 {
     reportManager1.DataSources.Clear();
     reportManager1.DataSources.Add("danhsach", dgv_DanhSach.DataSource);
     rptdanhsachphongthi.FilePath = Application.StartupPath + @"\Reports\danhsachphongthi.rst";
     using (var previewForm = new PreviewForm(rptdanhsachphongthi))
     {
         previewForm.WindowState = FormWindowState.Maximized;
         rptdanhsachphongthi.Prepare();
         previewForm.ShowDialog();
     }
 }
Beispiel #2
0
        /// <summary>
        /// Invoked when a preview command line switch (\p) is specified.
        /// </summary>
        /// <param name="previewWindow">Facilitates previewing the screen saver.</param>
        protected override void OnShowPreview(PreviewWindow previewWindow)
        {
            formScreenSaver.IsPreview = true;
#if DEBUG
            PreviewForm   formPreview = new PreviewForm();
            PreviewWindow window      = new PreviewWindow(formPreview.PreviewAreaHandle);
            window.Child = formScreenSaver.Handle;
            formScreenSaver.Show();
            Application.Run(formPreview);
#else
            Rectangle rect;
            NativeMethods.GetClientRect(previewWindow.Handle, out rect);
            previewWindow.Child = formScreenSaver.Handle;
            Application.Run(formScreenSaver);
#endif
        }
        private void Rptdanhsach()
        {
            var tb = LoadData.Load(10, _idkythi);

            reportManager1.DataSources.Clear();
            reportManager1.DataSources.Add("danhsach", tb);
            rptdiemthi.FilePath = Application.StartupPath + @"\Reports\diemthi.rst";
            rptdiemthi.Prepare();
            rptdiemthi.GetReportParameter += GetParameter;
            var previewForm = new PreviewForm(rptdiemthi)
            {
                WindowState = FormWindowState.Maximized
            };

            previewForm.Show();
        }
        private void stopButton_Click(object sender, EventArgs e)
        {
            logger.Debug("stopButton_Click(...) ");

            mainForm.Cursor = Cursors.WaitCursor;
            this.Enabled    = false;

            Task.Run(() =>
            {
                StopStreaming();
            }).ContinueWith(t =>
            {
                //logger.Info(SharpDX.Diagnostics.ObjectTracker.ReportActiveObjects());

                UpdateControls();

                mainForm.Cursor = Cursors.Default;
                this.Enabled    = true;

                if (statisticForm != null)
                {
                    statisticForm.Stop();
                    statisticForm.Visible = false;
                }

                if (previewForm != null && !previewForm.IsDisposed)
                {
                    previewForm.Close();
                    previewForm = null;
                }

                regionForm?.Close();
                regionForm = null;

                var ex = t.Exception;
                if (ex != null)
                {
                    var iex = ex.InnerException;
                    MessageBox.Show(iex.Message);
                }
                else
                {
                }
            }, TaskScheduler.FromCurrentSynchronizationContext());
        }
Beispiel #5
0
 private void RptLop()
 {
     try
     {
         reportManager1.DataSources.Clear();
         reportManager1.DataSources.Add("danhsach", dgv_DanhSach.DataSource);
         rptdsdiemtheolop.FilePath = Application.StartupPath + @"\Reports\dsdiemlop.rst";
         rptdsdiemtheolop.Prepare();
         var previewForm = new PreviewForm(rptdsdiemtheolop)
         {
             WindowState = FormWindowState.Maximized
         };
         previewForm.Show();
     }
     catch (Exception ex)
     {
         Log2File.LogExceptionToFile(ex);
     }
 }
Beispiel #6
0
        private void InitializeActions()
        {
            var preview = new PreviewForm(Matrix is GuiPanel)
            {
                MdiParent = this
            };

            preview.Show();
            preview.Location = new Point(0, 0);

            var basic = new BasicForm {
                MdiParent = this
            };

            basic.Show();
            basic.Location = new Point(preview.Right, 0);

            actionsToolStripMenuItem.Visible = true;
        }
Beispiel #7
0
 public void RptView(string rptname,string source = "danhsach")
 {
     try
     {
         reportManager.DataSources.Clear();
         reportManager.DataSources.Add(source,_tb);
         ReportView.FilePath = Application.StartupPath + @"\Reports\" + rptname + ".rst";
         ReportView.Prepare();
         var previewForm = new PreviewForm(ReportView)
         {
             WindowState = FormWindowState.Maximized
         };
         previewForm.Show();
     }
     catch (Exception ex)
     {
         Log2File.LogExceptionToFile(ex);
     }
 }
        public void UnLink()
        {
            StopStreaming();

            if (statisticForm != null)
            {
                statisticForm.Stop();
                statisticForm.Visible = false;
            }

            if (previewForm != null && !previewForm.IsDisposed)
            {
                previewForm.Close();
                previewForm = null;
            }

            //...
            mainForm = null;
        }
 private void RptChamthi()
 {
     try
     {
         reportManager.DataSources.Clear();
         reportManager.DataSources.Add("danhsach", _tb);
         rptdanhsachsinhvien.FilePath = Application.StartupPath + @"\Reports\loichamthi.rst";
         rptdanhsachsinhvien.Prepare();
         var previewForm = new PreviewForm(rptdanhsachsinhvien)
         {
             WindowState = FormWindowState.Maximized
         };
         previewForm.Show();
     }
     catch (Exception ex)
     {
         Log2File.LogExceptionToFile(ex);
     }
 }
 public void RptView(string rptname, string source = "danhsach")
 {
     try
     {
         reportManager.DataSources.Clear();
         reportManager.DataSources.Add(source, _tb);
         ReportView.FilePath = Application.StartupPath + @"\Reports\" + rptname + ".rst";
         ReportView.Prepare();
         var previewForm = new PreviewForm(ReportView)
         {
             WindowState = FormWindowState.Maximized
         };
         previewForm.Show();
     }
     catch (Exception ex)
     {
         Log2File.LogExceptionToFile(ex);
     }
 }
Beispiel #11
0
 private void RptView(string rptname, DataTable table, string source = "danhsach")
 {
     try
     {
         reportManager1.DataSources.Clear();
         reportManager1.DataSources.Add(source, table);
         rptdanhsachsinhvien.FilePath = Application.StartupPath + @"\Reports\" + rptname + ".rst";
         rptdanhsachsinhvien.Prepare();
         var previewForm = new PreviewForm(rptdanhsachsinhvien)
         {
             WindowState = FormWindowState.Maximized
         };
         previewForm.Show();
     }
     catch (Exception ex)
     {
         Log2File.LogExceptionToFile(ex);
     }
 }
Beispiel #12
0
        private void RptDapAn()
        {
            var tb = LoadData.Load(7, _idKyThi);

            if (tb.Rows.Count == 0)
            {
                return;
            }
            reportManager1.DataSources.Clear();
            reportManager1.DataSources.Add("danhsach", tb);
            rptdapandethi.FilePath            = Application.StartupPath + @"\Reports\dapandethi.rst";
            rptdapandethi.GetReportParameter += GetParameter;
            rptdapandethi.Prepare();
            var previewForm = new PreviewForm(rptdapandethi)
            {
                WindowState   = FormWindowState.Maximized,
                ShowInTaskbar = false
            };

            previewForm.Show();
        }
Beispiel #13
0
        ///////////////////////////////////////////////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Does report preview.
        /// </summary>
        /// <param name="generator">Report generator object.</param>
        /// <param name="description">Report state description.</param>
        /// <returns>Operation status message.</returns>
        private MessageDetail _DoPreview(ReportsGenerator generator,
                                         ReportStateDescription description)
        {
            Debug.Assert(null != generator);
            Debug.Assert(null != description);

            MessageDetail detail = null;

            try
            {
                PreviewForm viewerForm = new PreviewForm(null, description, false);
                viewerForm.Show();
            }
            catch (Exception ex)
            {
                string message = App.Current.GetString("ReportPreviewPreviewFailFormat",
                                                       description.ReportName);
                detail = _DoExceptionRoutine(message, ex, generator, description);
            }

            return(detail);
        }
        private void previewButton_Click(object sender, EventArgs e)
        {
            logger.Debug("previewButton_Click(...)");

            if (previewForm != null && !previewForm.IsDisposed)
            {
                previewForm.Visible = !previewForm.Visible;
            }
            else
            {
                try
                {
                    SetupVideoSource(videoSettings);
                    //provider = new D3DImageProvider();

                    provider.Setup(videoSource);

                    previewForm = new PreviewForm
                    {
                        StartPosition = FormStartPosition.CenterParent,
                    };

                    previewForm.Link(provider);

                    // var pars = screenSource.CaptureParams;

                    var title = "";//"Src" + pars.SrcRect + "->Dst" + pars.DestSize + " Fps=" + pars.Fps + " Ratio=" + pars.AspectRatio;

                    previewForm.Text = title;

                    previewForm.Visible = true;
                }
                catch (Exception ex)
                {
                    logger.Error(ex);
                }
            }
        }
Beispiel #15
0
 private void Rptbangdiem()
 {
     try
     {
         var frm = new FrmRptBangDiem {
             bUpdate = false
         };
         frm.ShowDialog();
         if (!frm.bUpdate)
         {
             return;
         }
         _masv = frm.Masv;
         var tb = LoadData.LoadBangdiem(int.Parse(frm.Masv));
         if (tb.Rows.Count > 0)
         {
             reportManager1.DataSources.Clear();
             reportManager1.DataSources.Add("danhsach", tb);
             rptbangdiem.FilePath = Application.StartupPath + @"\Reports\bangdiem.rst";
             rptbangdiem.Prepare();
             rptbangdiem.GetReportParameter += GetParameter;
             var previewForm = new PreviewForm(rptbangdiem)
             {
                 WindowState = FormWindowState.Maximized
             };
             previewForm.Show();
         }
         else
         {
             MessageBox.Show(@"Sai mã sinh viên", @"Thông báo");
         }
     }
     catch (Exception ex)
     {
         Log2File.LogExceptionToFile(ex);
     }
 }
Beispiel #16
0
 private void Rptdsbailam()
 {
     try
     {
         if (dgv_DanhSach.Rows.Count == 0)
         {
             return;
         }
         reportManager1.DataSources.Clear();
         reportManager1.DataSources.Add("danhsach", dgv_DanhSach.DataSource);
         rptdsbailam.FilePath = Application.StartupPath + @"\Reports\dsbailam.rst";
         rptdsbailam.Prepare();
         rptdsbailam.GetReportParameter += GetParameter;
         var previewForm = new PreviewForm(rptdsbailam)
         {
             WindowState = FormWindowState.Maximized
         };
         previewForm.Show();
     }
     catch (Exception ex)
     {
         Log2File.LogExceptionToFile(ex);
     }
 }
 private void RptLop()
 {
     try
     {
         reportManager1.DataSources.Clear();
         reportManager1.DataSources.Add("danhsach", dgv_DanhSach.DataSource);
         rptdanhsachsinhvien.FilePath = Application.StartupPath + @"\Reports\dsSvLop.rst";
         rptdanhsachsinhvien.Prepare();
         var previewForm = new PreviewForm(rptdanhsachsinhvien)
         {
             WindowState = FormWindowState.Maximized
         };
         previewForm.Show();
     }
     catch (Exception ex)
     {
         Log2File.LogExceptionToFile(ex);
     }
 }
Beispiel #18
0
 private void RptPhongthi()
 {
     reportManager1.DataSources.Clear();
     reportManager1.DataSources.Add("danhsach", dgv_DanhSach.DataSource);
     rptdanhsachduthi.FilePath = Application.StartupPath + @"\Reports\danhsachnopbai.rst";
     rptdanhsachduthi.GetReportParameter += GetParameter;
     rptdanhsachduthi.Prepare();
     var previewForm = new PreviewForm(rptdanhsachduthi)
     {
         WindowState = FormWindowState.Maximized
     };
     previewForm.Show();
 }
        private void Rptdanhsach()
        {
            try
            {
                var tb1 = LoadData.Load(2051,_idkythi);
                var tb2 = LoadData.Load(2052,_idkythi);
                if (tb1.Rows.Count == 0 && tb2.Rows.Count == 0)
                {
                    MessageBox.Show(@"Không có lỗi logic", @"Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                reportManager1.DataSources.Clear();
                reportManager1.DataSources.Add("danhsach",tb1);
                reportManager1.DataSources.Add("danhsach1",tb2);
                rptkiemtralogic.FilePath = Application.StartupPath + @"\Reports\kiemtrasinhvien.rst";
                rptkiemtralogic.Prepare();
                rptkiemtralogic.GetReportParameter += GetParameter;
                var previewForm = new PreviewForm(rptkiemtralogic)
                {
                    WindowState = FormWindowState.Maximized,
                };
                previewForm.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Log2File.LogExceptionToFile(ex);

            }
        }
Beispiel #20
0
 private void RptKhoa()
 {
     reportManager1.DataSources.Clear();
     reportManager1.DataSources.Add("danhsach", dgv_DanhSach.DataSource);
     rptdanhsachkhoa.FilePath = Application.StartupPath + @"\Reports\danhsachduthikhoa.rst";
     rptdanhsachkhoa.Prepare();
     var previewForm = new PreviewForm(rptdanhsachkhoa)
     {
         WindowState = FormWindowState.Maximized
     };
     previewForm.Show();
 }
Beispiel #21
0
 private void RptLop()
 {
     reportManager1.DataSources.Clear();
     reportManager1.DataSources.Add("danhsach", LoadData.Load(1111, _idkythi));
     rptdanhsachlop.FilePath = Application.StartupPath + @"\Reports\danhsachduthilop.rst";
     rptdanhsachlop.GetReportParameter += GetParameter2;
     rptdanhsachlop.Prepare();
     var previewForm = new PreviewForm(rptdanhsachlop)
     {
         WindowState = FormWindowState.Maximized
     };
     previewForm.Show();
 }
        private void RptKtralogic()
        {
            try
            {
                var tb1 = Statistic.KiemTraLogic(_list[1],_list[0]);
                var tb2 = Statistic.KiemTraLogic(_list[0],_list[1]);
                if (tb1.Rows.Count == 0 && tb2.Rows.Count == 0)
                {
                    MessageBox.Show(@"Không có lỗi logic", @"Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                reportManager1.DataSources.Clear();
                reportManager1.DataSources.Add("camot",tb1);
                reportManager1.DataSources.Add("cahai",tb2);
                rptkiemtralogic.FilePath = Application.StartupPath + @"\Reports\kiemtrasinhvien1.rst";
                rptkiemtralogic.Prepare();
                rptkiemtralogic.GetReportParameter += GetParameter1;
                var previewForm = new PreviewForm(rptkiemtralogic)
                {
                    WindowState = FormWindowState.Maximized,
                };
                previewForm.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Log2File.LogExceptionToFile(ex);

            }
        }
Beispiel #23
0
 private void RptPhong()
 {
     try
     {
         var tb = new DataTable();
         var frm = new FrmRptdsPhong {update = false};
         frm.ShowDialog();
         var bd = int.Parse(frm.txttuphong.Text);
         var kt = int.Parse(frm.txtdenphong.Text);
         if (!frm.update || kt < bd) return;
         tb.Columns.Add("stt", typeof (string));
         for (var i = bd; i < kt; i++)
         {
             tb.Rows.Add(i);
         }
         reportManager1.DataSources.Clear();
         reportManager1.DataSources.Add("danhsach", tb);
         rptdsPhong.FilePath = Application.StartupPath + @"\Reports\dsPhong.rst";
         rptdsPhong.Prepare();
         var previewForm = new PreviewForm(rptdsPhong)
         {
             WindowState = FormWindowState.Maximized
         };
         previewForm.Show();
     }
     catch (Exception ex)
     {
         Log2File.LogExceptionToFile(ex);
     }
 }
 private void Rptthongke()
 {
     reportManager1.DataSources.Clear();
     rptthongke.FilePath = Application.StartupPath + @"\Reports\thongke.rst";
     rptthongke.GetReportParameter += GetParameter1;
     rptthongke.Prepare();
     var previewForm = new PreviewForm(rptthongke)
     {
         WindowState = FormWindowState.Maximized
     };
     previewForm.Show();
 }
 private void Rptdsbailam()
 {
     try
     {
         if(dgv_DanhSach.Rows.Count == 0) return;
         reportManager1.DataSources.Clear();
         reportManager1.DataSources.Add("danhsach", dgv_DanhSach.DataSource);
         rptdsbailam.FilePath = Application.StartupPath + @"\Reports\dsbailam.rst";
         rptdsbailam.Prepare();
         rptdsbailam.GetReportParameter += GetParameter;
         var previewForm = new PreviewForm(rptdsbailam)
         {
             WindowState = FormWindowState.Maximized
         };
         previewForm.Show();
     }
     catch (Exception ex)
     {
         Log2File.LogExceptionToFile(ex);
     }
 }
 private void RptView(string rptname, DataTable table, string source = "danhsach")
 {
     try
     {
         reportManager1.DataSources.Clear();
         reportManager1.DataSources.Add(source, table);
         rptdanhsachsinhvien.FilePath = Application.StartupPath + @"\Reports\" + rptname + ".rst";
         rptdanhsachsinhvien.Prepare();
         var previewForm = new PreviewForm(rptdanhsachsinhvien)
         {
             WindowState = FormWindowState.Maximized
         };
         previewForm.Show();
     }
     catch (Exception ex)
     {
         Log2File.LogExceptionToFile(ex);
     }
 }
 private void RptDapAn()
 {
     var tb = LoadData.Load(7, _idKyThi);
     if(tb.Rows.Count == 0) return;
     reportManager1.DataSources.Clear();
     reportManager1.DataSources.Add("danhsach", tb);
     rptdapandethi.FilePath = Application.StartupPath + @"\Reports\dapandethi.rst";
     rptdapandethi.GetReportParameter += GetParameter;
     rptdapandethi.Prepare();
     var previewForm = new PreviewForm(rptdapandethi)
     {
         WindowState = FormWindowState.Maximized,
         ShowInTaskbar = false
     };
     previewForm.Show();
 }
Beispiel #28
0
 private void RptLop()
 {
     reportManager1.DataSources.Clear();
      reportManager1.DataSources.Add("danhsach", dgv_DanhSach.DataSource);
      rptdiemthi.FilePath = Application.StartupPath + @"\Reports\quanlydiem.rst";
      rptdiemthi.Prepare();
      var previewForm = new PreviewForm(rptdiemthi)
      {
          WindowState = FormWindowState.Maximized,
          ShowInTaskbar = false
      };
      previewForm.Show();
 }
 private void Rptdanhsach()
 {
     var tb = LoadData.Load(10, _idkythi);
     reportManager1.DataSources.Clear();
     reportManager1.DataSources.Add("danhsach", tb);
     rptdiemthi.FilePath = Application.StartupPath + @"\Reports\diemthi.rst";
     rptdiemthi.Prepare();
     rptdiemthi.GetReportParameter += GetParameter;
     var previewForm = new PreviewForm(rptdiemthi)
     {
         WindowState = FormWindowState.Maximized
     };
     previewForm.Show();
 }
Beispiel #30
0
 private void Rptbangdiem()
 {
     try
     {
         var frm = new FrmRptBangDiem {bUpdate = false};
         frm.ShowDialog();
         if (!frm.bUpdate) return;
         _masv = frm.Masv;
         var tb = LoadData.LoadBangdiem(int.Parse(frm.Masv));
         if (tb.Rows.Count>0)
         {
             reportManager1.DataSources.Clear();
             reportManager1.DataSources.Add("danhsach", tb);
             rptbangdiem.FilePath = Application.StartupPath + @"\Reports\bangdiem.rst";
             rptbangdiem.Prepare();
             rptbangdiem.GetReportParameter += GetParameter;
             var previewForm = new PreviewForm(rptbangdiem)
             {
                 WindowState = FormWindowState.Maximized
             };
             previewForm.Show();
         }
         else
         {
             MessageBox.Show(@"Sai mã sinh viên", @"Thông báo");
         }
     }
     catch (Exception ex)
     {
         Log2File.LogExceptionToFile(ex);
     }
 }
        private void btnPreview_Click(object sender, EventArgs e)
        {
            XmlElement xml = this.GetResult();

            PreviewForm pf = new PreviewForm(xml);
            pf.ShowDialog();
        }
Beispiel #32
0
 private void ShowItem_Click(object sender, EventArgs e)
 {
     using (var prf = new PreviewForm(info))
         prf.Show();
 }
Beispiel #33
0
        public void DisplayReport(DataSet dataSource, ReportListModel reportList, XtraForm frmForm)
        {
            dataSource.DataSetName = "DataSource";
            var manager = new ReportManager();

            manager.GetReportParameter += manager_GetReportParameter;
            manager.OwnerForm           = frmForm;

            if (string.IsNullOrEmpty(reportList.TableName))
            {
                return;
            }

            var objectPointerCollection = new ObjectPointerCollection();
            // Các table name cách nhau = dấu ;
            var _listTableName = reportList.TableName.Split(';');

            if (_listTableName.Length > dataSource.Tables.Count || (dataSource.Tables.Count > 0 && dataSource.Tables[0].Rows.Count <= 0))
            {
                XtraMessageBox.Show("Dữ liệu báo cáo không có bản ghi nào!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            for (int i = 0; i < _listTableName.Length; i++)
            {
                DataTable dt = new DataTable();
                dt           = dataSource.Tables[i];
                dt.TableName = _listTableName[i];

                var colDecimalPlaces = new DataColumn();
                colDecimalPlaces.ColumnName   = nameof(TextFormat.DecimalPlaces); // Số chữ số sau dấu phẩy
                colDecimalPlaces.DataType     = typeof(int);
                colDecimalPlaces.DefaultValue = ReportSharpTool?.RssObject?.CurrencyFormat?.DecimalPlaces;

                var colDecimalSeparator = new DataColumn();
                colDecimalSeparator.ColumnName   = nameof(TextFormat.DecimalSeparator);
                colDecimalSeparator.DataType     = typeof(string);
                colDecimalSeparator.DefaultValue = ReportSharpTool?.RssObject?.CurrencyFormat?.DecimalSeparator;

                var colGroupSeparator = new DataColumn();
                colGroupSeparator.ColumnName   = nameof(TextFormat.GroupSeparator);
                colGroupSeparator.DataType     = typeof(string);
                colGroupSeparator.DefaultValue = ReportSharpTool?.RssObject?.CurrencyFormat?.GroupSeparator;
                dt.Columns.AddRange(new DataColumn[] { colDecimalPlaces, colDecimalSeparator, colGroupSeparator });

                objectPointerCollection.Add(dt.TableName, dt);
            }
            //objectPointerCollection.Add(nameof(dataSource), dataSource);
            manager.DataSources = objectPointerCollection;

            var reportSlot = new FileReportSlot {
                FilePath = GlobalVariable.ReportPath + reportList.ReportFile
            };

            manager.Reports.Add(reportSlot);
            AddParamSystem();
            reportSlot.RenderDocument();
            reportSlot.Document.Name = reportList.ReportName;

            var previewForm = new PreviewForm(reportSlot);

            previewForm.WindowState = FormWindowState.Maximized;
            previewForm.ReportViewer.DocumentLoaded += ReportViewer_DocumentLoaded;
            previewForm.ShowDialog();
        }
        private void Preview()
        {
            PreviewForm previewForm = new PreviewForm(Utilities.GetMap());

            previewForm.Show();
        }