Beispiel #1
0
        public virtual void proPdf()
        {
            try
            {
                PrintableComponentLink y = new DevExpress.XtraPrinting.PrintableComponentLink(new PrintingSystem());
                y.Component = grcListado;
                y.CreateReportHeaderArea += y_CreateReportHeaderArea;

                this.saveFileDialog.FileName         = "";
                this.saveFileDialog.Filter           = "Adobe PDF|*.pdf";
                this.saveFileDialog.FilterIndex      = 2;
                this.saveFileDialog.RestoreDirectory = true;

                Stream filename;
                string varNombre;

                if (this.saveFileDialog.ShowDialog() == DialogResult.OK)
                {
                    filename  = this.saveFileDialog.OpenFile();
                    varNombre = this.saveFileDialog.FileName;

                    if (filename != null)
                    {
                        filename.Close();
                        y.ExportToPdf(varNombre);
                    }
                    proAbrirArchivo(varNombre);
                }
            }
            catch (Exception ex) { XtraMessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); }
        }
Beispiel #2
0
        /// <summary>
        /// 打印操作
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void simpleButton1_Click_1(object sender, EventArgs e)
        {
            try
            {
                //this.layoutControl1.ShowPrintPreview();
                //this.layoutControl1.Print();
                //layoutControl1.ExportToXls("C:\\1.xls");
                //声明PrintingSystem
                PrintingSystem ps = new DevExpress.XtraPrinting.PrintingSystem();
                DevExpress.XtraPrinting.PrintableComponentLink link = null;
                link = new DevExpress.XtraPrinting.PrintableComponentLink(ps);
                ps.Links.Add(link);
                link.Component = layoutControl1; //将layoutcontrol控件和打印组件连接
                link.CreateDocument();           //建立文档
                ps.PageSettings.PaperKind = PaperKind.A4;

                //设置表格边距
                ps.PageSettings.TopMargin    = 2;
                ps.PageSettings.BottomMargin = 2;
                ps.PageSettings.LeftMargin   = 2;
                ps.PageSettings.RightMargin  = 2;
                //ps.PrintDlg();//调打印设置窗体
                //ps.PreviewFormEx.Show();//预览窗体
                ps.Print();
            }
            catch (Exception ex)
            {
                DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex);
            }
        }
Beispiel #3
0
        /// <summary>
        /// 打印GridControl
        /// </summary>
        /// <param name="control">需要被打印的GridControl</param>
        public static void PrintGridControl(GridControl control)
        {
            DevExpress.XtraPrintingLinks.CompositeLink compositeLink = new DevExpress.XtraPrintingLinks.CompositeLink();
            DevExpress.XtraPrinting.PrintingSystem     ps            = new DevExpress.XtraPrinting.PrintingSystem();

            compositeLink.PrintingSystem = ps;
            compositeLink.Landscape      = true;
            compositeLink.PaperKind      = System.Drawing.Printing.PaperKind.A4;

            DevExpress.XtraPrinting.PrintableComponentLink link = new DevExpress.XtraPrinting.PrintableComponentLink(ps);
            ps.PageSettings.Landscape = true;


            //   PageHeaderFooter phf = compositeLink.PageHeaderFooter as PageHeaderFooter;

            //设置页眉
            //phf.Header.Content.Clear();
            //phf.Header.Content.AddRange(new string[] { "", _PrintHeader, "" });
            //phf.Header.Font = new System.Drawing.Font("宋体", 14, System.Drawing.FontStyle.Bold);
            //phf.Header.LineAlignment = BrickAlignment.Center;

            //设置页脚
            //phf.Footer.Content.Clear();
            //phf.Footer.Content.AddRange(new string[] { "", "", "1" });
            //phf.Footer.Font = new System.Drawing.Font("宋体", 9, System.Drawing.FontStyle.Regular);
            //phf.Footer.LineAlignment = BrickAlignment.Center;


            link.Component = control;

            compositeLink.Links.Add(link);

            link.CreateDocument();   //建立文档
            ps.PreviewFormEx.Show(); //进行预览
        }
Beispiel #4
0
        public static void ExportXls(IPrintable Printer, string printCaption, Control.ControlCollection Controls)
        {
            if (Printer == null)
            {
                return;
            }
            OnBestFitColumns(Controls);
            PrintCaption = printCaption;
            DevExpress.XtraPrinting.PrintingSystem         ps   = new DevExpress.XtraPrinting.PrintingSystem();
            DevExpress.XtraPrinting.PrintableComponentLink link = new DevExpress.XtraPrinting.PrintableComponentLink(ps);
            link.Component = Printer;
            link.CreateReportHeaderArea += new DevExpress.XtraPrinting.CreateAreaEventHandler(printableComponentLink_CreateReportHeaderArea);

            link.PaperKind = System.Drawing.Printing.PaperKind.A4;

            link.Margins.Bottom = link.Margins.Left = link.Margins.Right = link.Margins.Top = 50;

            link.CreateDocument();
            string         fileName = string.Empty;
            SaveFileDialog save     = new SaveFileDialog();

            save.Filter = "Exel 2013 (*.xls)|*.xls";
            if (save.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                fileName = save.FileName;
            }

            if (string.IsNullOrEmpty(fileName))
            {
                return;
            }
            link.ExportToXls(fileName);
        }
Beispiel #5
0
        /// <summary>
        /// 显示打印预览窗体
        /// </summary>
        /// <param name="component">可以是GridContronl或者TreeList或者其他</param>
        /// <param name="headerTitle">标题</param>
        /// <param name="landscape">true表示横向,false表示纵向</param>
        /// <param name="headerFont">标题字体</param>
        public static void ShowPreview(IPrintable component, string headerTitle, bool landscape, Font headerFont)
        {
            PrintingSystem ps = new DevExpress.XtraPrinting.PrintingSystem();

            DevExpress.XtraPrinting.PrintableComponentLink link = new DevExpress.XtraPrinting.PrintableComponentLink(ps);
            ps.Links.Add(link);
            link.Component = component;            //这里可以是可打印的部件

            PageHeaderFooter phf = link.PageHeaderFooter as PageHeaderFooter;

            phf.Header.Content.AddRange(new string[] { "", headerTitle, "" });
            phf.Header.Font          = headerFont;
            phf.Header.LineAlignment = BrickAlignment.Center;
            phf.Footer.Content.AddRange(new string[] { DateTime.Now.ToString("yyyy-MM-dd"), "", "[Page # of Pages #]" });
            phf.Footer.LineAlignment = BrickAlignment.Center;
            link.Landscape           = landscape;
            link.CreateDocument();             //建立文档


            //ps.PreviewFormEx.Menu.MenuItems[0].MenuItems.RemoveAt(6) ;
            //ps.PreviewFormEx.Menu.MenuItems[0].MenuItems.RemoveAt(5);
            //ps.PreviewFormEx.Menu.MenuItems[0].MenuItems.RemoveAt(4);
            //ps.PreviewFormEx.PrintPreviewBar.Buttons.RemoveAt(4);
            //ps.PreviewFormEx.PrintPreviewBar.Buttons.RemoveAt(23);
            //ps.PreviewFormEx.PrintPreviewBar.Buttons.RemoveAt(23);lgm


            ps.PreviewFormEx.Text = headerTitle;

            ps.PreviewFormEx.Show();            //进行预览
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            DevExpress.XtraPrinting.PrintingSystem         ps  = new DevExpress.XtraPrinting.PrintingSystem();
            DevExpress.XtraPrinting.PrintableComponentLink pcl = new DevExpress.XtraPrinting.PrintableComponentLink(ps);

            pcl.CreateReportHeaderArea += this.pcl_CreateReportHeaderArea;
            pcl.Component = gridIssues;
            pcl.Landscape = true;
            pcl.CreateDocument();
            ps.PreviewFormEx.ShowDialog();
        }
