Пример #1
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            ReportComponentBase c = writer.DiffObject as ReportComponentBase;

            base.Serialize(writer);

            if (Exportable != c.Exportable)
            {
                writer.WriteBool("Exportable", Exportable);
            }
            if (ExportableExpression != c.ExportableExpression)
            {
                writer.WriteStr("ExportableExpression", ExportableExpression);
            }
            Border.Serialize(writer, "Border", c.Border);
            //if(Fill != c.Fill)
            Fill.Serialize(writer, "Fill", c.Fill);
            if (Cursor != c.Cursor && !Config.WebMode)
            {
                writer.WriteValue("Cursor", Cursor);
            }
            Hyperlink.Serialize(writer, c.Hyperlink);
            if (Bookmark != c.Bookmark)
            {
                writer.WriteStr("Bookmark", Bookmark);
            }
            if (writer.SerializeTo != SerializeTo.Preview)
            {
                if (CanGrow != c.CanGrow)
                {
                    writer.WriteBool("CanGrow", CanGrow);
                }
                if (CanShrink != c.CanShrink)
                {
                    writer.WriteBool("CanShrink", CanShrink);
                }
                if (GrowToBottom != c.GrowToBottom)
                {
                    writer.WriteBool("GrowToBottom", GrowToBottom);
                }
                if (ShiftMode != c.ShiftMode)
                {
                    writer.WriteValue("ShiftMode", ShiftMode);
                }
                if (FlagSerializeStyle && Style != c.Style)
                {
                    writer.WriteStr("Style", Style);
                }
                if (EvenStyle != c.EvenStyle)
                {
                    writer.WriteStr("EvenStyle", EvenStyle);
                }
                if (EvenStylePriority != c.EvenStylePriority)
                {
                    writer.WriteValue("EvenStylePriority", EvenStylePriority);
                }
                if (HoverStyle != c.HoverStyle)
                {
                    writer.WriteStr("HoverStyle", HoverStyle);
                }
                if (PrintOn != c.PrintOn)
                {
                    writer.WriteValue("PrintOn", PrintOn);
                }
                if (BeforePrintEvent != c.BeforePrintEvent)
                {
                    writer.WriteStr("BeforePrintEvent", BeforePrintEvent);
                }
                if (AfterPrintEvent != c.AfterPrintEvent)
                {
                    writer.WriteStr("AfterPrintEvent", AfterPrintEvent);
                }
                if (AfterDataEvent != c.AfterDataEvent)
                {
                    writer.WriteStr("AfterDataEvent", AfterDataEvent);
                }
                if (ClickEvent != c.ClickEvent)
                {
                    writer.WriteStr("ClickEvent", ClickEvent);
                }
                if (MouseMoveEvent != c.MouseMoveEvent)
                {
                    writer.WriteStr("MouseMoveEvent", MouseMoveEvent);
                }
                if (MouseUpEvent != c.MouseUpEvent)
                {
                    writer.WriteStr("MouseUpEvent", MouseUpEvent);
                }
                if (MouseDownEvent != c.MouseDownEvent)
                {
                    writer.WriteStr("MouseDownEvent", MouseDownEvent);
                }
                if (MouseEnterEvent != c.MouseEnterEvent)
                {
                    writer.WriteStr("MouseEnterEvent", MouseEnterEvent);
                }
                if (MouseLeaveEvent != c.MouseLeaveEvent)
                {
                    writer.WriteStr("MouseLeaveEvent", MouseLeaveEvent);
                }
            }
        }
