Esempio n. 1
0
        private void btnIn_Click(object sender, EventArgs e)
        {
            try
            {
                /*GridColumn unboundColumn = new GridColumn();
                 * unboundColumn.FieldName = "stt";
                 * unboundColumn.UnboundType = DevExpress.Data.UnboundColumnType.Integer;
                 *
                 * gridView1.Columns.Add(unboundColumn);
                 * unboundColumn.VisibleIndex = 0;
                 * gridView1.CustomUnboundColumnData += gridView1_CustomUnboundColumnData;*/

                gridColumn10.Visible = false;
                gridColumn11.Visible = false;
                gridView1.OptionsView.ShowViewCaption = false;
                gridView1.BestFitColumns();
                string leftColumn   = "";
                string middleColumn = "TIỆM VÀNG KHẢI HẰNG" + Environment.NewLine + text;
                //   text += "Tên kh: " + tkh + Environment.NewLine + "Ngày sinh: " + ns + Environment.NewLine + "Tên khác: " + tk;
                string rightColumn = "";

                string leftfooter          = "";
                string middlefooter        = "";
                string rightFooter         = "Trang [Page #]";
                PrintableComponentLink pcl = new PrintableComponentLink(new PrintingSystem());
                pcl.Component = gvGdwu;


                PageHeaderFooter phf = pcl.PageHeaderFooter as PageHeaderFooter;

                // Clear the PageHeaderFooter's contents.
                phf.Header.Content.Clear();
                phf.Footer.Content.Clear();
                phf.Header.Font = new Font("Times New Roman", 13, FontStyle.Bold);
                // Add custom information to the link's header.
                //  phf.Header.Content.AddRange(new string[] { string.Empty, "TITLE", "[Date Printed] [Time Printed]" });
                phf.Header.Content.AddRange(new string[] { leftColumn, middleColumn, rightColumn });
                phf.Header.LineAlignment = BrickAlignment.Far;
                phf.Footer.Content.AddRange(new string[] { leftfooter, middlefooter, rightFooter });


                //pcl.CreateDocument();
                //   pcl.ShowPreviewDialog();
                pcl.ShowRibbonPreviewDialog(gvGdwu.LookAndFeel);
                gridView1.OptionsView.ShowViewCaption = true;
                gridColumn11.Visible = true;
                //gridView1.Columns.Remove(unboundColumn);
                //gridView1.CustomUnboundColumnData -= gridView1_CustomUnboundColumnData;
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message);
            }
        }
        private void btnYazdirmaGoruntule_ItemClick(object sender, ItemClickEventArgs e)
        {
            var link = new PrintableComponentLink(new PrintingSystem())
            {
                Component = grdOlaylar,
                Margins   = new Margins
                {
                    Bottom = 5,
                    Left   = 5,
                    Right  = 5,
                    Top    = 5
                },
                Landscape = true
            };

            link.ShowRibbonPreviewDialog(new UserLookAndFeelDefault());
        }
Esempio n. 3
0
        protected void ShowPrintPreview()
        {
            if (CurrentPrintableComponent == null)
            {
                return;
            }
            PrintableComponentLink link = new PrintableComponentLink(new PrintingSystem());

            if (modulesNavigator.CurrentModule.AllowRtfTitle)
            {
                link.RtfReportHeader = @"{\rtf1\ansi\ansicpg1251\deff0\deflang1049{\fonttbl{\f0\fnil\fcharset0 Segoe UI;}}
{\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\sa200\sl276\slmult1\qc\lang9\f0\fs32 " + CurrentModuleName + @"\par
}";
            }
            link.Component = CurrentPrintableComponent;
            link.CreateDocument();
            link.ShowRibbonPreviewDialog(this.LookAndFeel);
        }
Esempio n. 4
0
        protected void ShowPrintPreview() {
            if(CurrentPrintableComponent == null) return;
            PrintableComponentLink link = new PrintableComponentLink(new PrintingSystem());
            if(modulesNavigator.CurrentModule.AllowRtfTitle) {
                link.RtfReportHeader = @"{\rtf1\ansi\ansicpg1251\deff0\deflang1049{\fonttbl{\f0\fnil\fcharset0 Segoe UI;}}
{\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\sa200\sl276\slmult1\qc\lang9\f0\fs32 " + CurrentModuleName + @"\par
}";
            } 
            link.Component = CurrentPrintableComponent;
            link.CreateDocument();
            link.ShowRibbonPreviewDialog(this.LookAndFeel);
        }