Beispiel #7
0
        private void Export_Grid()
        {
            SplashScreenManager.ShowForm(this, typeof(Ordermanagement_01.Masters.WaitForm1), true, true, false);
            try
            {
                DevExpress.XtraPrinting.PrintingSystem     ps_1            = new DevExpress.XtraPrinting.PrintingSystem();
                DevExpress.XtraPrintingLinks.CompositeLink compositeLink_1 = new DevExpress.XtraPrintingLinks.CompositeLink(ps_1);

                DevExpress.XtraPrinting.PrintableComponentLink link_1 = new DevExpress.XtraPrinting.PrintableComponentLink();
                DevExpress.XtraPrinting.PrintableComponentLink link_2 = new DevExpress.XtraPrinting.PrintableComponentLink();


                // Show the Document Map toolbar button and menu item.
                ps_1.SetCommandVisibility(PrintingSystemCommand.Open, CommandVisibility.All);

                // Make the "Export to Csv" and "Export to Txt" commands visible.
                ps_1.SetCommandVisibility(new PrintingSystemCommand[] { PrintingSystemCommand.ExportCsv, PrintingSystemCommand.ExportTxt, PrintingSystemCommand.ExportXlsx, PrintingSystemCommand.ExportDocx, PrintingSystemCommand.ExportXls }, CommandVisibility.All);
                compositeLink_1.PrintingSystem = ps_1;


                link_1.Component = Grid_User_Summary;
                link_1.PaperName = "Niranjan";
                link_2.Component = pivotGridControl2;
                compositeLink_1.Links.AddRange(new object[] { link_1, link_2 });


                string ReportName = "Summary-Report";
                string folderPath = "C:\\Temp\\";
                string Path1      = folderPath + DateTime.Now.ToString("dd-MM-yyyy-hh-mm-ss") + "-" + ReportName + ".xlsx";
                //  compositeLink.ShowPreview();
                compositeLink_1.CreatePageForEachLink();

                // this is for Creating excel sheet name
                ps_1.XlSheetCreated += PrintingSystem_XlSheetCreated_1;

                compositeLink_1.PrintingSystem.ExportToXlsx(Path1, new XlsxExportOptions()
                {
                    ExportMode = XlsxExportMode.SingleFilePageByPage, ExportHyperlinks = false, TextExportMode = TextExportMode.Text
                });
                System.Diagnostics.Process.Start(Path1);
            }
            catch (Exception ex)
            {
                //Close Wait Form
                SplashScreenManager.CloseForm(false);
                MessageBox.Show("Error Occured Please Check With Administrator");
            }
            finally
            {
                //Close Wait Form
                SplashScreenManager.CloseForm(false);
            }
        }
        void PDFClick(object sender, EventArgs e)
        {
            using (SaveFileDialog saveDialog = new SaveFileDialog())
            {
                saveDialog.Filter = "*.pdf|*.pdf";
                if (saveDialog.ShowDialog() == DialogResult.OK)
                {
                    string exportFilePath = saveDialog.FileName;
                    DevExpress.XtraPrinting.PrintableComponentLink link = new DevExpress.XtraPrinting.PrintableComponentLink(new PrintingSystem());
                    link.VerticalContentSplitting = DevExpress.XtraPrinting.VerticalContentSplitting.Exact;
                    link.Margins.Left             = 0;
                    link.Margins.Right            = 0;
                    link.Margins.Top    = 0;
                    link.Margins.Bottom = 0;
                    link.Component      = receiptsJournalGrid;
                    //link.Landscape = true;// ориентация альбомная
                    link.PaperKind = System.Drawing.Printing.PaperKind.A4;

                    string fileExtenstion = new FileInfo(exportFilePath).Extension;

                    switch (fileExtenstion)
                    {
                    case ".pdf":
                        receiptsJournalGridView.OptionsPrint.ExpandAllDetails = true;
                        receiptsJournalGridView.OptionsPrint.AutoWidth        = true;
                        link.ExportToPdf(exportFilePath);
                        break;

                    default:
                        break;
                    }

                    if (File.Exists(exportFilePath))
                    {
                        try
                        {
                            System.Diagnostics.Process.Start(exportFilePath);
                        }
                        catch
                        {
                            String msg = "The file could not be opened." + Environment.NewLine + Environment.NewLine + "Path: " + exportFilePath;
                            MessageBox.Show(msg, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                    else
                    {
                        String msg = "The file could not be saved." + Environment.NewLine + Environment.NewLine + "Path: " + exportFilePath;
                        MessageBox.Show(msg, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            DevExpress.XtraPrinting.PrintingSystem ps = new DevExpress.XtraPrinting.PrintingSystem();
            DevExpress.XtraPrinting.PrintableComponentLink pcl = new DevExpress.XtraPrinting.PrintableComponentLink(ps);

            pcl.CreateReportHeaderArea += this.pcl_CreateReportHeaderArea;

            pcl.Component = gridControl1;
            pcl.Landscape = true;

            pcl.CreateDocument();
            ps.PreviewFormEx.ShowDialog();
        }
Beispiel #10
0
        // Export Error Desc Chart
        private void Export_Error_On_User()
        {
            load_Progressbar.Start_progres();
            DevExpress.XtraPrinting.PrintingSystem         ps2       = new DevExpress.XtraPrinting.PrintingSystem();
            DevExpress.XtraPrintingLinks.CompositeLink     cl_2      = new DevExpress.XtraPrintingLinks.CompositeLink(ps2);
            DevExpress.XtraPrinting.PrintableComponentLink pclChart2 = new DevExpress.XtraPrinting.PrintableComponentLink();

            chartControl3.Visible = true;
            pclChart2.Component   = chartControl3;

            cl_2.PaperKind     = System.Drawing.Printing.PaperKind.A3;
            cl_2.Landscape     = true;
            cl_2.Margins.Right = 40;
            cl_2.Margins.Left  = 40;

            cl_2.Links.AddRange(new object[] { pclChart2 });
            cl_2.ShowPreviewDialog();
        }
Beispiel #11
0
        private void Export_Error_Tab()
        {
            load_Progressbar.Start_progres();
            DevExpress.XtraPrinting.PrintingSystem         ps       = new DevExpress.XtraPrinting.PrintingSystem();
            DevExpress.XtraPrintingLinks.CompositeLink     cl       = new DevExpress.XtraPrintingLinks.CompositeLink(ps);
            DevExpress.XtraPrinting.PrintableComponentLink pclChart = new DevExpress.XtraPrinting.PrintableComponentLink();

            chartControl1.Visible = true;
            pclChart.Component    = chartControl1;

            cl.PaperKind      = System.Drawing.Printing.PaperKind.A4;
            cl.Landscape      = true;
            cl.Margins.Right  = 40;
            cl.Margins.Left   = 40;
            cl.Margins.Top    = 40;
            cl.Margins.Bottom = 40;
            cl.Links.AddRange(new object[] { pclChart });
            cl.ShowPreviewDialog();
        }
Beispiel #12
0
        public static void PreviewReport(IPrintable Printer, string printCaption, Control.ControlCollection Controls)
        {
            if (Printer == null)
            {
                return;
            }
            OnBestFitColumns(Controls);
            PrintCaption = printCaption;
            DevExpress.XtraPrinting.PrintingSystem         ps   = new DevExpress.XtraPrinting.PrintingSystem();
            DevExpress.XtraPrinting.PrintableComponentLink link = new DevExpress.XtraPrinting.PrintableComponentLink(ps);
            link.Component = Printer;
            link.PaperKind = System.Drawing.Printing.PaperKind.A4;
            link.CreateReportHeaderArea += new DevExpress.XtraPrinting.CreateAreaEventHandler(printableComponentLink_CreateReportHeaderArea);
            link.CreateReportFooterArea += new CreateAreaEventHandler(printableComponentLink_CreateReportFooterArea);



            link.Margins.Bottom = link.Margins.Left = link.Margins.Right = link.Margins.Top = 50;

            link.CreateDocument();
            link.ShowPreview();
        }
Beispiel #13
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     DevExpress.XtraGrid.GridLevelNode gridLevelNode1 = new DevExpress.XtraGrid.GridLevelNode();
     this.groupBox1 = new System.Windows.Forms.GroupBox();
     this.btnPrint = new DevExpress.XtraEditors.SimpleButton();
     this.dtDateDay = new System.Windows.Forms.MonthCalendar();
     this.dtClickDateTill = new System.Windows.Forms.MonthCalendar();
     this.dtClickDate = new System.Windows.Forms.MonthCalendar();
     this.label3 = new System.Windows.Forms.Label();
     this.btn_View = new DevExpress.XtraEditors.SimpleButton();
     this.dtClickDateTill2 = new DevExpress.XtraEditors.DateEdit();
     this.dtClickDate1 = new DevExpress.XtraEditors.DateEdit();
     this.btnExport = new DevExpress.XtraEditors.SimpleButton();
     this.gridMaster = new DevExpress.XtraGrid.GridControl();
     this.gridMasterView = new DevExpress.XtraGrid.Views.Grid.GridView();
     this.nCategory = new DevExpress.XtraGrid.Columns.GridColumn();
     this.lk_Category = new DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit();
     this.printingSystem1 = new DevExpress.XtraPrinting.PrintingSystem(this.components);
     this.printableComponentLink1 = new DevExpress.XtraPrinting.PrintableComponentLink(this.components);
     this.groupBox1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.dtClickDateTill2.Properties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.dtClickDate1.Properties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridMaster)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridMasterView)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.lk_Category)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.printingSystem1)).BeginInit();
     this.SuspendLayout();
     //
     // groupBox1
     //
     this.groupBox1.Controls.Add(this.btnPrint);
     this.groupBox1.Controls.Add(this.dtDateDay);
     this.groupBox1.Controls.Add(this.dtClickDateTill);
     this.groupBox1.Controls.Add(this.dtClickDate);
     this.groupBox1.Controls.Add(this.label3);
     this.groupBox1.Controls.Add(this.btn_View);
     this.groupBox1.Controls.Add(this.dtClickDateTill2);
     this.groupBox1.Controls.Add(this.dtClickDate1);
     this.groupBox1.Controls.Add(this.btnExport);
     this.groupBox1.Location = new System.Drawing.Point(0, 0);
     this.groupBox1.Name = "groupBox1";
     this.groupBox1.Size = new System.Drawing.Size(768, 160);
     this.groupBox1.TabIndex = 6;
     this.groupBox1.TabStop = false;
     this.groupBox1.Enter += new System.EventHandler(this.groupBox1_Enter);
     //
     // btnPrint
     //
     this.btnPrint.Location = new System.Drawing.Point(648, 72);
     this.btnPrint.Name = "btnPrint";
     this.btnPrint.Size = new System.Drawing.Size(96, 23);
     this.btnPrint.TabIndex = 11;
     this.btnPrint.Text = "Print";
     this.btnPrint.Click += new System.EventHandler(this.btnPrint_Click);
     //
     // dtDateDay
     //
     this.dtDateDay.Location = new System.Drawing.Point(448, 8);
     this.dtDateDay.Name = "dtDateDay";
     this.dtDateDay.TabIndex = 10;
     this.dtDateDay.DateSelected += new System.Windows.Forms.DateRangeEventHandler(this.dtDateDay_DateSelected);
     //
     // dtClickDateTill
     //
     this.dtClickDateTill.Location = new System.Drawing.Point(248, 8);
     this.dtClickDateTill.Name = "dtClickDateTill";
     this.dtClickDateTill.TabIndex = 9;
     //
     // dtClickDate
     //
     this.dtClickDate.Location = new System.Drawing.Point(8, 8);
     this.dtClickDate.Name = "dtClickDate";
     this.dtClickDate.TabIndex = 8;
     //
     // label3
     //
     this.label3.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
     this.label3.Location = new System.Drawing.Point(206, 64);
     this.label3.Name = "label3";
     this.label3.Size = new System.Drawing.Size(36, 22);
     this.label3.TabIndex = 7;
     this.label3.Text = "TO";
     //
     // btn_View
     //
     this.btn_View.Location = new System.Drawing.Point(206, 112);
     this.btn_View.Name = "btn_View";
     this.btn_View.Size = new System.Drawing.Size(32, 23);
     this.btn_View.TabIndex = 6;
     this.btn_View.Text = "View";
     this.btn_View.Click += new System.EventHandler(this.btn_View_Click);
     //
     // dtClickDateTill2
     //
     this.dtClickDateTill2.Anchor = System.Windows.Forms.AnchorStyles.None;
     this.dtClickDateTill2.EditValue = null;
     this.dtClickDateTill2.Location = new System.Drawing.Point(280, 66);
     this.dtClickDateTill2.Name = "dtClickDateTill2";
     //
     // dtClickDateTill2.Properties
     //
     this.dtClickDateTill2.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Style3D;
     this.dtClickDateTill2.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
                                                                                                              new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
     this.dtClickDateTill2.Properties.DisplayFormat.FormatString = "dd/MM/yyyy";
     this.dtClickDateTill2.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
     this.dtClickDateTill2.Properties.EditFormat.FormatString = "dd/MM/yyyy";
     this.dtClickDateTill2.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
     this.dtClickDateTill2.Properties.Mask.EditMask = "dd/MM/yyyy";
     this.dtClickDateTill2.Size = new System.Drawing.Size(108, 22);
     this.dtClickDateTill2.TabIndex = 4;
     //
     // dtClickDate1
     //
     this.dtClickDate1.Anchor = System.Windows.Forms.AnchorStyles.None;
     this.dtClickDate1.EditValue = null;
     this.dtClickDate1.Location = new System.Drawing.Point(48, 34);
     this.dtClickDate1.Name = "dtClickDate1";
     //
     // dtClickDate1.Properties
     //
     this.dtClickDate1.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Style3D;
     this.dtClickDate1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
                                                                                                          new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
     this.dtClickDate1.Properties.DisplayFormat.FormatString = "dd/MM/yyyy";
     this.dtClickDate1.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
     this.dtClickDate1.Properties.EditFormat.FormatString = "dd/MM/yyyy";
     this.dtClickDate1.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
     this.dtClickDate1.Properties.Mask.EditMask = "dd/MM/yyyy";
     this.dtClickDate1.Size = new System.Drawing.Size(108, 22);
     this.dtClickDate1.TabIndex = 1;
     //
     // btnExport
     //
     this.btnExport.Location = new System.Drawing.Point(648, 32);
     this.btnExport.Name = "btnExport";
     this.btnExport.Size = new System.Drawing.Size(96, 23);
     this.btnExport.TabIndex = 7;
     this.btnExport.Text = "Export To Excel";
     this.btnExport.Visible = false;
     this.btnExport.Click += new System.EventHandler(this.btnExport_Click);
     //
     // gridMaster
     //
     //
     // gridMaster.EmbeddedNavigator
     //
     this.gridMaster.EmbeddedNavigator.Name = "";
     this.gridMaster.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
     gridLevelNode1.RelationName = "Level1";
     this.gridMaster.LevelTree.Nodes.AddRange(new DevExpress.XtraGrid.GridLevelNode[] {
                                                                                          gridLevelNode1});
     this.gridMaster.Location = new System.Drawing.Point(0, 168);
     this.gridMaster.MainView = this.gridMasterView;
     this.gridMaster.Name = "gridMaster";
     this.gridMaster.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
                                                                                                         this.lk_Category});
     this.gridMaster.Size = new System.Drawing.Size(784, 352);
     this.gridMaster.TabIndex = 5;
     this.gridMaster.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
                                                                                               this.gridMasterView});
     //
     // gridMasterView
     //
     this.gridMasterView.ActiveFilterEnabled = false;
     this.gridMasterView.Appearance.GroupPanel.BackColor = System.Drawing.Color.White;
     this.gridMasterView.Appearance.GroupPanel.BorderColor = System.Drawing.Color.White;
     this.gridMasterView.Appearance.GroupPanel.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold);
     this.gridMasterView.Appearance.GroupPanel.ForeColor = System.Drawing.Color.Black;
     this.gridMasterView.Appearance.GroupPanel.Options.UseBackColor = true;
     this.gridMasterView.Appearance.GroupPanel.Options.UseBorderColor = true;
     this.gridMasterView.Appearance.GroupPanel.Options.UseFont = true;
     this.gridMasterView.Appearance.GroupPanel.Options.UseForeColor = true;
     this.gridMasterView.Appearance.HeaderPanel.ForeColor = System.Drawing.Color.Black;
     this.gridMasterView.Appearance.HeaderPanel.Options.UseForeColor = true;
     this.gridMasterView.AppearancePrint.HeaderPanel.ForeColor = System.Drawing.Color.Black;
     this.gridMasterView.AppearancePrint.HeaderPanel.Options.UseForeColor = true;
     this.gridMasterView.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Style3D;
     this.gridMasterView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
                                                                                           this.nCategory});
     this.gridMasterView.GridControl = this.gridMaster;
     this.gridMasterView.GroupPanelText = "hELLO";
     this.gridMasterView.Name = "gridMasterView";
     this.gridMasterView.OptionsBehavior.Editable = false;
     this.gridMasterView.OptionsCustomization.AllowFilter = false;
     this.gridMasterView.OptionsCustomization.AllowSort = false;
     this.gridMasterView.OptionsPrint.PrintGroupFooter = false;
     this.gridMasterView.OptionsPrint.UsePrintStyles = true;
     this.gridMasterView.OptionsView.ShowFilterPanel = false;
     this.gridMasterView.OptionsView.ShowFooter = true;
     //
     // nCategory
     //
     this.nCategory.Caption = "Category";
     this.nCategory.FieldName = "strReportGroup";
     this.nCategory.Name = "nCategory";
     this.nCategory.Visible = true;
     this.nCategory.VisibleIndex = 0;
     this.nCategory.Width = 100;
     //
     // lk_Category
     //
     this.lk_Category.AutoHeight = false;
     this.lk_Category.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
                                                                                              new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
     this.lk_Category.Name = "lk_Category";
     //
     // printingSystem1
     //
     this.printingSystem1.Links.AddRange(new object[] {
                                                          this.printableComponentLink1});
     //
     // printableComponentLink1
     //
     this.printableComponentLink1.Component = this.gridMaster;
     this.printableComponentLink1.Landscape = true;
     this.printableComponentLink1.Margins = new System.Drawing.Printing.Margins(50, 50, 50, 50);
     this.printableComponentLink1.PaperKind = System.Drawing.Printing.PaperKind.A4;
     this.printableComponentLink1.PrintingSystem = this.printingSystem1;
     //
     // RPAllIncome
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 14);
     this.ClientSize = new System.Drawing.Size(784, 512);
     this.Controls.Add(this.groupBox1);
     this.Controls.Add(this.gridMaster);
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
     this.Name = "RPAllIncome";
     this.Text = "RPAllIncome";
     this.Load += new System.EventHandler(this.RPAllIncome_Load);
     this.groupBox1.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.dtClickDateTill2.Properties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.dtClickDate1.Properties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridMaster)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridMasterView)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.lk_Category)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.printingSystem1)).EndInit();
     this.ResumeLayout(false);
 }
