Exemplo n.º 1
0
        public static void InitPrintGrid(frmTPhieuThongKeChange frm,bool IsLandscape)
        {
            frm.barItemIn.Visibility = BarItemVisibility.Never;

            //   link.ShowPreviewDialog();

            BarButtonItem itemXemtruoc = new BarButtonItem();
            itemXemtruoc.Caption = "&Xem trước";
            itemXemtruoc.PaintStyle = BarItemPaintStyle.CaptionGlyph;
            itemXemtruoc.Glyph = FrameworkParams.imageStore.GetImage1616("fwPrintPreview.png");
            itemXemtruoc.ItemClick += delegate(object sender, ItemClickEventArgs e)
            {
                if (FrameworkParams.headerLetter != null)
                {
                    PrintableComponentLink link = FrameworkParams.headerLetter.Draw(frm.pivotGridMaster, frm.Text.ToUpper(),
                            "Ngày báo cáo: " + DateTime.Today.ToString(FrameworkParams.option.dateFormat));
                    link.PrintingSystem.PageSettings.Landscape = IsLandscape;
                    link.ShowPreview();
                }
                else
                {
                   frm.pivotGridMaster.ShowPrintPreview();
                }
            };

            PopupMenu popupMenu = new DevExpress.XtraBars.PopupMenu(frm.barManager1.Container);
            popupMenu.Manager = frm.barManager1;
            popupMenu.LinksPersistInfo.Add(new LinkPersistInfo(itemXemtruoc));

            BarButtonItem itemPrint = new BarButtonItem();
            itemPrint.Caption = "&In";
            itemPrint.PaintStyle = BarItemPaintStyle.CaptionGlyph;
            itemPrint.Glyph = frm.barItemIn.Glyph;
            itemPrint.ButtonStyle = BarButtonStyle.DropDown;
            itemPrint.DropDownControl = popupMenu;
            itemPrint.Visibility = BarItemVisibility.Always;
            itemPrint.ItemClick += delegate(object sender, ItemClickEventArgs e)
            {
                if (FrameworkParams.headerLetter != null)
                {
                    PrintableComponentLink link = FrameworkParams.headerLetter.Draw(frm.pivotGridMaster,frm.Text.ToUpper(),
                             "Ngày báo cáo: " + DateTime.Today.ToString(FrameworkParams.option.dateFormat));
                    link.PrintingSystem.PageSettings.Landscape = IsLandscape;
                    link.PrintDlg();
                }
                else
                {
                    frm.pivotGridMaster.Print();
                }
            };
            int index = 0;
            for (int i = 0; i < frm.MainBar.LinksPersistInfo.Count; i++)
            {
                if (frm.MainBar.LinksPersistInfo[i].Item.Name == frm.barItemIn.Name)
                {
                    index = i;
                    break;
                }
            }
            frm.MainBar.LinksPersistInfo.Insert(index, new LinkPersistInfo(itemPrint, true));
            frm.barManager1.Items.AddRange(new BarItem[] { itemPrint, itemXemtruoc });
        }
Exemplo n.º 2
0
 public static void FormatButtonTimKiem(frmTPhieuThongKeChange frm)
 {
     FormatButtonTimKiem(frm.barButtonItemSearch);
 }
Exemplo n.º 3
0
 public static void FormatButtonTimKiem(frmTPhieuThongKeChange frm)
 {
     frm.barButtonItemSearch.Appearance.ForeColor = Color.Blue;
     Font bk = frm.barButtonItemSearch.Font;
     frm.barButtonItemSearch.Appearance.Font = new Font(bk, FontStyle.Bold);
     frm.barButtonItemSearch.Appearance.Options.UseFont = true;
     frm.barButtonItemSearch.Appearance.Options.UseForeColor = true;
 }
Exemplo n.º 4
0
 public TPhieuThongKeFix(frmTPhieuThongKeChange phieuTK, bool hasFilterPart)
     : base(null, null, "")
 {
     this.that = phieuTK;
     this.filter = hasFilterPart;
     this.HamDung();
     this._tenBaoCao = this.that.Text.ToUpper();
 }