Пример #2
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            ReportPage c = writer.DiffObject as ReportPage;

            base.Serialize(writer);

            if (Landscape != c.Landscape)
            {
                writer.WriteBool("Landscape", Landscape);
            }
            if (FloatDiff(PaperWidth, c.PaperWidth))
            {
                writer.WriteFloat("PaperWidth", PaperWidth);
            }
            if (FloatDiff(PaperHeight, c.PaperHeight))
            {
                writer.WriteFloat("PaperHeight", PaperHeight);
            }
            if (RawPaperSize != c.RawPaperSize)
            {
                writer.WriteInt("RawPaperSize", RawPaperSize);
            }
            if (FloatDiff(LeftMargin, c.LeftMargin))
            {
                writer.WriteFloat("LeftMargin", LeftMargin);
            }
            if (FloatDiff(TopMargin, c.TopMargin))
            {
                writer.WriteFloat("TopMargin", TopMargin);
            }
            if (FloatDiff(RightMargin, c.RightMargin))
            {
                writer.WriteFloat("RightMargin", RightMargin);
            }
            if (FloatDiff(BottomMargin, c.BottomMargin))
            {
                writer.WriteFloat("BottomMargin", BottomMargin);
            }
            if (MirrorMargins != c.MirrorMargins)
            {
                writer.WriteBool("MirrorMargins", MirrorMargins);
            }
            WritePreview(writer, c);
            Columns.Serialize(writer, c.Columns);
            if (Guides.Count > 0)
            {
                writer.WriteValue("Guides", Guides);
            }
            Border.Serialize(writer, "Border", c.Border);
            Fill.Serialize(writer, "Fill", c.Fill);
            Watermark.Serialize(writer, "Watermark", c.Watermark);
            if (TitleBeforeHeader != c.TitleBeforeHeader)
            {
                writer.WriteBool("TitleBeforeHeader", TitleBeforeHeader);
            }
            if (OutlineExpression != c.OutlineExpression)
            {
                writer.WriteStr("OutlineExpression", OutlineExpression);
            }
            if (PrintOnPreviousPage != c.PrintOnPreviousPage)
            {
                writer.WriteBool("PrintOnPreviousPage", PrintOnPreviousPage);
            }
            if (ResetPageNumber != c.ResetPageNumber)
            {
                writer.WriteBool("ResetPageNumber", ResetPageNumber);
            }
            if (ExtraDesignWidth != c.ExtraDesignWidth)
            {
                writer.WriteBool("ExtraDesignWidth", ExtraDesignWidth);
            }
            if (StartOnOddPage != c.StartOnOddPage)
            {
                writer.WriteBool("StartOnOddPage", StartOnOddPage);
            }
            if (BackPage != c.BackPage)
            {
                writer.WriteBool("BackPage", BackPage);
            }
            if (StartPageEvent != c.StartPageEvent)
            {
                writer.WriteStr("StartPageEvent", StartPageEvent);
            }
            if (FinishPageEvent != c.FinishPageEvent)
            {
                writer.WriteStr("FinishPageEvent", FinishPageEvent);
            }
            if (ManualBuildEvent != c.ManualBuildEvent)
            {
                writer.WriteStr("ManualBuildEvent", ManualBuildEvent);
            }
            if (UnlimitedHeight != c.UnlimitedHeight)
            {
                writer.WriteBool("UnlimitedHeight", UnlimitedHeight);
            }
            if (PrintOnRollPaper != c.PrintOnRollPaper)
            {
                writer.WriteBool("PrintOnRollPaper", PrintOnRollPaper);
            }
            if (UnlimitedWidth != c.UnlimitedWidth)
            {
                writer.WriteBool("UnlimitedWidth", UnlimitedWidth);
            }
            if (FloatDiff(UnlimitedHeightValue, c.UnlimitedHeightValue))
            {
                writer.WriteFloat("UnlimitedHeightValue", UnlimitedHeightValue);
            }
            if (FloatDiff(UnlimitedWidthValue, c.UnlimitedWidthValue))
            {
                writer.WriteFloat("UnlimitedWidthValue", UnlimitedWidthValue);
            }
        }
Пример #3
0
 /// <summary>
 /// Saves the current style.
 /// </summary>
 public virtual void SaveStyle()
 {
     savedBorder = Border;
     savedFill   = Fill;
 }
Пример #4
0
        /// <inheritdoc/>
        public override void Draw(FRPaintEventArgs e)
        {
            if (IsDesigning)
            {
                return;
            }

            Graphics   g        = e.Graphics;
            RectangleF pageRect = new RectangleF(0, 0,
                                                 WidthInPixels - 1 / e.ScaleX, HeightInPixels - 1 / e.ScaleY);
            RectangleF printableRect = new RectangleF(
                LeftMargin * Units.Millimeters,
                TopMargin * Units.Millimeters,
                (PaperWidth - LeftMargin - RightMargin) * Units.Millimeters,
                (PaperHeight - TopMargin - BottomMargin) * Units.Millimeters);

            DrawBackground(e, pageRect);
            Border.Draw(e, printableRect);
            if (Watermark.Enabled)
            {
                if (!Watermark.ShowImageOnTop)
                {
                    Watermark.DrawImage(e, pageRect, Report, IsPrinting);
                }
                if (!Watermark.ShowTextOnTop)
                {
                    Watermark.DrawText(e, pageRect, Report, IsPrinting);
                }
            }

            float leftMargin = (int)Math.Round(LeftMargin * Units.Millimeters * e.ScaleX);
            float topMargin  = (int)Math.Round(TopMargin * Units.Millimeters * e.ScaleY);

            g.TranslateTransform(leftMargin, topMargin);

            try
            {
                foreach (Base c in AllObjects)
                {
                    if (c is ReportComponentBase && c.HasFlag(Flags.CanDraw))
                    {
                        ReportComponentBase obj = c as ReportComponentBase;
                        if (!IsPrinting)
                        {
                            if (!obj.IsVisible(e))
                            {
                                continue;
                            }
                        }
                        else
                        {
                            if (!obj.Printable)
                            {
                                continue;
                            }
                            else if (obj.Parent is BandBase && !(obj.Parent as BandBase).Printable)
                            {
                                continue;
                            }
                        }
                        obj.SetDesigning(false);
                        obj.SetPrinting(IsPrinting);
                        obj.Draw(e);
                        obj.SetPrinting(false);
                    }
                }
            }
            finally
            {
                g.TranslateTransform(-leftMargin, -topMargin);
            }

            if (Watermark.Enabled)
            {
                if (Watermark.ShowImageOnTop)
                {
                    Watermark.DrawImage(e, pageRect, Report, IsPrinting);
                }
                if (Watermark.ShowTextOnTop)
                {
                    Watermark.DrawText(e, pageRect, Report, IsPrinting);
                }
            }
        }