Beispiel #14
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     DevExpress.XtraGrid.GridLevelNode gridLevelNode1 = new DevExpress.XtraGrid.GridLevelNode();
     this.groupBox1               = new System.Windows.Forms.GroupBox();
     this.btnPrint                = new DevExpress.XtraEditors.SimpleButton();
     this.dtDateDay               = new System.Windows.Forms.MonthCalendar();
     this.dtClickDateTill         = new System.Windows.Forms.MonthCalendar();
     this.dtClickDate             = new System.Windows.Forms.MonthCalendar();
     this.label3                  = new System.Windows.Forms.Label();
     this.btn_View                = new DevExpress.XtraEditors.SimpleButton();
     this.dtClickDateTill2        = new DevExpress.XtraEditors.DateEdit();
     this.dtClickDate1            = new DevExpress.XtraEditors.DateEdit();
     this.btnExport               = new DevExpress.XtraEditors.SimpleButton();
     this.gridMaster              = new DevExpress.XtraGrid.GridControl();
     this.gridMasterView          = new DevExpress.XtraGrid.Views.Grid.GridView();
     this.nCategory               = new DevExpress.XtraGrid.Columns.GridColumn();
     this.lk_Category             = new DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit();
     this.printingSystem1         = new DevExpress.XtraPrinting.PrintingSystem(this.components);
     this.printableComponentLink1 = new DevExpress.XtraPrinting.PrintableComponentLink(this.components);
     this.groupBox1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.dtClickDateTill2.Properties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.dtClickDate1.Properties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridMaster)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridMasterView)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.lk_Category)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.printingSystem1)).BeginInit();
     this.SuspendLayout();
     //
     // groupBox1
     //
     this.groupBox1.Controls.Add(this.btnPrint);
     this.groupBox1.Controls.Add(this.dtDateDay);
     this.groupBox1.Controls.Add(this.dtClickDateTill);
     this.groupBox1.Controls.Add(this.dtClickDate);
     this.groupBox1.Controls.Add(this.label3);
     this.groupBox1.Controls.Add(this.btn_View);
     this.groupBox1.Controls.Add(this.dtClickDateTill2);
     this.groupBox1.Controls.Add(this.dtClickDate1);
     this.groupBox1.Controls.Add(this.btnExport);
     this.groupBox1.Location = new System.Drawing.Point(0, 0);
     this.groupBox1.Name     = "groupBox1";
     this.groupBox1.Size     = new System.Drawing.Size(768, 160);
     this.groupBox1.TabIndex = 6;
     this.groupBox1.TabStop  = false;
     this.groupBox1.Enter   += new System.EventHandler(this.groupBox1_Enter);
     //
     // btnPrint
     //
     this.btnPrint.Location = new System.Drawing.Point(648, 72);
     this.btnPrint.Name     = "btnPrint";
     this.btnPrint.Size     = new System.Drawing.Size(96, 23);
     this.btnPrint.TabIndex = 11;
     this.btnPrint.Text     = "Print";
     this.btnPrint.Click   += new System.EventHandler(this.btnPrint_Click);
     //
     // dtDateDay
     //
     this.dtDateDay.Location      = new System.Drawing.Point(448, 8);
     this.dtDateDay.Name          = "dtDateDay";
     this.dtDateDay.TabIndex      = 10;
     this.dtDateDay.DateSelected += new System.Windows.Forms.DateRangeEventHandler(this.dtDateDay_DateSelected);
     //
     // dtClickDateTill
     //
     this.dtClickDateTill.Location = new System.Drawing.Point(248, 8);
     this.dtClickDateTill.Name     = "dtClickDateTill";
     this.dtClickDateTill.TabIndex = 9;
     //
     // dtClickDate
     //
     this.dtClickDate.Location = new System.Drawing.Point(8, 8);
     this.dtClickDate.Name     = "dtClickDate";
     this.dtClickDate.TabIndex = 8;
     //
     // label3
     //
     this.label3.Font     = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
     this.label3.Location = new System.Drawing.Point(206, 64);
     this.label3.Name     = "label3";
     this.label3.Size     = new System.Drawing.Size(36, 22);
     this.label3.TabIndex = 7;
     this.label3.Text     = "TO";
     //
     // btn_View
     //
     this.btn_View.Location = new System.Drawing.Point(206, 112);
     this.btn_View.Name     = "btn_View";
     this.btn_View.Size     = new System.Drawing.Size(32, 23);
     this.btn_View.TabIndex = 6;
     this.btn_View.Text     = "View";
     this.btn_View.Click   += new System.EventHandler(this.btn_View_Click);
     //
     // dtClickDateTill2
     //
     this.dtClickDateTill2.Anchor    = System.Windows.Forms.AnchorStyles.None;
     this.dtClickDateTill2.EditValue = null;
     this.dtClickDateTill2.Location  = new System.Drawing.Point(280, 66);
     this.dtClickDateTill2.Name      = "dtClickDateTill2";
     //
     // dtClickDateTill2.Properties
     //
     this.dtClickDateTill2.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Style3D;
     this.dtClickDateTill2.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
         new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)
     });
     this.dtClickDateTill2.Properties.DisplayFormat.FormatString = "dd/MM/yyyy";
     this.dtClickDateTill2.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.DateTime;
     this.dtClickDateTill2.Properties.EditFormat.FormatString    = "dd/MM/yyyy";
     this.dtClickDateTill2.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.DateTime;
     this.dtClickDateTill2.Properties.Mask.EditMask = "dd/MM/yyyy";
     this.dtClickDateTill2.Size     = new System.Drawing.Size(108, 22);
     this.dtClickDateTill2.TabIndex = 4;
     //
     // dtClickDate1
     //
     this.dtClickDate1.Anchor    = System.Windows.Forms.AnchorStyles.None;
     this.dtClickDate1.EditValue = null;
     this.dtClickDate1.Location  = new System.Drawing.Point(48, 34);
     this.dtClickDate1.Name      = "dtClickDate1";
     //
     // dtClickDate1.Properties
     //
     this.dtClickDate1.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Style3D;
     this.dtClickDate1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
         new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)
     });
     this.dtClickDate1.Properties.DisplayFormat.FormatString = "dd/MM/yyyy";
     this.dtClickDate1.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.DateTime;
     this.dtClickDate1.Properties.EditFormat.FormatString    = "dd/MM/yyyy";
     this.dtClickDate1.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.DateTime;
     this.dtClickDate1.Properties.Mask.EditMask = "dd/MM/yyyy";
     this.dtClickDate1.Size     = new System.Drawing.Size(108, 22);
     this.dtClickDate1.TabIndex = 1;
     //
     // btnExport
     //
     this.btnExport.Location = new System.Drawing.Point(648, 32);
     this.btnExport.Name     = "btnExport";
     this.btnExport.Size     = new System.Drawing.Size(96, 23);
     this.btnExport.TabIndex = 7;
     this.btnExport.Text     = "Export To Excel";
     this.btnExport.Visible  = false;
     this.btnExport.Click   += new System.EventHandler(this.btnExport_Click);
     //
     // gridMaster
     //
     //
     // gridMaster.EmbeddedNavigator
     //
     this.gridMaster.EmbeddedNavigator.Name = "";
     this.gridMaster.Font        = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
     gridLevelNode1.RelationName = "Level1";
     this.gridMaster.LevelTree.Nodes.AddRange(new DevExpress.XtraGrid.GridLevelNode[] {
         gridLevelNode1
     });
     this.gridMaster.Location = new System.Drawing.Point(0, 168);
     this.gridMaster.MainView = this.gridMasterView;
     this.gridMaster.Name     = "gridMaster";
     this.gridMaster.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
         this.lk_Category
     });
     this.gridMaster.Size     = new System.Drawing.Size(784, 352);
     this.gridMaster.TabIndex = 5;
     this.gridMaster.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
         this.gridMasterView
     });
     //
     // gridMasterView
     //
     this.gridMasterView.ActiveFilterEnabled                              = false;
     this.gridMasterView.Appearance.GroupPanel.BackColor                  = System.Drawing.Color.White;
     this.gridMasterView.Appearance.GroupPanel.BorderColor                = System.Drawing.Color.White;
     this.gridMasterView.Appearance.GroupPanel.Font                       = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold);
     this.gridMasterView.Appearance.GroupPanel.ForeColor                  = System.Drawing.Color.Black;
     this.gridMasterView.Appearance.GroupPanel.Options.UseBackColor       = true;
     this.gridMasterView.Appearance.GroupPanel.Options.UseBorderColor     = true;
     this.gridMasterView.Appearance.GroupPanel.Options.UseFont            = true;
     this.gridMasterView.Appearance.GroupPanel.Options.UseForeColor       = true;
     this.gridMasterView.Appearance.HeaderPanel.ForeColor                 = System.Drawing.Color.Black;
     this.gridMasterView.Appearance.HeaderPanel.Options.UseForeColor      = true;
     this.gridMasterView.AppearancePrint.HeaderPanel.ForeColor            = System.Drawing.Color.Black;
     this.gridMasterView.AppearancePrint.HeaderPanel.Options.UseForeColor = true;
     this.gridMasterView.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Style3D;
     this.gridMasterView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
         this.nCategory
     });
     this.gridMasterView.GridControl                      = this.gridMaster;
     this.gridMasterView.GroupPanelText                   = "hELLO";
     this.gridMasterView.Name                             = "gridMasterView";
     this.gridMasterView.OptionsBehavior.Editable         = false;
     this.gridMasterView.OptionsCustomization.AllowFilter = false;
     this.gridMasterView.OptionsCustomization.AllowSort   = false;
     this.gridMasterView.OptionsPrint.PrintGroupFooter    = false;
     this.gridMasterView.OptionsPrint.UsePrintStyles      = true;
     this.gridMasterView.OptionsView.ShowFilterPanel      = false;
     this.gridMasterView.OptionsView.ShowFooter           = true;
     //
     // nCategory
     //
     this.nCategory.Caption      = "Category";
     this.nCategory.FieldName    = "strReportGroup";
     this.nCategory.Name         = "nCategory";
     this.nCategory.Visible      = true;
     this.nCategory.VisibleIndex = 0;
     this.nCategory.Width        = 100;
     //
     // lk_Category
     //
     this.lk_Category.AutoHeight = false;
     this.lk_Category.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
         new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)
     });
     this.lk_Category.Name = "lk_Category";
     //
     // printingSystem1
     //
     this.printingSystem1.Links.AddRange(new object[] {
         this.printableComponentLink1
     });
     //
     // printableComponentLink1
     //
     this.printableComponentLink1.Component      = this.gridMaster;
     this.printableComponentLink1.Landscape      = true;
     this.printableComponentLink1.Margins        = new System.Drawing.Printing.Margins(50, 50, 50, 50);
     this.printableComponentLink1.PaperKind      = System.Drawing.Printing.PaperKind.A4;
     this.printableComponentLink1.PrintingSystem = this.printingSystem1;
     //
     // RPAllIncome
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 14);
     this.ClientSize        = new System.Drawing.Size(784, 512);
     this.Controls.Add(this.groupBox1);
     this.Controls.Add(this.gridMaster);
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
     this.Name            = "RPAllIncome";
     this.Text            = "RPAllIncome";
     this.Load           += new System.EventHandler(this.RPAllIncome_Load);
     this.groupBox1.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.dtClickDateTill2.Properties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.dtClickDate1.Properties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridMaster)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridMasterView)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.lk_Category)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.printingSystem1)).EndInit();
     this.ResumeLayout(false);
 }
