Пример #1
0
		public void	AddLinea(double startX,double startY,double lenghtX,double lenghtY,double sizePen,Color colorLine)
		{
			Root.Reports.PenProp pp = new PenProp(rpt,sizePen,System.Drawing.Color.Black);
			pp.color = colorLine;
			RepLine rp = new RepLine(pp,lenghtX,lenghtY);
			rptPage.Add(startX,startY,rp);
		}
Пример #2
0
        public void CreatePDFObjects()
        {
            FontDef fdNew;

            foreach (var itm in pdfCtrls)
            {
                if (itm.GetType().Equals(typeof(PDFLabel)))
                {
                    PDFLabel tempPDFLbl = (PDFLabel)itm;
                    try
                    {
                        fdNew = new FontDef(rpt, tempPDFLbl.FontNameType);
                        fd    = fdNew;
                    }
                    catch
                    {
                    }
                    FontProp fp = new FontPropMM(fd, tempPDFLbl.FontSize / 10);
                    page.Add(tempPDFLbl.X_Coord, tempPDFLbl.Y_Coord, new RepString(fp, tempPDFLbl.Text));
                }
                else if (itm.GetType().Equals(typeof(PDFLine)))
                {
                    PDFLine tempPDFLine = (PDFLine)itm;
                    PenProp pp          = new PenProp(rpt, tempPDFLine.thickness);
                    page.Add(tempPDFLine.X_Coord, tempPDFLine.Y_Coord, new RepLine(pp, tempPDFLine.endX, tempPDFLine.endY));
                }
            }
        }
Пример #3
0
        public Test()
        {
            fontDef              = FontDef.fontDef_FromName(this, FontDef.StandardFont.Helvetica);
            fontProp_Title       = new FontPropMM(fontDef, 6);
            fontProp_Title.bBold = true;
            fontProp_Label       = new FontPropMM(fontDef, 4);

            penProp_Symbol       = new PenProp(this, 1);
            penProp_Symbol.color = Color.Red;
            penProp_Line         = new PenProp(this, 1);
        }
Пример #4
0
		public void AddCheckBoxMM(string sText,bool bCheked,double size,Color colorTx,bool bBold, double startX, double startY, double dLenghtText)
		{
            try
            {
                double sizePen = 0.5;
                FontProp fp = new FontPropMM(fd, size);
                fp.color = colorTx;
                fp.bBold = bBold;
                RepString repS = new RepString(fp, sText);
                rptPage.AddMM(startX, startY, repS);

                //Disegno il Quadrato
                double startXBox = repS.rWidthMM + startX + 20;
                double dLenghtBox = repS.rHeightMM + 0.4;
                //Se il valore di dLenghtText!=0 allora lo imposto
                if (dLenghtText != 0)
                {
                    startXBox = startX + dLenghtText;
                }
                PenProp objProp = new PenProp(rpt, sizePen, colorTx);
                Root.Reports.RepRectMM objRect = new RepRectMM(objProp, dLenghtBox, dLenghtBox);
                rptPage.AddMM(startXBox, startY, objRect);

                //Inserisco la X all'interno se attivo
                if (bCheked)
                {
                    AddLineaMM(startXBox, startY, dLenghtBox, dLenghtBox, sizePen, colorTx);
                    AddLineaMM(startXBox, (startY - dLenghtBox), dLenghtBox, (dLenghtBox * -1), sizePen, colorTx);
                }
            }
            catch
            {
                AddTextMM(startX, startY, "Errore.. " + sText, size, colorTx, true);
            }
		}
Пример #5
0
		public void	AddRectMM(double startX,double startY,double dWidth,double dHeight,double sizePen,Color colorTx)
		{
			PenProp objProp = new PenProp(rpt,sizePen,colorTx);
			Root.Reports.RepRectMM objRect = new RepRectMM(objProp,dWidth,dHeight);
			rptPage.AddMM(startX,startY,objRect);				
		}
