Esempio n. 1
0
		public double AddTextMM(double startX,double startY,string sText,double size,Color colorTx,bool bBold)
		{
			
			FontProp fp = new FontPropMM(fd, size); 
			fp.color = colorTx;
			fp.bBold = bBold;
            
			RepString repS = new RepString(fp,sText);
			rptPage.AddMM(startX,startY,repS);	
			return  repS.rWidthMM;
		}
Esempio n. 2
0
		public void	AddText(double startX,double startY,string sText,double size,Color colorTx,bool bBold){
			
			FontProp fp = new FontPropMM(fd, size); 
			fp.color = colorTx;
			fp.bBold = bBold;
			RepString repS = new RepString(fp,sText);
			rptPage.Add(startX,startY,repS);				
		}
Esempio n. 3
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);
            }
		}
Esempio n. 4
0
        private double CreateTable(double verticalMillimeters)
        {
            if (DataTable.Rows.Count == 0)
            {
                verticalMillimeters += InsertItalicText(verticalMillimeters, $"   No Breaker Operations during {StartTime.ToString("MM/dd/yyyy")} - {EndTime.ToString("MM/dd/yyyy")}");
                return(verticalMillimeters);
            }

            FontProp headerProp = new FontProp(FontDefinition, 0);

            headerProp.rSizePoint = 7.0D;
            using (TableLayoutManager tlm = new TableLayoutManager(headerProp))
            {
                tlm.tlmCellDef_Header.rAlignV             = RepObj.rAlignCenter;                      // set vertical alignment of all header cells
                tlm.tlmCellDef_Default.penProp_LineBottom = new PenProp(this, 0.05, Color.LightGray); // set bottom line for all cells
                tlm.tlmHeightMode  = TlmHeightMode.AdjustLast;
                tlm.eNewContainer += (oSender, ea) =>
                {
                    verticalMillimeters += tlm.rCurY_MM;
                    verticalMillimeters  = NextTablePage(verticalMillimeters, ea);
                };

                List <dynamic> columns = new List <dynamic>()
                {
                    new { Name = "Last Op", Column = "LastOperationDate", Width = (PageWidthMillimeters - 2 * PageMarginMillimeters) * .05 },
                    new { Name = "Breaker", Column = "BreakerNumber", Width = (PageWidthMillimeters - 2 * PageMarginMillimeters) * .04 },
                    new { Name = "# of Ops", Column = "Total", Width = (PageWidthMillimeters - 2 * PageMarginMillimeters) * .04 },
                    new { Name = "Asset", Column = "AssetNum", Width = (PageWidthMillimeters - 2 * PageMarginMillimeters) * .05 },
                    new { Name = "Line", Column = "LineName", Width = (PageWidthMillimeters - 2 * PageMarginMillimeters) * .10 },
                    new { Name = "Phase", Column = "LastPhase", Width = (PageWidthMillimeters - 2 * PageMarginMillimeters) * .04 },
                    new { Name = "Timing (wf)", Column = "LastWaveformTiming", Width = (PageWidthMillimeters - 2 * PageMarginMillimeters) * .05 },
                    new { Name = "Timing (sb)", Column = "LastStatusTiming", Width = (PageWidthMillimeters - 2 * PageMarginMillimeters) * .05 },
                    new { Name = "MFR Speed", Column = "MfrSpeed", Width = (PageWidthMillimeters - 2 * PageMarginMillimeters) * .04 },
                    new { Name = "Operation Timing", Column = "OperationTiming", Width = (PageWidthMillimeters - 2 * PageMarginMillimeters) * .06 },
                    new { Name = "Method", Column = "LastMethod", Width = (PageWidthMillimeters - 2 * PageMarginMillimeters) * .05 },
                    new { Name = "# Late", Column = "TotalLateOperation", Width = (PageWidthMillimeters - 2 * PageMarginMillimeters) * .03 },
                    new { Name = "Last Late", Column = "LastLateOperation", Width = (PageWidthMillimeters - 2 * PageMarginMillimeters) * .05 },
                    new { Name = "MFR", Column = "Manufacturer", Width = (PageWidthMillimeters - 2 * PageMarginMillimeters) * .07 },
                    new { Name = "Serial #", Column = "SerialNum", Width = (PageWidthMillimeters - 2 * PageMarginMillimeters) * .08 },
                    new { Name = "MFR Year", Column = "MfrYear", Width = (PageWidthMillimeters - 2 * PageMarginMillimeters) * .04 },
                    new { Name = "Model #", Column = "ModelNum", Width = (PageWidthMillimeters - 2 * PageMarginMillimeters) * .07 },
                    new { Name = "ICR (A)", Column = "InterruptCurrentRating", Width = (PageWidthMillimeters - 2 * PageMarginMillimeters) * .05 },
                    new { Name = "CAR (A)", Column = "ContinuousAmpRating", Width = (PageWidthMillimeters - 2 * PageMarginMillimeters) * .05 }
                };

                foreach (var column in columns)
                {
                    new TlmColumnMM(tlm, column.Name, column.Width);
                }

                List <string> centeredCols = new List <string>()
                {
                    "Total", "BreakerNumber", "AssetNum", "LastPhase"
                };
                foreach (DataRow row in DataTable.Rows)
                {
                    tlm.NewRow();
                    int index = 0;
                    foreach (var column in columns)
                    {
                        if (column.Column == "LastOperationDate" || (column.Column == "LastLateOperation" && row[column.Column].ToString() != string.Empty))
                        {
                            FontProp textProp = new FontProp(FontDefinition, 0);
                            textProp.rSizePoint = 6.0D;
                            string date = DateTime.Parse(row[column.Column].ToString()).ToString("MM/dd/yyyy");
                            string time = DateTime.Parse(row[column.Column].ToString()).ToString("HH:mm:ss");
                            tlm.Add(index, new RepString(textProp, date));
                            tlm.NewLine(index);
                            tlm.Add(index++, new RepString(textProp, time));
                        }
                        else
                        {
                            FontProp textProp = new FontProp(FontDefinition, 0);
                            textProp.rSizePoint = 6.0D;
                            string value = "";

                            value = row[column.Column].ToString();
                            RepString repObj = new RepString(textProp, value);
                            if (centeredCols.Contains(column.Column))
                            {
                                repObj.rAlignH = RepObj.rAlignCenter;
                            }

                            AddDataColumn(tlm, index, value, textProp, column.Width);
                            index++;
                        }
                    }
                }

                tlm.Commit();

                verticalMillimeters += tlm.rCurY_MM + 10;
            }

            return(verticalMillimeters);
        }