Пример #1
0
        public void DoOffline()
        {
            if (opened && !_offline)
            {
                _Timer.Enabled = false;

                _offline = true;
                _lDisplay.Visible = true;
                updateDisplay(RsViewEngine.Locale.GetMessage("status_swoffline"));
                System.Windows.Forms.Application.DoEvents();

                _PdfFile = FileSystem.GetTempFileName(RsApplicationInfo.ApplicationName, ".pdf");
                RsRptToPortabeFormatDocumentExporter lExporter = new RsRptToPortabeFormatDocumentExporter(ReportProvider);
                lExporter.Export(_PdfFile);

                _pdfCtl = new CAcroPDFCtl();
                _pdfCtl.BeginInit();
                this.Controls.Add(_pdfCtl);
                _pdfCtl.Size = new Size(
                            this.ClientRectangle.Width,
                            this.ClientRectangle.Height
                        );
                _pdfCtl.Anchor = Anchor = ((System.Windows.Forms.AnchorStyles)((
                            (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) |
                            (System.Windows.Forms.AnchorStyles.Right | System.Windows.Forms.AnchorStyles.Bottom)
                        )));
                _pdfCtl.EndInit();
                _pdfCtl.Show();

                _pdfCtl.LoadFile(_PdfFile);
                _pdfCtl.ShowToolBar(false);
                _pdfCtl.ShowBookmarks = _groupState;

                ctlViewer.Visible = false;
                ReportProvider.Close();
                updateDisplay(RsViewEngine.Locale.GetMessage("status_nowoffline"));
                showOkOffline();

                _Timer.Enabled = true;
            }
        }