Пример #6
0
        //----------------------------------------------------------------------------------------------------x
        /// <summary>Creates this report</summary>
        protected override void Create()
        {
            FontDef  fd       = new FontDef(this, FontDef.StandardFont.Helvetica);
            FontProp fp       = new FontPropMM(fd, 2.1);
            FontProp fp_Title = new FontPropMM(fd, 15);

            fp_Title.bBold = true;
            FontProp fp_SubTitle = new FontPropMM(fd, 4);

            fp_SubTitle.bBold = true;
            BrushProp bp       = new BrushProp(this, Color.LightGray);
            PenProp   pp       = new PenProp(this, 0.2, Color.FromArgb(235, 235, 235));
            PenProp   pp_Black = new PenProp(this, 0.2, Color.Black);
            Double    rY       = 40;

            new Page(this);
            page_Cur.AddCB_MM(rY, new RepString(fp_Title, "Image Sample"));

            System.IO.Stream stream = GetType().Assembly.GetManifestResourceStream("ReportSamples.Image.jpg");

            page_Cur.AddMM(20, 90, new RepImageMM(stream, 40, Double.NaN));
            page_Cur.AddMM(20, 95, new RepString(fp, "W = 40mm, H = auto."));
            page_Cur.AddMM(67, 90, new RepImageMM(stream, 40, 20));
            page_Cur.AddMM(67, 95, new RepString(fp, "W = 40mm, H = 20mm"));
            page_Cur.AddMM(114, 90, new RepImageMM(stream, Double.NaN, 30));
            page_Cur.AddMM(114, 95, new RepString(fp, "W = auto., H = 30mm"));
            page_Cur.AddMM(161, 90, new RepImageMM(stream, 30, 30));
            page_Cur.AddMM(161, 95, new RepString(fp, "W = 30mm, H = 30mm"));
            rY += 150;

            // adjust the size of a bounding rectangle
            RepRect dr = new RepRectMM(bp, 80, 60);

            page_Cur.AddMM(20, rY, dr);
            RepImage di = new RepImageMM(stream, 70, Double.NaN);

            page_Cur.AddMM(25, rY - 5, di);
            dr.rHeightMM = di.rHeightMM + 10;

            // rotated image
            di = new RepImageMM(stream, 40, 30);
            di.RotateTransform(-15);
            page_Cur.AddMM(120, rY - 33, di);

            // rotated image with rectangle
            StaticContainer sc = new StaticContainer(RT.rPointFromMM(45), RT.rPointFromMM(35));

            page_Cur.AddMM(145, rY - 35, sc);
            sc.RotateTransform(15);
//      sc.AddMM(0, 35, new RepRectMM(bp, 45, 35));
            sc.AddMM(1.25, 33.75, new RepLineMM(pp, 42.5, 0));
            sc.AddMM(1.25, 1.25, new RepLineMM(pp, 42.5, 0));
            sc.AddAlignedMM(22.5, RepObj.rAlignCenter, 17.5, RepObj.rAlignCenter, new RepImageMM(stream, 40, 30));
            rY += 30;

            // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            // alignment sample
            page_Cur.AddMM(20, rY, new RepString(fp_SubTitle, "Alignment"));
            rY += 18;
            Int32  rX = 40;
            Double rD = 20;

            bp.color = Color.DarkSalmon;
            page_Cur.AddMM(rX, rY + rD, new RepRectMM(bp, rD, rD));
            page_Cur.AddAlignedMM(rX, RepObj.rAlignRight, rY, RepObj.rAlignBottom, new RepImageMM(stream, 20, Double.NaN));
            page_Cur.AddAlignedMM(rX, RepObj.rAlignRight, rY + rD, RepObj.rAlignTop, new RepImageMM(stream, 20, Double.NaN));
            page_Cur.AddMM(rX + rD, rY, new RepImageMM(stream, 20, Double.NaN)); // default
            page_Cur.AddAlignedMM(rX + rD, RepObj.rAlignLeft, rY + rD, RepObj.rAlignTop, new RepImageMM(stream, 20, Double.NaN));
            page_Cur.AddAlignedMM(rX + rD / 2, RepObj.rAlignCenter, rY + rD / 2, RepObj.rAlignCenter, new RepImageMM(stream, 10, Double.NaN));

            // rotated
            rX = 140;
            page_Cur.AddMM(rX, rY + rD, new RepRectMM(bp, rD, rD));
            RepImage repImage = new RepImageMM(stream, 20, Double.NaN);

            repImage.RotateTransform(15);
            page_Cur.AddAlignedMM(rX, RepObj.rAlignRight, rY, RepObj.rAlignBottom, repImage);
            repImage = new RepImageMM(stream, 20, Double.NaN);
            repImage.RotateTransform(15);
            page_Cur.AddAlignedMM(rX, RepObj.rAlignRight, rY + rD, RepObj.rAlignTop, repImage);
            repImage = new RepImageMM(stream, 20, Double.NaN);
            repImage.RotateTransform(15);
            page_Cur.AddMM(rX + rD, rY, repImage); // default
            repImage = new RepImageMM(stream, 20, Double.NaN);
            repImage.RotateTransform(15);
            page_Cur.AddAlignedMM(rX + rD, RepObj.rAlignLeft, rY + rD, RepObj.rAlignTop, repImage);
            repImage = new RepImageMM(stream, 10, Double.NaN);
            repImage.RotateTransform(15);
            page_Cur.AddAlignedMM(rX + rD / 2, RepObj.rAlignCenter, rY + rD / 2, RepObj.rAlignCenter, repImage);

            // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            new Page(this);
            rY = 30;

            page_Cur.AddCB_MM(rY, new RepString(fp_Title, "Ellipse Sample"));
            rY += 15;

            // arc
            page_Cur.AddLT_MM(20, rY, new RepString(fp_SubTitle, "Arc"));
            page_Cur.AddLT_MM(50, rY, new RepRectMM(pp_Black, 40, 30));
            page_Cur.AddLT_MM(50, rY, new RepArcMM(pp_Black, 40, 30, 45, 270));
            page_Cur.AddLT_MM(100, rY, new RepArcMM(pp_Black, 15, 135, 270));
            page_Cur.AddLT_MM(150, rY, new RepArcMM(pp_Black, 40, 30, 150, 130));
            rY += 35;

            // circle
            page_Cur.AddLT_MM(20, rY, new RepString(fp_SubTitle, "Circle"));
            page_Cur.AddLT_MM(50, rY, new RepRectMM(pp_Black, 30, 30));
            page_Cur.AddLT_MM(50, rY, new RepCircleMM(pp_Black, bp, 15));
            page_Cur.AddLT_MM(100, rY, new RepCircleMM(pp_Black, 15));
            page_Cur.AddLT_MM(150, rY, new RepCircleMM(bp, 15));
            rY += 35;

            // ellipse
            page_Cur.AddLT_MM(20, rY, new RepString(fp_SubTitle, "Ellipse"));
            page_Cur.AddLT_MM(50, rY, new RepRectMM(pp_Black, 40, 30));
            page_Cur.AddLT_MM(50, rY, new RepEllipseMM(pp_Black, bp, 40, 30));
            page_Cur.AddLT_MM(100, rY, new RepEllipseMM(pp_Black, 40, 30));
            page_Cur.AddLT_MM(150, rY, new RepEllipseMM(bp, 40, 30));
            rY += 35;

            // pie ellipse
            page_Cur.AddLT_MM(20, rY, new RepString(fp_SubTitle, "Pie Ellipse"));
            page_Cur.AddLT_MM(50, rY, new RepRectMM(pp_Black, 40, 30));
            page_Cur.AddLT_MM(50, rY, new RepPieMM(pp_Black, bp, 40, 30, -135, 225));
            page_Cur.AddLT_MM(100, rY, new RepPieMM(pp_Black, 40, 30, 45, 270));
            page_Cur.AddLT_MM(150, rY, new RepPieMM(bp, 40, 30, 135, 225));
            rY += 35;

            // pie circle
            page_Cur.AddLT_MM(20, rY, new RepString(fp_SubTitle, "Pie Circle"));
            page_Cur.AddLT_MM(50, rY, new RepRectMM(pp_Black, 30, 30));
            page_Cur.AddLT_MM(50, rY, new RepPieMM(pp_Black, bp, 15, -135, 225));
            page_Cur.AddLT_MM(100, rY, new RepPieMM(pp_Black, 15, 45, 270));
            page_Cur.AddLT_MM(150, rY, new RepPieMM(bp, 15, 135, 225));
            rY += 45;

            // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            // Pie alignment sample
            page_Cur.AddMM(20, rY, new RepString(fp_SubTitle, "Pie Alignment"));
            page_Cur.AddMM(105, rY, new RepString(fp_SubTitle, "rotated 30°"));
            rY      += 25;
            rX       = 50;
            rD       = 20;
            bp.color = Color.DarkSalmon;
            page_Cur.AddAlignedMM(rX, RepObj.rAlignCenter, rY, RepObj.rAlignCenter, new RepRectMM(bp, rD, rD));
            page_Cur.AddAlignedMM(rX, RepObj.rAlignRight, rY, RepObj.rAlignBottom, new RepPieMM(pp_Black, bp, rD, rD, 100, 250));
            page_Cur.AddAlignedMM(rX, RepObj.rAlignRight, rY, RepObj.rAlignTop, new RepPieMM(pp_Black, bp, rD, rD, 10, 250));
            page_Cur.AddMM(rX, rY, new RepPieMM(pp_Black, bp, rD, rD, 190, 250)); // default
            page_Cur.AddAlignedMM(rX, RepObj.rAlignLeft, rY, RepObj.rAlignTop, new RepPieMM(pp_Black, bp, rD, rD, -80, 250));
            page_Cur.AddAlignedMM(rX, RepObj.rAlignCenter, rY, RepObj.rAlignCenter, new RepCircleMM(pp_Black, bp, rD / 2));

            rX = 150;
            page_Cur.AddAlignedMM(rX, RepObj.rAlignCenter, rY, RepObj.rAlignCenter, new RepRectMM(bp, rD, rD));

            RepPie pie = new RepPieMM(pp_Black, bp, rD, rD, 100, 250);

            pie.RotateTransform(30);
            page_Cur.AddAlignedMM(rX, RepObj.rAlignRight, rY, RepObj.rAlignBottom, pie);
            RepRect rect = new RepRectMM(pp_Black, rD, rD);

            rect.RotateTransform(30);
            page_Cur.AddAlignedMM(rX, RepObj.rAlignRight, rY, RepObj.rAlignBottom, rect);

            pie = new RepPieMM(pp_Black, bp, rD, rD, 10, 250);
            pie.RotateTransform(30);
            page_Cur.AddAlignedMM(rX, RepObj.rAlignRight, rY, RepObj.rAlignTop, pie);
            rect = new RepRectMM(pp_Black, rD, rD);
            rect.RotateTransform(30);
            page_Cur.AddAlignedMM(rX, RepObj.rAlignRight, rY, RepObj.rAlignTop, rect);

            pie = new RepPieMM(pp_Black, bp, rD, rD, 190, 250);
            pie.RotateTransform(30);
            page_Cur.AddMM(rX, rY, pie); // default
            rect = new RepRectMM(pp_Black, rD, rD);
            rect.RotateTransform(30);
            page_Cur.AddMM(rX, rY, rect);

            pie = new RepPieMM(pp_Black, bp, rD, rD, -80, 250);
            pie.RotateTransform(30);
            page_Cur.AddAlignedMM(rX, RepObj.rAlignLeft, rY, RepObj.rAlignTop, pie);
            rect = new RepRectMM(pp_Black, rD, rD);
            rect.RotateTransform(30);
            page_Cur.AddAlignedMM(rX, RepObj.rAlignLeft, rY, RepObj.rAlignTop, rect);

            page_Cur.AddAlignedMM(rX, RepObj.rAlignCenter, rY, RepObj.rAlignCenter, new RepCircleMM(pp_Black, bp, rD / 2));
        }