Beispiel #15
0
        /*
        * "[Page #]" (represented via the PreviewStringId.PageInfo_PageNumber property)
        * "[Page # of Pages #]" (represented via the PreviewStringId.PageInfo_PageNumberOfTotal property)
        * "[Date Printed]" (represented via the PreviewStringId.PageInfo_PageDate property)
        * "[Time Printed]" (represented via the PreviewStringId.PageInfo_PageTime property)
        * "[User Name]" (represented via the PreviewStringId.PageInfo_PageUserName property)
        */
        public static PrintableComponentLink GetPrintableComponentLink(
            IPrintable gridControl,
            String reportHeader,
            Image ReportHeaderImage,
            String rtfGridHeader,
            float rtfGridHeaderHeight,
            String mainTitle,
            String subTitle,
            String reportFooter,
            String rtfGridFooter)
        {
            float height = 0;

            DevExpress.XtraPrinting.PrintingSystem printingSystem1;
            printingSystem1 = new DevExpress.XtraPrinting.PrintingSystem();
            ((System.ComponentModel.ISupportInitialize)(printingSystem1)).BeginInit();
            DevExpress.XtraPrinting.PrintableComponentLink printableComponentLink1;
            printableComponentLink1 = new DevExpress.XtraPrinting.PrintableComponentLink();
            printableComponentLink1.PaperKind = System.Drawing.Printing.PaperKind.A4;
            printableComponentLink1.Margins.Left = 50;
            printableComponentLink1.Margins.Right = 50;
            printableComponentLink1.Margins.Top = 50;
            printableComponentLink1.Margins.Bottom = 50;
            printingSystem1.Links.AddRange(new object[] { printableComponentLink1 });
            printableComponentLink1.Component = gridControl;
            printableComponentLink1.PrintingSystem = printingSystem1;

            DevExpress.XtraPrinting.PageHeaderArea headerArea;
            headerArea = new DevExpress.XtraPrinting.PageHeaderArea();
            headerArea.Content.Add(reportHeader);
            headerArea.LineAlignment = DevExpress.XtraPrinting.BrickAlignment.Near;

            #region Đầu trang
            if (rtfGridHeader != null)
            {
                printableComponentLink1.RtfReportHeader = rtfGridHeader;
                height = rtfGridHeaderHeight;
            }
            printableComponentLink1.CreateReportHeaderArea += delegate(object sender, DevExpress.XtraPrinting.CreateAreaEventArgs e)
            {
                float currentHeight = height;

                #region Giải pháp 1
                Image headerImage = (ReportHeaderImage == null ?
                    FWImageDic.LOGO_IMAGE48 : ReportHeaderImage);

                DevExpress.XtraPrinting.ImageBrick logo;
                logo = e.Graph.DrawImage(headerImage,
                    new RectangleF(10, 5, headerImage.Width, headerImage.Height),
                    DevExpress.XtraPrinting.BorderSide.None, Color.Transparent);
                //currentHeight += headerImage.Height;
                #endregion

                if (mainTitle != null)
                {
                    DevExpress.XtraPrinting.TextBrick brick;
                    brick = e.Graph.DrawString(mainTitle, Color.Navy, new RectangleF(0, currentHeight, 620, 40), DevExpress.XtraPrinting.BorderSide.None);
                    currentHeight += 40;
                    brick.Font = new Font("Tahoma", 20);
                    brick.StringFormat = new DevExpress.XtraPrinting.BrickStringFormat(StringAlignment.Center);
                    brick.BackColor = Color.White;
                    brick.ForeColor = Color.Black;

                }

                if (subTitle != null)
                {
                    DevExpress.XtraPrinting.TextBrick brickDate;
                    brickDate = e.Graph.DrawString(subTitle, Color.Navy, new RectangleF(0, currentHeight, 620, 40), DevExpress.XtraPrinting.BorderSide.None);
                    currentHeight += 40;
                    brickDate.Font = new Font("Tahoma", 10);
                    brickDate.StringFormat = new DevExpress.XtraPrinting.BrickStringFormat(StringAlignment.Center);
                    brickDate.BackColor = Color.White;
                    brickDate.ForeColor = Color.Black;
                }
            };
            #endregion

            if(rtfGridFooter!= null)
                printableComponentLink1.RtfReportFooter = rtfGridFooter;

            #region Header Footer
            DevExpress.XtraPrinting.PageFooterArea footerArea;
            footerArea = new DevExpress.XtraPrinting.PageFooterArea();
            footerArea.Content.Add(reportFooter);
            footerArea.LineAlignment = DevExpress.XtraPrinting.BrickAlignment.Near;

            DevExpress.XtraPrinting.PageHeaderFooter pageHeaderFooter;
            pageHeaderFooter = new DevExpress.XtraPrinting.PageHeaderFooter(headerArea, footerArea);
            printableComponentLink1.PageHeaderFooter = pageHeaderFooter;
            #endregion

            ((System.ComponentModel.ISupportInitialize)(printingSystem1)).EndInit();

            printableComponentLink1.CreateDocument();

            return printableComponentLink1;
        }
Beispiel #16
0
        /// <summary>
        /// DevExpress控件通用导出Excel,支持多个控件同时导出在同一个Sheet表或者分不同工作薄
        /// eg:ExportToXlsx("test",true,"控件",gridControl1,gridControl2);
        /// 将gridControl1和gridControl2的数据一同导出到同一个文件不同的工作薄
        /// eg:ExportToXlsx("test",false,"",gridControl1,gridControl2);
        /// 将gridControl1和gridControl2的数据一同导出到同一个文件同一个的工作薄
        /// <param name="FileName">Excel路径</param>
        /// <param name="isPageForEachLink">多个打印控件是否分多个工作薄显示</param>
        /// <param name="sheetName">工作薄名称</param>
        /// <param name="printables">控件集 eg:GridControl,PivotGridControl,TreeList,ChartControl...</param>
        public static void ExportToExcel(string FileName, bool isPageForEachLink, string sheetName,
                                         params DevExpress.XtraPrinting.IPrintable[] printables)
        {
            // SaveFileDialog saveFileDialog = new SaveFileDialog()
            // {
            //     FileName = title,
            //     Title = "导出Excel",
            //     Filter = "Excel文件(*.xlsx)|*.xlsx|Excel文件(*.xls)|*.xls"
            // };
            // DialogResult dialogResult = saveFileDialog.ShowDialog();
            // if (dialogResult == DialogResult.Cancel)
            //     return;
            // string FileName = saveFileDialog.FileName;

            DevExpress.XtraPrintingLinks.CompositeLink link =
                new DevExpress.XtraPrintingLinks.CompositeLink(new DevExpress.XtraPrinting.PrintingSystem());
            foreach (var item in printables)
            {
                var plink = new DevExpress.XtraPrinting.PrintableComponentLink()
                {
                    Component = item
                };
                link.Links.Add(plink);
            }

            if (isPageForEachLink) //15.1 的Xls不支持这个功能,15.2未知
            {
                link.CreatePageForEachLink();
            }
            //默认工作薄名称
            if (string.IsNullOrEmpty(sheetName))
            {
                sheetName = "Sheet";
            }
            try
            {
                int count = 1;
                //在重复名称后加(序号)
                while (System.IO.File.Exists(FileName))
                {
                    if (FileName.Contains(")."))
                    {
                        int start = FileName.LastIndexOf("(");
                        int end   = FileName.LastIndexOf(").") - FileName.LastIndexOf("(") + 2;
                        FileName = FileName.Replace(FileName.Substring(start, end), string.Format("({0}).", count));
                    }
                    else
                    {
                        FileName = FileName.Replace(".", string.Format("({0}).", count));
                    }

                    count++;
                }

                if (FileName.LastIndexOf(".xlsx") >= FileName.Length - 5)
                {
                    DevExpress.XtraPrinting.XlsxExportOptions options =
                        new DevExpress.XtraPrinting.XlsxExportOptions(TextExportMode.Value, true, false, true)
                    {
                        SheetName = sheetName
                    };
                    if (isPageForEachLink)
                    {
                        options.ExportMode = DevExpress.XtraPrinting.XlsxExportMode.SingleFilePageByPage;
                    }
                    link.ExportToXlsx(FileName, options);
                }
                else
                {
                    DevExpress.XtraPrinting.XlsExportOptions options =
                        new DevExpress.XtraPrinting.XlsExportOptions(TextExportMode.Value, true, false, true)
                    {
                        SheetName = sheetName
                    };
                    if (isPageForEachLink) //15.Xls没有这个属性,15.2未知
                    {
                        options.ExportMode = DevExpress.XtraPrinting.XlsExportMode.SingleFilePageByPage;
                    }
                    link.ExportToXls(FileName, options);
                }

                if (DevExpress.XtraEditors.XtraMessageBox.Show("保存成功,是否打开文件?", "提示", MessageBoxButtons.YesNo,
                                                               MessageBoxIcon.Information) == DialogResult.Yes)
                {
                    System.Diagnostics.Process.Start(FileName); //打开指定路径下的文件
                }
            }
            catch (Exception ex)
            {
                DevExpress.XtraEditors.XtraMessageBox.Show(ex.Message);
            }
        }
