Exemplo n.º 1
0
            public void Render(
                RenderingEnv env,
                ReportDesign reportDesign,
                Region region,
                ElementDesign design,
                object data)
            {
                Region r = region.ToPointScale(reportDesign);
                Single x = r.Left + r.GetWidth() / 2;
                Single y = r.Top + r.GetHeight() / 2;
                Single w = 12;

                env.Graphics.DrawRectangle(Pens.Black, x - w / 2, y - w / 2, w, w);
                if ((bool)data)
                {
                    Point[] p =
                    {
                        new Point((int)(x - w / 2), (int)(y - w / 4)),
                        new Point((int)(x - w / 4), (int)(y + w / 2)),
                        new Point((int)(x + w / 2), (int)(y - w / 2)),
                        new Point((int)(x - w / 4), (int)(y))
                    };
                    env.Graphics.FillPolygon(Brushes.SteelBlue, p);
                }
            }
Exemplo n.º 2
0
 public override void RenderContent(
     Content content,
     Evaluator evaluator,
     Region region,
     ElementDesigns elementDesigns)
 {
     // このメソッドはコンテントの描画が行われる直前に呼ばれます
     // "content_example"という識別子を持ったコンテントに対して処理を行います
     if ("content_example".Equals(content.Design.Id))
     {
         // "graph"という識別子を持った要素を取得し、レイアウトと色を修正します
         ElementDesign e = elementDesigns.Find("graph");
         // ".NUM"という式を評価することで、NUM列の値を得ます
         Decimal num = (Decimal)evaluator.EvalTry(".NUM");
         if (num >= 0)
         {
             e.Child("layout").Put("x1", 100);
             e.Child("layout").Put("x2", 100 + num);
             e.Put("fill_color", "lightblue");
         }
         else
         {
             e.Child("layout").Put("x1", 100 + num);
             e.Child("layout").Put("x2", 100);
             e.Put("fill_color", "pink");
         }
     }
 }
Exemplo n.º 3
0
            public void Render(
                PdfRenderer renderer,
                ReportDesign reportDesign,
                Region region,
                ElementDesign design,
                object data)
            {
                Region         r  = region.ToPointScale(reportDesign);
                PdfContentByte cb = renderer.Writer.DirectContent;
                Single         x  = r.Left + r.GetWidth() / 2;
                Single         y  = r.Top + r.GetHeight() / 2;
                Single         w  = 12;

                cb.SaveState();
                cb.Rectangle(renderer.Trans.X(x - w / 2), renderer.Trans.Y(y - w / 2), w, -w);
                cb.Stroke();
                if ((bool)data)
                {
                    cb.SetColorFill(PdfRenderUtil.GetColor("steelblue"));
                    cb.MoveTo(renderer.Trans.X(x - w / 2), renderer.Trans.Y(y - w / 4));
                    cb.LineTo(renderer.Trans.X(x - w / 4), renderer.Trans.Y(y + w / 2));
                    cb.LineTo(renderer.Trans.X(x + w / 2), renderer.Trans.Y(y - w / 2));
                    cb.LineTo(renderer.Trans.X(x - w / 4), renderer.Trans.Y(y));
                    cb.Fill();
                }
                cb.RestoreState();
            }
Exemplo n.º 4
0
            public void Collect(
                XlsxRenderer renderer,
                ReportDesign reportDesign,
                Region region,
                ElementDesign design,
                object data)
            {
                Region r = region.ToPointScale(reportDesign);

                jp.co.systembase.report.renderer.xlsx.component.Shape shape =
                    new jp.co.systembase.report.renderer.xlsx.component.Shape();
                shape.Region   = r;
                shape.Renderer = new CheckBoxShapeRenderer(data);
                renderer.CurrentPage.Shapes.Add(shape);
            }
Exemplo n.º 5
0
            public string Format(object v, ElementDesign design)
            {
                if (v == null)
                {
                    return(null);
                }
                String _v = v.ToString();

                if (_v.Length > 3)
                {
                    return(_v.Substring(0, 3) + "-" + _v.Substring(3));
                }
                else
                {
                    return(_v);
                }
            }
Exemplo n.º 6
0
 public string Format(object v, ElementDesign design)
 {
     if (v == null)
     {
         return null;
     }
     String _v = v.ToString();
     if (_v.Length > 3)
     {
         return _v.Substring(0, 3) + "-" + _v.Substring(3);
     }
     else
     {
         return _v;
     }
 }
Exemplo n.º 7
0
 public void Collect(
     XlsxRenderer renderer,
     ReportDesign reportDesign,
     Region region,
     ElementDesign design,
     object data)
 {
     Region r = region.ToPointScale(reportDesign);
     jp.co.systembase.report.renderer.xlsx.component.Shape shape =
         new jp.co.systembase.report.renderer.xlsx.component.Shape();
     shape.Region = r;
     shape.Renderer = new CheckBoxShapeRenderer(data);
     renderer.CurrentPage.Shapes.Add(shape);
 }
Exemplo n.º 8
0
 public void Render(
     PdfRenderer renderer, 
     ReportDesign reportDesign, 
     Region region, 
     ElementDesign design, 
     object data)
 {
     Region r = region.ToPointScale(reportDesign);
     PdfContentByte cb = renderer.Writer.DirectContent;
     Single x = r.Left + r.GetWidth() / 2;
     Single y = r.Top + r.GetHeight() / 2;
     Single w = 12;
     cb.SaveState();
     cb.Rectangle(renderer.Trans.X(x - w / 2), renderer.Trans.Y(y - w / 2), w, -w);
     cb.Stroke();
     if ((bool)data)
     {
         cb.SetColorFill(PdfRenderUtil.GetColor("steelblue"));
         cb.MoveTo(renderer.Trans.X(x - w / 2), renderer.Trans.Y(y - w / 4));
         cb.LineTo(renderer.Trans.X(x - w / 4), renderer.Trans.Y(y + w / 2));
         cb.LineTo(renderer.Trans.X(x + w / 2), renderer.Trans.Y(y - w / 2));
         cb.LineTo(renderer.Trans.X(x - w / 4), renderer.Trans.Y(y));
         cb.Fill();
     }
     cb.RestoreState();
 }
Exemplo n.º 9
0
 public void Render(
     RenderingEnv env,
     ReportDesign reportDesign,
     Region region,
     ElementDesign design,
     object data)
 {
     Region r = region.ToPointScale(reportDesign);
     Single x = r.Left + r.GetWidth() / 2;
     Single y = r.Top + r.GetHeight() / 2;
     Single w = 12;
     env.Graphics.DrawRectangle(Pens.Black, x - w / 2, y - w / 2, w, w);
     if ((bool)data)
     {
         Point[] p = {
           new Point((int)(x - w / 2), (int)(y - w / 4)),
           new Point((int)(x - w / 4), (int)(y + w / 2)),
           new Point((int)(x + w / 2), (int)(y - w / 2)),
           new Point((int)(x - w / 4), (int)(y))};
         env.Graphics.FillPolygon(Brushes.SteelBlue, p);
     }
 }