Пример #7
0
        protected override void Create()
        {
            FontDef  fd       = new FontDef(this, "Arial");
            FontProp fp       = new FontPropMM(fd, 2.1);
            FontProp fp_Title = new FontPropMM(fd, 18);

            fp_Title.bBold = true;
            BrushProp bp = new BrushProp(this, System.Drawing.Color.LightGray);
            PenProp   pp = new PenProp(this, 0.2, Color.FromArgb(235, 235, 235));

            new Page(this);
            Double rY = 40;

            //exception
            page_Cur.AddCenteredMM(rY, new RepString(fp_Title, "Image Sample"));
            fp_Title.rSizeMM = 4;

            System.IO.Stream stream = GetType().Assembly.GetManifestResourceStream("ReportSamples.Image.jpg");

            page_Cur.AddMM(20, 90, new RepImageMM(stream, 40, Double.NaN));
            page_Cur.AddMM(20, 95, new RepString(fp, "W = 40mm, H = auto."));
            page_Cur.AddMM(67, 90, new RepImageMM(stream, 40, 20));
            page_Cur.AddMM(67, 95, new RepString(fp, "W = 40mm, H = 20mm"));
            page_Cur.AddMM(114, 90, new RepImageMM(stream, Double.NaN, 30));
            page_Cur.AddMM(114, 95, new RepString(fp, "W = auto., H = 30mm"));
            page_Cur.AddMM(161, 90, new RepImageMM(stream, 30, 30));
            page_Cur.AddMM(161, 95, new RepString(fp, "W = 30mm, H = 30mm"));
            rY += 150;

            // adjust the size of a bounding rectangle
            RepRect dr = new RepRectMM(bp, 80, 60);

            page_Cur.AddMM(20, rY, dr);
            RepImage di = new RepImageMM(stream, 70, Double.NaN);

            page_Cur.AddMM(25, rY - 5, di);
            dr.rHeightMM = di.rHeightMM + 10;

            // rotated image
            di = new RepImageMM(stream, 40, 30);
            di.RotateTransform(-15);
            page_Cur.AddMM(120, rY - 33, di);

            // rotated image with rectangle
            StaticContainer sc = new StaticContainer(RT.rMM(45), RT.rMM(35));

            page_Cur.AddMM(145, rY - 35, sc);
            sc.RotateTransform(15);
            sc.AddMM(0, 35, new RepRectMM(bp, 45, 35));
            sc.AddMM(1.25, 33.75, new RepLineMM(pp, 42.5, 0));
            sc.AddMM(1.25, 1.25, new RepLineMM(pp, 42.5, 0));
            sc.AddAlignedMM(22.5, RepObj.rAlignCenter, 17.5, RepObj.rAlignCenter, new RepImageMM(stream, 40, 30));
            rY += 30;

            // alignment sample
            page_Cur.AddMM(20, rY, new RepString(fp_Title, "Alignment"));
            rY += 18;
            Int32  rX = 100;
            Double rD = 20;

            bp.color = Color.DarkSalmon;
            page_Cur.AddMM(rX, rY + rD, new RepRectMM(bp, rD, rD));
            page_Cur.AddAlignedMM(rX, RepObj.rAlignRight, rY, RepObj.rAlignBottom, new RepImageMM(stream, 20, Double.NaN));
            page_Cur.AddAlignedMM(rX, RepObj.rAlignRight, rY + rD, RepObj.rAlignTop, new RepImageMM(stream, 20, Double.NaN));
            page_Cur.AddMM(rX + rD, rY, new RepImageMM(stream, 20, Double.NaN));  // default
            page_Cur.AddAlignedMM(rX + rD, RepObj.rAlignLeft, rY + rD, RepObj.rAlignTop, new RepImageMM(stream, 20, Double.NaN));
            page_Cur.AddAlignedMM(rX + rD / 2, RepObj.rAlignCenter, rY + rD / 2, RepObj.rAlignCenter, new RepImageMM(stream, 10, Double.NaN));
        }