Beispiel #17
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     DevExpress.XtraPivotGrid.PivotGridGroup pivotGridGroup1 = new DevExpress.XtraPivotGrid.PivotGridGroup();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RPIncomeAnalysis));
     DevExpress.XtraPivotGrid.PivotGridGroup pivotGridGroup2 = new DevExpress.XtraPivotGrid.PivotGridGroup();
     DevExpress.XtraPivotGrid.PivotGridGroup pivotGridGroup3 = new DevExpress.XtraPivotGrid.PivotGridGroup();
     DevExpress.XtraPivotGrid.PivotGridGroup pivotGridGroup4 = new DevExpress.XtraPivotGrid.PivotGridGroup();
     this.CurrentGridIncomeAnalysis = new DevExpress.XtraPivotGrid.PivotGridControl();
     this.pv2NettAmount = new DevExpress.XtraPivotGrid.PivotGridField();
     this.pivotGridField7 = new DevExpress.XtraPivotGrid.PivotGridField();
     this.pivotGridField8 = new DevExpress.XtraPivotGrid.PivotGridField();
     this.v2TargetAmount = new DevExpress.XtraPivotGrid.PivotGridField();
     this.TargetPercent = new DevExpress.XtraPivotGrid.PivotGridField();
     this.DayMonthEnd = new DevExpress.XtraPivotGrid.PivotGridField();
     this.DayAvg = new DevExpress.XtraPivotGrid.PivotGridField();
     this.pivotGridField14 = new DevExpress.XtraPivotGrid.PivotGridField();
     this.colTest = new DevExpress.XtraPivotGrid.PivotGridField();
     this.label63 = new System.Windows.Forms.Label();
     this.cmbCategory = new DevExpress.XtraEditors.ImageComboBoxEdit();
     this.label2 = new System.Windows.Forms.Label();
     this.imageList1 = new System.Windows.Forms.ImageList(this.components);
     this.PRINT1 = new DevExpress.XtraEditors.HyperLinkEdit();
     this.printingSystem1 = new DevExpress.XtraPrinting.PrintingSystem(this.components);
     this.printableComponentLink1 = new DevExpress.XtraPrinting.PrintableComponentLink(this.components);
     this.printableComponentLink2 = new DevExpress.XtraPrinting.PrintableComponentLink(this.components);
     this.printableComponentLink3 = new DevExpress.XtraPrinting.PrintableComponentLink(this.components);
     this.printableComponentLink4 = new DevExpress.XtraPrinting.PrintableComponentLink(this.components);
     this.hyperLinkEdit1 = new DevExpress.XtraEditors.HyperLinkEdit();
     this.PrevGridIncomeAnalysis = new DevExpress.XtraPivotGrid.PivotGridControl();
     this.pivotGridField1 = new DevExpress.XtraPivotGrid.PivotGridField();
     this.pivotGridField3 = new DevExpress.XtraPivotGrid.PivotGridField();
     this.pivotGridField4 = new DevExpress.XtraPivotGrid.PivotGridField();
     this.vTargetAmt = new DevExpress.XtraPivotGrid.PivotGridField();
     this.TargetAmt = new DevExpress.XtraPivotGrid.PivotGridField();
     this.pivotGridField13 = new DevExpress.XtraPivotGrid.PivotGridField();
     this.TestTargetAmt = new DevExpress.XtraPivotGrid.PivotGridField();
     this.label3 = new System.Windows.Forms.Label();
     this.label1 = new System.Windows.Forms.Label();
     this.hyperLinkEdit2 = new DevExpress.XtraEditors.HyperLinkEdit();
     this.btn_Add = new DevExpress.XtraEditors.SimpleButton();
     this.btn_Del = new DevExpress.XtraEditors.SimpleButton();
     this.pvGrandTotal10Days = new DevExpress.XtraPivotGrid.PivotGridControl();
     this.pivotGridField16 = new DevExpress.XtraPivotGrid.PivotGridField();
     this.pivotGridField17 = new DevExpress.XtraPivotGrid.PivotGridField();
     this.ThirdGridIncomeAnalysis = new DevExpress.XtraPivotGrid.PivotGridControl();
     this.pivotGridField11 = new DevExpress.XtraPivotGrid.PivotGridField();
     this.pivotGridField12 = new DevExpress.XtraPivotGrid.PivotGridField();
     this.pivotGridField9 = new DevExpress.XtraPivotGrid.PivotGridField();
     this.cmbMonth = new System.Windows.Forms.ComboBox();
     this.label4 = new System.Windows.Forms.Label();
     ((System.ComponentModel.ISupportInitialize)(this.CurrentGridIncomeAnalysis)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.cmbCategory.Properties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.PRINT1.Properties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.printingSystem1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.hyperLinkEdit1.Properties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.PrevGridIncomeAnalysis)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.hyperLinkEdit2.Properties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.pvGrandTotal10Days)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.ThirdGridIncomeAnalysis)).BeginInit();
     this.SuspendLayout();
     //
     // CurrentGridIncomeAnalysis
     //
     this.CurrentGridIncomeAnalysis.Cursor = System.Windows.Forms.Cursors.Default;
     this.CurrentGridIncomeAnalysis.Fields.AddRange(new DevExpress.XtraPivotGrid.PivotGridField[] {
     this.pv2NettAmount,
     this.pivotGridField7,
     this.pivotGridField8,
     this.v2TargetAmount,
     this.TargetPercent,
     this.DayMonthEnd,
     this.DayAvg,
     this.pivotGridField14,
     this.colTest});
     this.CurrentGridIncomeAnalysis.Groups.AddRange(new DevExpress.XtraPivotGrid.PivotGridGroup[] {
     pivotGridGroup1});
     this.CurrentGridIncomeAnalysis.Location = new System.Drawing.Point(0, 271);
     this.CurrentGridIncomeAnalysis.Name = "CurrentGridIncomeAnalysis";
     this.CurrentGridIncomeAnalysis.OptionsCustomization.AllowDrag = false;
     this.CurrentGridIncomeAnalysis.OptionsCustomization.AllowExpand = false;
     this.CurrentGridIncomeAnalysis.OptionsDataField.Area = DevExpress.XtraPivotGrid.PivotDataArea.RowArea;
     this.CurrentGridIncomeAnalysis.OptionsDataField.AreaIndex = 1;
     this.CurrentGridIncomeAnalysis.OptionsPrint.UsePrintAppearance = true;
     this.CurrentGridIncomeAnalysis.OptionsView.ShowDataHeaders = false;
     this.CurrentGridIncomeAnalysis.OptionsView.ShowFilterHeaders = false;
     this.CurrentGridIncomeAnalysis.OptionsView.ShowRowGrandTotals = false;
     this.CurrentGridIncomeAnalysis.Size = new System.Drawing.Size(960, 156);
     this.CurrentGridIncomeAnalysis.TabIndex = 1;
     this.CurrentGridIncomeAnalysis.Click += new System.EventHandler(this.CurrentGridIncomeAnalysis_Click);
     this.CurrentGridIncomeAnalysis.CustomSummary += new DevExpress.XtraPivotGrid.PivotGridCustomSummaryEventHandler(this.CurrentGridIncomeAnalysis_CustomSummary);
     //
     // pv2NettAmount
     //
     this.pv2NettAmount.Area = DevExpress.XtraPivotGrid.PivotArea.DataArea;
     this.pv2NettAmount.AreaIndex = 0;
     this.pv2NettAmount.Caption = "Branch Sales";
     this.pv2NettAmount.CellFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
     this.pv2NettAmount.FieldName = "mNettAmount";
     this.pv2NettAmount.Name = "pv2NettAmount";
     this.pv2NettAmount.TotalCellFormat.FormatString = "f2";
     this.pv2NettAmount.TotalCellFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
     this.pv2NettAmount.TotalValueFormat.FormatString = "f2";
     this.pv2NettAmount.TotalValueFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
     this.pv2NettAmount.ValueFormat.FormatString = "f2";
     this.pv2NettAmount.ValueFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
     this.pv2NettAmount.Width = 80;
     //
     // pivotGridField7
     //
     this.pivotGridField7.Area = DevExpress.XtraPivotGrid.PivotArea.ColumnArea;
     this.pivotGridField7.AreaIndex = 0;
     this.pivotGridField7.Caption = "Branch";
     this.pivotGridField7.FieldName = "strBranchCode";
     this.pivotGridField7.Name = "pivotGridField7";
     this.pivotGridField7.Options.AllowDrag = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField7.Options.AllowExpand = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField7.Options.AllowFilter = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField7.Options.AllowSort = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField7.Width = 80;
     //
     // pivotGridField8
     //
     this.pivotGridField8.Area = DevExpress.XtraPivotGrid.PivotArea.DataArea;
     this.pivotGridField8.AreaIndex = 1;
     this.pivotGridField8.Caption = "Branch Sales";
     this.pivotGridField8.FieldName = "mTotalAmount";
     this.pivotGridField8.Name = "pivotGridField8";
     this.pivotGridField8.Visible = false;
     this.pivotGridField8.Width = 80;
     //
     // v2TargetAmount
     //
     this.v2TargetAmount.Area = DevExpress.XtraPivotGrid.PivotArea.DataArea;
     this.v2TargetAmount.AreaIndex = 2;
     this.v2TargetAmount.Caption = "Amount - Target";
     this.v2TargetAmount.Name = "v2TargetAmount";
     this.v2TargetAmount.SummaryType = DevExpress.Data.PivotGrid.PivotSummaryType.Custom;
     this.v2TargetAmount.UnboundFieldName = "pv2TargetAmount";
     this.v2TargetAmount.UnboundType = DevExpress.Data.UnboundColumnType.Decimal;
     //
     // TargetPercent
     //
     this.TargetPercent.Area = DevExpress.XtraPivotGrid.PivotArea.DataArea;
     this.TargetPercent.AreaIndex = 2;
     this.TargetPercent.Caption = "% of Target";
     this.TargetPercent.CellFormat.FormatString = "p";
     this.TargetPercent.CellFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
     this.TargetPercent.Name = "TargetPercent";
     this.TargetPercent.SummaryDisplayType = DevExpress.Data.PivotGrid.PivotSummaryDisplayType.PercentVariation;
     this.TargetPercent.SummaryType = DevExpress.Data.PivotGrid.PivotSummaryType.Custom;
     this.TargetPercent.TotalCellFormat.FormatString = "p";
     this.TargetPercent.TotalCellFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
     this.TargetPercent.TotalValueFormat.FormatString = "p";
     this.TargetPercent.TotalValueFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
     this.TargetPercent.ValueFormat.FormatString = "p";
     this.TargetPercent.ValueFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
     this.TargetPercent.Visible = false;
     //
     // DayMonthEnd
     //
     this.DayMonthEnd.Area = DevExpress.XtraPivotGrid.PivotArea.DataArea;
     this.DayMonthEnd.AreaIndex = 3;
     this.DayMonthEnd.Caption = "Days To Month End";
     this.DayMonthEnd.Name = "DayMonthEnd";
     this.DayMonthEnd.SummaryType = DevExpress.Data.PivotGrid.PivotSummaryType.Min;
     //
     // DayAvg
     //
     this.DayAvg.Appearance.ValueTotal.ForeColor = System.Drawing.Color.Black;
     this.DayAvg.Appearance.ValueTotal.Options.UseForeColor = true;
     this.DayAvg.Area = DevExpress.XtraPivotGrid.PivotArea.DataArea;
     this.DayAvg.AreaIndex = 4;
     this.DayAvg.Caption = "Daily Average";
     this.DayAvg.Name = "DayAvg";
     this.DayAvg.SummaryType = DevExpress.Data.PivotGrid.PivotSummaryType.Custom;
     this.DayAvg.TotalCellFormat.FormatString = "f2";
     this.DayAvg.TotalCellFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
     this.DayAvg.TotalValueFormat.FormatString = "f2";
     this.DayAvg.TotalValueFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
     this.DayAvg.UnboundFieldName = "DailyAvg";
     this.DayAvg.UnboundType = DevExpress.Data.UnboundColumnType.Decimal;
     this.DayAvg.ValueFormat.FormatString = "f2";
     this.DayAvg.ValueFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
     //
     // pivotGridField14
     //
     this.pivotGridField14.Area = DevExpress.XtraPivotGrid.PivotArea.RowArea;
     this.pivotGridField14.AreaIndex = 0;
     this.pivotGridField14.Caption = "Month";
     this.pivotGridField14.FieldName = "dtMonth";
     this.pivotGridField14.Name = "pivotGridField14";
     this.pivotGridField14.Options.AllowDrag = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField14.Options.AllowSort = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField14.Width = 80;
     //
     // colTest
     //
     this.colTest.Area = DevExpress.XtraPivotGrid.PivotArea.DataArea;
     this.colTest.AreaIndex = 1;
     this.colTest.Caption = "% of Target";
     this.colTest.CellFormat.FormatString = "P";
     this.colTest.CellFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
     this.colTest.Name = "colTest";
     this.colTest.SummaryType = DevExpress.Data.PivotGrid.PivotSummaryType.Custom;
     //
     // label63
     //
     this.label63.BackColor = System.Drawing.Color.Transparent;
     this.label63.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label63.Location = new System.Drawing.Point(547, 10);
     this.label63.Name = "label63";
     this.label63.Size = new System.Drawing.Size(56, 16);
     this.label63.TabIndex = 36;
     this.label63.Text = "Category";
     //
     // cmbCategory
     //
     this.cmbCategory.EditValue = "cbGIROStatus";
     this.cmbCategory.Location = new System.Drawing.Point(608, 8);
     this.cmbCategory.Name = "cmbCategory";
     this.cmbCategory.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
     new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
     this.cmbCategory.Properties.LookAndFeel.UseDefaultLookAndFeel = false;
     this.cmbCategory.Size = new System.Drawing.Size(200, 20);
     this.cmbCategory.TabIndex = 35;
     this.cmbCategory.SelectedValueChanged += new System.EventHandler(this.cmbCategory_SelectedValueChanged);
     //
     // label2
     //
     this.label2.BackColor = System.Drawing.Color.Transparent;
     this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label2.Location = new System.Drawing.Point(0, 253);
     this.label2.Name = "label2";
     this.label2.Size = new System.Drawing.Size(112, 16);
     this.label2.TabIndex = 38;
     this.label2.Text = "Current Month Sales";
     this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // imageList1
     //
     this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
     this.imageList1.TransparentColor = System.Drawing.Color.Magenta;
     this.imageList1.Images.SetKeyName(0, "");
     this.imageList1.Images.SetKeyName(1, "");
     this.imageList1.Images.SetKeyName(2, "");
     this.imageList1.Images.SetKeyName(3, "");
     this.imageList1.Images.SetKeyName(4, "");
     this.imageList1.Images.SetKeyName(5, "");
     this.imageList1.Images.SetKeyName(6, "");
     //
     // PRINT1
     //
     this.PRINT1.EditValue = "PRINT";
     this.PRINT1.Location = new System.Drawing.Point(168, 432);
     this.PRINT1.Name = "PRINT1";
     this.PRINT1.Properties.Appearance.BackColor = System.Drawing.SystemColors.Control;
     this.PRINT1.Properties.Appearance.Options.UseBackColor = true;
     this.PRINT1.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
     this.PRINT1.Size = new System.Drawing.Size(40, 18);
     this.PRINT1.TabIndex = 139;
     this.PRINT1.OpenLink += new DevExpress.XtraEditors.Controls.OpenLinkEventHandler(this.PRINT1_OpenLink);
     //
     // printingSystem1
     //
     this.printingSystem1.Links.AddRange(new object[] {
     this.printableComponentLink1,
     this.printableComponentLink2,
     this.printableComponentLink3,
     this.printableComponentLink4});
     //
     // printableComponentLink1
     //
     this.printableComponentLink1.Component = this.CurrentGridIncomeAnalysis;
     this.printableComponentLink1.CustomPaperSize = new System.Drawing.Size(0, 0);
     this.printableComponentLink1.ImageStream = ((DevExpress.Utils.ImageCollectionStreamer)(resources.GetObject("printableComponentLink1.ImageStream")));
     this.printableComponentLink1.Landscape = true;
     this.printableComponentLink1.Margins = new System.Drawing.Printing.Margins(50, 50, 50, 50);
     this.printableComponentLink1.PageHeaderFooter = new DevExpress.XtraPrinting.PageHeaderFooter(new DevExpress.XtraPrinting.PageHeaderArea(new string[] {
         "\r\nCurrent Month Sales Report",
         "Income Analysis Report",
         "[Date Printed][Time Printed]"}, new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))), DevExpress.XtraPrinting.BrickAlignment.Near), new DevExpress.XtraPrinting.PageFooterArea(new string[] {
         "",
         "",
         "[Page # of Pages #]"}, new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))), DevExpress.XtraPrinting.BrickAlignment.Near));
     this.printableComponentLink1.PaperKind = System.Drawing.Printing.PaperKind.A4;
     this.printableComponentLink1.PrintingSystem = this.printingSystem1;
     this.printableComponentLink1.VerticalContentSplitting = DevExpress.XtraPrinting.VerticalContentSplitting.Smart;
     //
     // printableComponentLink2
     //
     this.printableComponentLink2.CustomPaperSize = new System.Drawing.Size(0, 0);
     this.printableComponentLink2.ImageStream = ((DevExpress.Utils.ImageCollectionStreamer)(resources.GetObject("printableComponentLink2.ImageStream")));
     this.printableComponentLink2.Landscape = true;
     this.printableComponentLink2.Margins = new System.Drawing.Printing.Margins(50, 50, 50, 50);
     this.printableComponentLink2.PageHeaderFooter = new DevExpress.XtraPrinting.PageHeaderFooter(new DevExpress.XtraPrinting.PageHeaderArea(new string[] {
         "Previus Two Month Sales Report",
         "",
         "[Date Printed][Time Printed]"}, new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))), DevExpress.XtraPrinting.BrickAlignment.Near), new DevExpress.XtraPrinting.PageFooterArea(new string[] {
         "",
         "",
         "[Page # of Pages #]"}, new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))), DevExpress.XtraPrinting.BrickAlignment.Near));
     this.printableComponentLink2.PaperKind = System.Drawing.Printing.PaperKind.A4;
     this.printableComponentLink2.PrintingSystem = this.printingSystem1;
     this.printableComponentLink2.VerticalContentSplitting = DevExpress.XtraPrinting.VerticalContentSplitting.Smart;
     //
     // printableComponentLink3
     //
     this.printableComponentLink3.CustomPaperSize = new System.Drawing.Size(0, 0);
     this.printableComponentLink3.ImageStream = ((DevExpress.Utils.ImageCollectionStreamer)(resources.GetObject("printableComponentLink3.ImageStream")));
     this.printableComponentLink3.Landscape = true;
     this.printableComponentLink3.Margins = new System.Drawing.Printing.Margins(50, 50, 50, 50);
     this.printableComponentLink3.PageHeaderFooter = new DevExpress.XtraPrinting.PageHeaderFooter(new DevExpress.XtraPrinting.PageHeaderArea(new string[] {
         "Previous 10 Days Sales Report",
         "",
         "[Date Printed][Time Printed]"}, new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))), DevExpress.XtraPrinting.BrickAlignment.Near), new DevExpress.XtraPrinting.PageFooterArea(new string[] {
         "",
         "",
         "[Page # of Pages #]"}, new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))), DevExpress.XtraPrinting.BrickAlignment.Near));
     this.printableComponentLink3.PaperKind = System.Drawing.Printing.PaperKind.A4;
     this.printableComponentLink3.PrintingSystem = this.printingSystem1;
     this.printableComponentLink3.VerticalContentSplitting = DevExpress.XtraPrinting.VerticalContentSplitting.Smart;
     //
     // printableComponentLink4
     //
     this.printableComponentLink4.CustomPaperSize = new System.Drawing.Size(0, 0);
     this.printableComponentLink4.ImageStream = ((DevExpress.Utils.ImageCollectionStreamer)(resources.GetObject("printableComponentLink4.ImageStream")));
     this.printableComponentLink4.Landscape = true;
     this.printableComponentLink4.Margins = new System.Drawing.Printing.Margins(50, 50, 50, 50);
     this.printableComponentLink4.PageHeaderFooter = new DevExpress.XtraPrinting.PageHeaderFooter(new DevExpress.XtraPrinting.PageHeaderArea(new string[] {
         "Previous 10 Days Sales Report",
         "",
         "[Date Printed][Time Printed]"}, new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))), DevExpress.XtraPrinting.BrickAlignment.Near), new DevExpress.XtraPrinting.PageFooterArea(new string[] {
         "",
         "",
         "[Page # of Pages #]"}, new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))), DevExpress.XtraPrinting.BrickAlignment.Near));
     this.printableComponentLink4.PaperKind = System.Drawing.Printing.PaperKind.A4;
     this.printableComponentLink4.PrintingSystem = this.printingSystem1;
     this.printableComponentLink4.VerticalContentSplitting = DevExpress.XtraPrinting.VerticalContentSplitting.Smart;
     //
     // hyperLinkEdit1
     //
     this.hyperLinkEdit1.EditValue = "PRINT";
     this.hyperLinkEdit1.Location = new System.Drawing.Point(120, 253);
     this.hyperLinkEdit1.Name = "hyperLinkEdit1";
     this.hyperLinkEdit1.Properties.Appearance.BackColor = System.Drawing.SystemColors.Control;
     this.hyperLinkEdit1.Properties.Appearance.Options.UseBackColor = true;
     this.hyperLinkEdit1.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
     this.hyperLinkEdit1.Size = new System.Drawing.Size(40, 18);
     this.hyperLinkEdit1.TabIndex = 140;
     this.hyperLinkEdit1.OpenLink += new DevExpress.XtraEditors.Controls.OpenLinkEventHandler(this.hyperLinkEdit1_OpenLink);
     //
     // PrevGridIncomeAnalysis
     //
     this.PrevGridIncomeAnalysis.AppearancePrint.Cell.Font = new System.Drawing.Font("Tahoma", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.PrevGridIncomeAnalysis.AppearancePrint.Cell.Options.UseFont = true;
     this.PrevGridIncomeAnalysis.AppearancePrint.CustomTotalCell.Font = new System.Drawing.Font("Tahoma", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.PrevGridIncomeAnalysis.AppearancePrint.CustomTotalCell.Options.UseFont = true;
     this.PrevGridIncomeAnalysis.AppearancePrint.FieldValue.Font = new System.Drawing.Font("Tahoma", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.PrevGridIncomeAnalysis.AppearancePrint.FieldValue.Options.UseFont = true;
     this.PrevGridIncomeAnalysis.AppearancePrint.FieldValueGrandTotal.Font = new System.Drawing.Font("Tahoma", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.PrevGridIncomeAnalysis.AppearancePrint.FieldValueGrandTotal.Options.UseFont = true;
     this.PrevGridIncomeAnalysis.AppearancePrint.FieldValueTotal.Font = new System.Drawing.Font("Tahoma", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.PrevGridIncomeAnalysis.AppearancePrint.FieldValueTotal.Options.UseFont = true;
     this.PrevGridIncomeAnalysis.AppearancePrint.FilterSeparator.Font = new System.Drawing.Font("Tahoma", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.PrevGridIncomeAnalysis.AppearancePrint.FilterSeparator.Options.UseFont = true;
     this.PrevGridIncomeAnalysis.AppearancePrint.GrandTotalCell.Font = new System.Drawing.Font("Tahoma", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.PrevGridIncomeAnalysis.AppearancePrint.GrandTotalCell.Options.UseFont = true;
     this.PrevGridIncomeAnalysis.AppearancePrint.Lines.Font = new System.Drawing.Font("Tahoma", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.PrevGridIncomeAnalysis.AppearancePrint.Lines.Options.UseFont = true;
     this.PrevGridIncomeAnalysis.AppearancePrint.TotalCell.Font = new System.Drawing.Font("Tahoma", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.PrevGridIncomeAnalysis.AppearancePrint.TotalCell.Options.UseFont = true;
     this.PrevGridIncomeAnalysis.Cursor = System.Windows.Forms.Cursors.Default;
     this.PrevGridIncomeAnalysis.Fields.AddRange(new DevExpress.XtraPivotGrid.PivotGridField[] {
     this.pivotGridField1,
     this.pivotGridField3,
     this.pivotGridField4,
     this.vTargetAmt,
     this.TargetAmt,
     this.pivotGridField13,
     this.TestTargetAmt});
     this.PrevGridIncomeAnalysis.Groups.AddRange(new DevExpress.XtraPivotGrid.PivotGridGroup[] {
     pivotGridGroup2});
     this.PrevGridIncomeAnalysis.Location = new System.Drawing.Point(-8, 450);
     this.PrevGridIncomeAnalysis.Name = "PrevGridIncomeAnalysis";
     this.PrevGridIncomeAnalysis.OptionsBehavior.ApplyBestFitOnFieldDragging = true;
     this.PrevGridIncomeAnalysis.OptionsCustomization.AllowDrag = false;
     this.PrevGridIncomeAnalysis.OptionsCustomization.AllowExpand = false;
     this.PrevGridIncomeAnalysis.OptionsCustomization.AllowHideFields = DevExpress.XtraPivotGrid.AllowHideFieldsType.Never;
     this.PrevGridIncomeAnalysis.OptionsCustomization.AllowSort = false;
     this.PrevGridIncomeAnalysis.OptionsDataField.Area = DevExpress.XtraPivotGrid.PivotDataArea.RowArea;
     this.PrevGridIncomeAnalysis.OptionsDataField.AreaIndex = 1;
     this.PrevGridIncomeAnalysis.OptionsPrint.PrintDataHeaders = DevExpress.Utils.DefaultBoolean.False;
     this.PrevGridIncomeAnalysis.OptionsPrint.PrintFilterHeaders = DevExpress.Utils.DefaultBoolean.False;
     this.PrevGridIncomeAnalysis.OptionsPrint.UsePrintAppearance = true;
     this.PrevGridIncomeAnalysis.OptionsView.ShowDataHeaders = false;
     this.PrevGridIncomeAnalysis.OptionsView.ShowFilterHeaders = false;
     this.PrevGridIncomeAnalysis.OptionsView.ShowFilterSeparatorBar = false;
     this.PrevGridIncomeAnalysis.OptionsView.ShowRowGrandTotals = false;
     this.PrevGridIncomeAnalysis.Size = new System.Drawing.Size(960, 176);
     this.PrevGridIncomeAnalysis.TabIndex = 142;
     //
     // pivotGridField1
     //
     this.pivotGridField1.Area = DevExpress.XtraPivotGrid.PivotArea.DataArea;
     this.pivotGridField1.AreaIndex = 0;
     this.pivotGridField1.Caption = "Branch Sales";
     this.pivotGridField1.ExpandedInFieldsGroup = false;
     this.pivotGridField1.FieldName = "mNettAmount";
     this.pivotGridField1.MinWidth = 80;
     this.pivotGridField1.Name = "pivotGridField1";
     this.pivotGridField1.Options.AllowDrag = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField1.Options.AllowExpand = DevExpress.Utils.DefaultBoolean.True;
     this.pivotGridField1.Options.AllowFilter = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField1.Options.AllowSort = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField1.TotalCellFormat.FormatString = "f2";
     this.pivotGridField1.TotalCellFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
     this.pivotGridField1.TotalValueFormat.FormatString = "f2";
     this.pivotGridField1.TotalValueFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
     this.pivotGridField1.ValueFormat.FormatString = "f2";
     this.pivotGridField1.ValueFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
     this.pivotGridField1.Width = 80;
     //
     // pivotGridField3
     //
     this.pivotGridField3.Area = DevExpress.XtraPivotGrid.PivotArea.ColumnArea;
     this.pivotGridField3.AreaIndex = 0;
     this.pivotGridField3.Caption = "Branch";
     this.pivotGridField3.FieldName = "strBranchCode";
     this.pivotGridField3.MinWidth = 10;
     this.pivotGridField3.Name = "pivotGridField3";
     this.pivotGridField3.Options.AllowDrag = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField3.Options.AllowExpand = DevExpress.Utils.DefaultBoolean.True;
     this.pivotGridField3.Options.AllowFilter = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField3.Options.AllowSort = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField3.Width = 80;
     //
     // pivotGridField4
     //
     this.pivotGridField4.Area = DevExpress.XtraPivotGrid.PivotArea.DataArea;
     this.pivotGridField4.AreaIndex = 1;
     this.pivotGridField4.FieldName = "mTotalAmount";
     this.pivotGridField4.Name = "pivotGridField4";
     this.pivotGridField4.Options.AllowDrag = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField4.Options.AllowExpand = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField4.Options.AllowFilter = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField4.Options.AllowSort = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField4.TotalCellFormat.FormatString = "f2";
     this.pivotGridField4.TotalCellFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
     this.pivotGridField4.TotalValueFormat.FormatString = "f2";
     this.pivotGridField4.TotalValueFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
     this.pivotGridField4.ValueFormat.FormatString = "f2";
     this.pivotGridField4.ValueFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
     this.pivotGridField4.Visible = false;
     this.pivotGridField4.Width = 80;
     //
     // vTargetAmt
     //
     this.vTargetAmt.Area = DevExpress.XtraPivotGrid.PivotArea.DataArea;
     this.vTargetAmt.AreaIndex = 1;
     this.vTargetAmt.Caption = "Target Amount";
     this.vTargetAmt.Name = "vTargetAmt";
     this.vTargetAmt.Options.AllowDrag = DevExpress.Utils.DefaultBoolean.False;
     this.vTargetAmt.Options.AllowExpand = DevExpress.Utils.DefaultBoolean.False;
     this.vTargetAmt.Options.AllowFilter = DevExpress.Utils.DefaultBoolean.False;
     this.vTargetAmt.Options.AllowSort = DevExpress.Utils.DefaultBoolean.False;
     this.vTargetAmt.SummaryType = DevExpress.Data.PivotGrid.PivotSummaryType.Custom;
     this.vTargetAmt.TotalCellFormat.FormatString = "f2";
     this.vTargetAmt.TotalCellFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
     this.vTargetAmt.TotalValueFormat.FormatString = "f2";
     this.vTargetAmt.TotalValueFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
     this.vTargetAmt.UnboundFieldName = "gvTargetAmt";
     this.vTargetAmt.UnboundType = DevExpress.Data.UnboundColumnType.Decimal;
     this.vTargetAmt.ValueFormat.FormatString = "f2";
     this.vTargetAmt.ValueFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
     //
     // TargetAmt
     //
     this.TargetAmt.Area = DevExpress.XtraPivotGrid.PivotArea.DataArea;
     this.TargetAmt.AreaIndex = 2;
     this.TargetAmt.Caption = "Amount > Target";
     this.TargetAmt.Name = "TargetAmt";
     this.TargetAmt.SummaryType = DevExpress.Data.PivotGrid.PivotSummaryType.Custom;
     this.TargetAmt.TotalValueFormat.FormatString = "f2";
     this.TargetAmt.TotalValueFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
     this.TargetAmt.UnboundFieldName = "TargetAmount";
     this.TargetAmt.UnboundType = DevExpress.Data.UnboundColumnType.Decimal;
     this.TargetAmt.ValueFormat.FormatString = "f2";
     this.TargetAmt.ValueFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
     this.TargetAmt.Width = 90;
     //
     // pivotGridField13
     //
     this.pivotGridField13.Area = DevExpress.XtraPivotGrid.PivotArea.RowArea;
     this.pivotGridField13.AreaIndex = 0;
     this.pivotGridField13.Caption = "Month";
     this.pivotGridField13.FieldName = "dtMonth";
     this.pivotGridField13.Name = "pivotGridField13";
     this.pivotGridField13.Options.AllowDrag = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField13.Options.AllowFilter = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField13.Width = 80;
     //
     // TestTargetAmt
     //
     this.TestTargetAmt.Area = DevExpress.XtraPivotGrid.PivotArea.ColumnArea;
     this.TestTargetAmt.AreaIndex = 1;
     this.TestTargetAmt.FieldName = "TargetAmount";
     this.TestTargetAmt.Name = "TestTargetAmt";
     this.TestTargetAmt.Visible = false;
     this.TestTargetAmt.Width = 90;
     //
     // label3
     //
     this.label3.BackColor = System.Drawing.Color.Transparent;
     this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label3.Location = new System.Drawing.Point(-1, 8);
     this.label3.Name = "label3";
     this.label3.Size = new System.Drawing.Size(136, 16);
     this.label3.TabIndex = 143;
     this.label3.Text = "Previous 10  Days Sales";
     this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // label1
     //
     this.label1.BackColor = System.Drawing.Color.Transparent;
     this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label1.Location = new System.Drawing.Point(0, 432);
     this.label1.Name = "label1";
     this.label1.Size = new System.Drawing.Size(96, 16);
     this.label1.TabIndex = 144;
     this.label1.Text = "Selected Month:";
     this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     this.label1.Click += new System.EventHandler(this.label1_Click);
     //
     // hyperLinkEdit2
     //
     this.hyperLinkEdit2.EditValue = "PRINT";
     this.hyperLinkEdit2.Location = new System.Drawing.Point(199, 8);
     this.hyperLinkEdit2.Name = "hyperLinkEdit2";
     this.hyperLinkEdit2.Properties.Appearance.BackColor = System.Drawing.SystemColors.Control;
     this.hyperLinkEdit2.Properties.Appearance.Options.UseBackColor = true;
     this.hyperLinkEdit2.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
     this.hyperLinkEdit2.Size = new System.Drawing.Size(40, 18);
     this.hyperLinkEdit2.TabIndex = 147;
     //
     // btn_Add
     //
     this.btn_Add.Appearance.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.btn_Add.Appearance.Options.UseFont = true;
     this.btn_Add.Appearance.Options.UseTextOptions = true;
     this.btn_Add.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
     this.btn_Add.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Top;
     this.btn_Add.Appearance.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;
     this.btn_Add.ImageIndex = 0;
     this.btn_Add.ImageList = this.imageList1;
     this.btn_Add.ImeMode = System.Windows.Forms.ImeMode.On;
     this.btn_Add.Location = new System.Drawing.Point(135, 8);
     this.btn_Add.Name = "btn_Add";
     this.btn_Add.Size = new System.Drawing.Size(32, 16);
     this.btn_Add.TabIndex = 146;
     this.btn_Add.Click += new System.EventHandler(this.btn_Add_Click);
     //
     // btn_Del
     //
     this.btn_Del.Appearance.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.btn_Del.Appearance.Options.UseFont = true;
     this.btn_Del.Appearance.Options.UseTextOptions = true;
     this.btn_Del.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
     this.btn_Del.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Top;
     this.btn_Del.Appearance.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;
     this.btn_Del.ImageIndex = 1;
     this.btn_Del.ImageList = this.imageList1;
     this.btn_Del.Location = new System.Drawing.Point(168, 8);
     this.btn_Del.Name = "btn_Del";
     this.btn_Del.Size = new System.Drawing.Size(24, 16);
     this.btn_Del.TabIndex = 145;
     this.btn_Del.Click += new System.EventHandler(this.btn_Del_Click);
     //
     // pvGrandTotal10Days
     //
     this.pvGrandTotal10Days.Cursor = System.Windows.Forms.Cursors.Default;
     this.pvGrandTotal10Days.Fields.AddRange(new DevExpress.XtraPivotGrid.PivotGridField[] {
     this.pivotGridField16,
     this.pivotGridField17});
     this.pvGrandTotal10Days.Groups.AddRange(new DevExpress.XtraPivotGrid.PivotGridGroup[] {
     pivotGridGroup3});
     this.pvGrandTotal10Days.Location = new System.Drawing.Point(0, 32);
     this.pvGrandTotal10Days.Name = "pvGrandTotal10Days";
     this.pvGrandTotal10Days.OptionsCustomization.AllowDrag = false;
     this.pvGrandTotal10Days.OptionsCustomization.AllowExpand = false;
     this.pvGrandTotal10Days.OptionsCustomization.AllowSort = false;
     this.pvGrandTotal10Days.OptionsDataField.Area = DevExpress.XtraPivotGrid.PivotDataArea.RowArea;
     this.pvGrandTotal10Days.OptionsDataField.AreaIndex = 1;
     this.pvGrandTotal10Days.OptionsView.ShowDataHeaders = false;
     this.pvGrandTotal10Days.OptionsView.ShowFilterHeaders = false;
     this.pvGrandTotal10Days.OptionsView.ShowRowGrandTotals = false;
     this.pvGrandTotal10Days.Size = new System.Drawing.Size(960, 200);
     this.pvGrandTotal10Days.TabIndex = 150;
     //
     // pivotGridField16
     //
     this.pivotGridField16.Area = DevExpress.XtraPivotGrid.PivotArea.DataArea;
     this.pivotGridField16.AreaIndex = 0;
     this.pivotGridField16.Caption = "Nett Amount";
     this.pivotGridField16.FieldName = "mNettAmount";
     this.pivotGridField16.Name = "pivotGridField16";
     //
     // pivotGridField17
     //
     this.pivotGridField17.Area = DevExpress.XtraPivotGrid.PivotArea.ColumnArea;
     this.pivotGridField17.AreaIndex = 0;
     this.pivotGridField17.Caption = "Branch";
     this.pivotGridField17.FieldName = "strBranchCode";
     this.pivotGridField17.Name = "pivotGridField17";
     this.pivotGridField17.Options.AllowDrag = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField17.Options.AllowExpand = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField17.Options.AllowFilter = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField17.Options.AllowSort = DevExpress.Utils.DefaultBoolean.False;
     //
     // ThirdGridIncomeAnalysis
     //
     this.ThirdGridIncomeAnalysis.Cursor = System.Windows.Forms.Cursors.Default;
     this.ThirdGridIncomeAnalysis.Fields.AddRange(new DevExpress.XtraPivotGrid.PivotGridField[] {
     this.pivotGridField11,
     this.pivotGridField12,
     this.pivotGridField9});
     this.ThirdGridIncomeAnalysis.Groups.AddRange(new DevExpress.XtraPivotGrid.PivotGridGroup[] {
     pivotGridGroup4});
     this.ThirdGridIncomeAnalysis.Location = new System.Drawing.Point(0, 27);
     this.ThirdGridIncomeAnalysis.Name = "ThirdGridIncomeAnalysis";
     this.ThirdGridIncomeAnalysis.OptionsCustomization.AllowDrag = false;
     this.ThirdGridIncomeAnalysis.OptionsCustomization.AllowExpand = false;
     this.ThirdGridIncomeAnalysis.OptionsCustomization.AllowSort = false;
     this.ThirdGridIncomeAnalysis.OptionsDataField.Area = DevExpress.XtraPivotGrid.PivotDataArea.RowArea;
     this.ThirdGridIncomeAnalysis.OptionsDataField.AreaIndex = 1;
     this.ThirdGridIncomeAnalysis.OptionsView.ShowDataHeaders = false;
     this.ThirdGridIncomeAnalysis.OptionsView.ShowFilterHeaders = false;
     this.ThirdGridIncomeAnalysis.OptionsView.ShowRowGrandTotals = false;
     this.ThirdGridIncomeAnalysis.Size = new System.Drawing.Size(960, 224);
     this.ThirdGridIncomeAnalysis.TabIndex = 151;
     //
     // pivotGridField11
     //
     this.pivotGridField11.Area = DevExpress.XtraPivotGrid.PivotArea.DataArea;
     this.pivotGridField11.AreaIndex = 0;
     this.pivotGridField11.Caption = "Nett Amount";
     this.pivotGridField11.FieldName = "mNettAmount";
     this.pivotGridField11.Name = "pivotGridField11";
     this.pivotGridField11.Width = 90;
     //
     // pivotGridField12
     //
     this.pivotGridField12.Area = DevExpress.XtraPivotGrid.PivotArea.ColumnArea;
     this.pivotGridField12.AreaIndex = 0;
     this.pivotGridField12.Caption = "Branch";
     this.pivotGridField12.FieldName = "strBranchCode";
     this.pivotGridField12.Name = "pivotGridField12";
     this.pivotGridField12.Options.AllowDrag = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField12.Options.AllowExpand = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField12.Options.AllowFilter = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField12.Options.AllowSort = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField12.Width = 90;
     //
     // pivotGridField9
     //
     this.pivotGridField9.Area = DevExpress.XtraPivotGrid.PivotArea.RowArea;
     this.pivotGridField9.AreaIndex = 0;
     this.pivotGridField9.Caption = "Date";
     this.pivotGridField9.FieldName = "dtDate";
     this.pivotGridField9.Name = "pivotGridField9";
     this.pivotGridField9.Options.AllowDrag = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField9.Options.AllowExpand = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField9.Options.AllowFilter = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField9.Options.AllowSort = DevExpress.Utils.DefaultBoolean.False;
     this.pivotGridField9.ValueFormat.FormatString = "d";
     this.pivotGridField9.ValueFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
     this.pivotGridField9.Width = 80;
     //
     // cmbMonth
     //
     this.cmbMonth.Items.AddRange(new object[] {
     "1",
     "2",
     "3",
     "4",
     "5",
     "6",
     "7",
     "8",
     "9",
     "10",
     "11",
     "12"});
     this.cmbMonth.Location = new System.Drawing.Point(440, 5);
     this.cmbMonth.Name = "cmbMonth";
     this.cmbMonth.Size = new System.Drawing.Size(104, 21);
     this.cmbMonth.TabIndex = 152;
     this.cmbMonth.Text = "-Select Month-";
     this.cmbMonth.SelectedIndexChanged += new System.EventHandler(this.cmbMonth_SelectedIndexChanged);
     //
     // label4
     //
     this.label4.BackColor = System.Drawing.Color.Transparent;
     this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label4.Location = new System.Drawing.Point(392, 10);
     this.label4.Name = "label4";
     this.label4.Size = new System.Drawing.Size(40, 16);
     this.label4.TabIndex = 153;
     this.label4.Text = "Month";
     //
     // RPIncomeAnalysis
     //
     this.AutoScroll = true;
     this.ClientSize = new System.Drawing.Size(994, 688);
     this.Controls.Add(this.label4);
     this.Controls.Add(this.cmbMonth);
     this.Controls.Add(this.hyperLinkEdit2);
     this.Controls.Add(this.btn_Add);
     this.Controls.Add(this.btn_Del);
     this.Controls.Add(this.label1);
     this.Controls.Add(this.label3);
     this.Controls.Add(this.PrevGridIncomeAnalysis);
     this.Controls.Add(this.hyperLinkEdit1);
     this.Controls.Add(this.PRINT1);
     this.Controls.Add(this.label2);
     this.Controls.Add(this.label63);
     this.Controls.Add(this.cmbCategory);
     this.Controls.Add(this.CurrentGridIncomeAnalysis);
     this.Controls.Add(this.ThirdGridIncomeAnalysis);
     this.Controls.Add(this.pvGrandTotal10Days);
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
     this.MaximizeBox = false;
     this.MinimizeBox = false;
     this.Name = "RPIncomeAnalysis";
     this.Padding = new System.Windows.Forms.Padding(0, 0, 0, 50);
     this.ShowInTaskbar = false;
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text = "Income Analysis Report";
     this.TopMost = true;
     this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
     this.Load += new System.EventHandler(this.ShowReport_Load);
     ((System.ComponentModel.ISupportInitialize)(this.CurrentGridIncomeAnalysis)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.cmbCategory.Properties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.PRINT1.Properties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.printingSystem1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.hyperLinkEdit1.Properties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.PrevGridIncomeAnalysis)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.hyperLinkEdit2.Properties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.pvGrandTotal10Days)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.ThirdGridIncomeAnalysis)).EndInit();
     this.ResumeLayout(false);
 }
Beispiel #18
0
        public void Print()
        {
            try {
                //we change print styles
                foreach (SchedulerPrintStyle schedulerPrintStyle in schedulerControl1.PrintStyles)
                {
                    PrintStyleWithAppointmentHeight printStyle = schedulerPrintStyle as PrintStyleWithAppointmentHeight;
                    //we change print style
                    if (printStyle != null)
                    {
                        printStyle.CalendarHeaderVisible = false;

                        if (StartDatePickerTop.Checked) printStyle.StartRangeDate = CalendarFilter.StartDate;
                        if (EndDatePickerTop.Checked) printStyle.EndRangeDate = CalendarFilter.EndDate;

                    }

                    PrintStyleWithResourceOptions printresources = schedulerPrintStyle as PrintStyleWithResourceOptions;
                    if (printresources != null)
                    {
                        printresources.CalendarHeaderVisible = false;
                        if (StartDatePickerTop.Checked) printresources.StartRangeDate = CalendarFilter.StartDate;
                        if (EndDatePickerTop.Checked) printresources.EndRangeDate = CalendarFilter.EndDate;

                    }

                    Common.FontSize = 8.25f;
                    schedulerPrintStyle.AppointmentFont = new Font(Common.FontName, Common.FontSize - 1);
                    schedulerPrintStyle.HeadingsFont = new Font(Common.FontName, Common.FontSize );
                    schedulerPrintStyle.PageSettings.Margins = new Margins(10, 10, 10, 10);
                    schedulerPrintStyle.PageSettings.Landscape = true;

            //                    PrintableComponentLink pcl = new PrintableComponentLink(new
            //PrintingSystem());
            //                    pcl.CreateMarginalHeaderArea += new
            //                    CreateAreaEventHandler(pcl_CreateMarginalHeaderArea);
            //                    schedulerControl1.OptionsPrint.PrintStyle =
            //                    DevExpress.XtraScheduler.Printing.SchedulerPrintStyleKind.Weekly;
            //                    pcl.Component = this.schedulerControl1;
            //                    pcl.ShowPreview();

                    //------------------
                    PrinterSettings settings = new PrinterSettings();
                    //Set PageSize to 'A4'
                    bool found = false;
                    foreach (PaperSize size in settings.PaperSizes)
                    {
                        if (size.PaperName == "A4, 210x297 mm")
                            found = true;
                        if (found)
                        {
                            schedulerPrintStyle.PageSettings.PaperSize = size;
                            break;
                        }
                        else continue;
                    }
                }

                ///Setting printing style
                switch (_viewModeName)
                {
                    case "Day":
                        schedulerControl1.OptionsPrint.PrintStyle = SchedulerPrintStyleKind.Daily;
                        break;
                    case "Week":
                        schedulerControl1.OptionsPrint.PrintStyle = SchedulerPrintStyleKind.Weekly;
                        break;
                    case "Month":
                        schedulerControl1.OptionsPrint.PrintStyle = SchedulerPrintStyleKind.Monthly;
                        //schedulerControl1.
                        break;
                }
                //print
                if (_viewModeName == "Week")
                    schedulerControl1.OptionsPrint.PrintStyle = SchedulerPrintStyleKind.Weekly;
                //schedulerControl1.PrintStyles.
                //schedulerControl1.print

                schedulerControl1.ShowPrintOptionsForm();

                if(_viewModeName == "Week")
                    schedulerControl1.OptionsPrint.PrintStyle = SchedulerPrintStyleKind.Weekly;
                DevExpress.XtraPrinting.PrintableComponentLink comp = new DevExpress.XtraPrinting.PrintableComponentLink(new PrintingSystem());
                comp.Component = schedulerControl1;
                PageHeaderFooter footer = comp.PageHeaderFooter as PageHeaderFooter;

                if (footer != null)
                {
                    footer.Footer.Font = new Font(footer.Footer.Font.FontFamily, 10, FontStyle.Bold);
                    footer.Footer.Content.Add(GetFilterText());
                }

                comp.Landscape = schedulerControl1.ActivePrintStyle.PageSettings.Landscape;
                comp.PaperKind = PaperKind.A4;
                comp.Margins.Bottom = 60;
                comp.Margins.Top = 10;
                comp.Margins.Left = 10;
                comp.Margins.Right = 10;
                comp.PrintingSystem.PageMargins.Right = 10;
                comp.PrintingSystem.PageMargins.Left = 10;
                comp.PrintingSystem.PageMargins.Top = 10;
                comp.PrintingSystem.PageMargins.Bottom = 60;
                comp.CreateMarginalFooterArea += new CreateAreaEventHandler(pcl_CreateMarginalFooterArea);
                //comp.CreateDocument();
                comp.ShowPreviewDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, ex.Source);
            }
        }
Beispiel #19
0
 /// <summary>
 /// 定义一个protected 的构造函数以阻止外部直接创建。
 /// </summary>
 /// <summary>
 /// 构造函数...
 /// </summary>
 protected XPrint()
 {
     _PS            = new DevExpress.XtraPrinting.PrintingSystem();
     _PrintableLink = new DevExpress.XtraPrinting.PrintableComponentLink(_PS);
 }
Beispiel #20
-1
        /// <summary>
        /// ��ʾ��ӡԤ������
        /// </summary>
        /// <param name="component">������GridContronl����TreeList��������</param>
        /// <param name="headerTitle">����</param>
        /// <param name="landscape">true��ʾ����false��ʾ����</param>
        /// <param name="headerFont">��������</param>
        public static void ShowPreview(IPrintable component, string headerTitle, bool landscape, Font headerFont)
        {
            PrintingSystem ps = new DevExpress.XtraPrinting.PrintingSystem();
            DevExpress.XtraPrinting.PrintableComponentLink link = new DevExpress.XtraPrinting.PrintableComponentLink(ps);
            ps.Links.Add(link);
            link.Component = component;//��������ǿɴ�ӡ�IJ���

            PageHeaderFooter phf = link.PageHeaderFooter as PageHeaderFooter;
            phf.Header.Content.AddRange(new string[]{"", headerTitle, ""});
            phf.Header.Font = headerFont;
            phf.Header.LineAlignment = BrickAlignment.Center;
            phf.Footer.Content.AddRange(new string[] { DateTime.Now.ToString("yyyy-MM-dd"), "", "[Page # of Pages #]" });
            phf.Footer.LineAlignment = BrickAlignment.Center;
            link.Landscape = landscape;
            link.CreateDocument(); //�����ĵ�

            //ps.PreviewFormEx.Menu.MenuItems[0].MenuItems.RemoveAt(6) ;
            //ps.PreviewFormEx.Menu.MenuItems[0].MenuItems.RemoveAt(5);
            //ps.PreviewFormEx.Menu.MenuItems[0].MenuItems.RemoveAt(4);
            //ps.PreviewFormEx.PrintPreviewBar.Buttons.RemoveAt(4);
            //ps.PreviewFormEx.PrintPreviewBar.Buttons.RemoveAt(23);
            //ps.PreviewFormEx.PrintPreviewBar.Buttons.RemoveAt(23);lgm

            ps.PreviewFormEx.Text=headerTitle;

            ps.PreviewFormEx.Show();//����Ԥ��
        }