Пример #8
0
        public void Run()
        {
            MemoryStream stream;
            MemoryStream refbg = loadImageFile("\\art\\reference.png");

            FontDef   fd       = new FontDef(this, FontDef.StandardFont.Courier);
            FontProp  fp       = new FontPropMM(fd, 2.1);
            BrushProp bp       = new BrushProp(this, Color.LightGray);
            PenProp   pp       = new PenProp(this, 0.2, Color.FromArgb(235, 235, 235));
            PenProp   pp_Black = new PenProp(this, 0.2, Color.Black);

            bool deckdbl = decklist.doublesided;

            List <Card>   cards        = decklist.Values.ToList();
            List <string> cardArts     = new List <string>();
            List <string> cardArtsBack = new List <string>();

            foreach (Card c in cards)
            {
                for (int i = 0; i < c.cardQty; i++)
                {
                    cardArts.Add(c.filePathFront);
                    // if the card has a flip but we're not doing double sided
                    if (c.twin && !deckdbl)
                    {
                        cardArts.Add(c.filePathBack);
                    }
                    // if the card has a flip and we're doing double sided
                    else if (c.twin && deckdbl)
                    {
                        cardArtsBack.Add(c.filePathBack);
                    }
                    // if the card doesn't have a flip and we're doing double sided
                    else if (!c.twin && deckdbl)
                    {
                        cardArtsBack.Add("\\art\\pback.png");
                    }
                }
            }

            int cardid     = 0;
            int cardidback = 0;

            for (int pageNum = 0; pageNum < decklist.getPageCount(); pageNum++)
            {
                // Make a page
                new Page(this);
                page_Cur.rWidthMM  = 215.9;
                page_Cur.rHeightMM = 279.4;
                page_Cur.AddMM(0, 279.4, new RepImageMM(refbg, 215.9, 279.4));
                page_Cur.AddAlignedMM(215.9 / 2, RepObj.rAlignCenter, 27.5, RepObj.rAlignTop, new RepString(fp, "Print on 12pt Matte -- No Scaling -- Full Color -- One Copy"));
                page_Cur.AddAlignedMM(215.9 / 2, RepObj.rAlignCenter, 22.5, RepObj.rAlignTop, new RepString(fp, "Print Coated 3 -- Maximum Printer Density -- 100% Color"));

                // Layout the Cards
                for (int cardPos = 0; cardPos < decklist.getCardsOnPage(pageNum); cardPos++)
                {
                    if (cardArts[cardid] == null)
                    {
                        cardid++;
                    }
                    stream = loadImageFile(cardArts[cardid]);
                    if (stream != null)
                    {
                        AddCardToPage(stream, Center(cardPos));
                    }
                    cardid++;
                }

                if (deckdbl)
                {
                    page_Cur.AddAlignedMM(215.9 / 2, RepObj.rAlignCenter, 279.4 - 27.5, RepObj.rAlignTop, new RepString(fp, "Double sided -- Flipped on Short Edge"));

                    // Make a page
                    new Page(this);
                    page_Cur.rWidthMM  = 215.9;
                    page_Cur.rHeightMM = 279.4;
                    page_Cur.AddMM(0, 279.4, new RepImageMM(refbg, 215.9, 279.4));
                    page_Cur.AddAlignedMM(215.9 / 2, RepObj.rAlignCenter, 27.5, RepObj.rAlignTop, new RepString(fp, "Print on 12pt Matte -- No Scaling -- Full Color -- One Copy"));

                    // Layout the Cards
                    for (int cardPos = 0; cardPos < decklist.getCardsOnPage(pageNum); cardPos++)
                    {
                        stream = loadImageFile(cardArtsBack[cardidback]);
                        AddCardToPage(stream, CenterBackA(cardPos), 3.75);
                        cardidback++;
                    }

                    page_Cur.AddAlignedMM(215.9 / 2, RepObj.rAlignCenter, 279.4 - 27.5, RepObj.rAlignTop, new RepString(fp, "Double sided -- Flipped on Short Edge"));
                }
            }
        }