Exemplo n.º 1
0
        //----------------------------------------------------------------------------------------------------x
        /// <summary>Creates this document</summary>
        internal protected override void Create()
        {
            fd = new FontDef(this, "Arial");
            FontProp fp        = new FontPropMM(fd, 1.6);
            FontProp fp_Header = new FontPropMM(fd, 1.9);

            fp_Header.bBold = true;


            // create table
            using (TableLayoutManager tlm = new TableLayoutManager(fp_Header))
            {
                tlm.rContainerHeightMM    = rPosBottom - rPosTop;               // set height of table
                tlm.headerCellDef.rAlignV = RepObj.rAlignCenter;                // set vertical alignment of all header cells
                tlm.headerCellDef.rAlignH = RepObj.rAlignCenter;                // set horizontal alignment of all header cells
                tlm.cellDef.pp_LineBottom = new PenProp(this, 0.05, Color.LightGray);
                tlm.eNewContainer        += new TableLayoutManager.NewContainerEventHandler(Tlm_NewContainer);

                // define columns
                TableLayoutManager.Column col;

                for (int i = 0; i < this.Head.Length; i++)
                {
                    col = new TableLayoutManager.ColumnMM(tlm, this.Head[i], this.WidthCol[i]);
                    col.cellDef.textMode = TableLayoutManager.TextMode.MultiLine;
                }

                for (int i = 0; i < this.Datos.Rows.Count; i++)
                {
                    tlm.NewRow();

                    /*int j = 0;
                     * //Da formato a la columna nro de guía
                     * tlm.Add(j, new RepString(fp, Utiles.Formatos.CerosIzq(Convert.ToInt32(this.Datos.Rows[i][this.Col[j++]]), 10)));
                     *
                     * //inserta la fila de condición de cobro
                     * tlm.Add(j, new RepString(fp, this.Datos.Rows[i][this.Col[j++]].ToString()));
                     *
                     * //Da formato a las columnas de importes
                     * for (; j < this.Col.Length-1; j++)
                     *      tlm.Add(j, new RepString(fp, Utiles.Formatos.Importe(Convert.ToDouble(this.Datos.Rows[i][this.Col[j]]))));
                     *
                     * //inserta la columna estado
                     * tlm.Add(j, new RepString(fp,
                     *      Convert.ToInt32(this.Datos.Rows[i][this.Col[j]]) == (int)SisPack.ValorEstadoAdministrativo.Anulada
                     *      ? "Anulada" : null));*/

                    int j = 2;
                    tlm.Add(j, new RepString(fp, this.Datos.Rows[i][this.Col[j++]].ToString()));
                    tlm.Add(j, new RepString(fp, this.Datos.Rows[i][this.Col[j++]].ToString()));
                }
                tlm.AdjustHeight();
            }

            // print page number and current date/time
            foreach (Page page in enum_Page)
            {
                Double rY = rPosBottom + 1.5;
                page.AddLT_MM(rPosLeft, rY, new RepString(fp, DateTime.Today.ToString("dd/MM/yyyy") + "  " + DateTime.Now.ToShortTimeString()));
                page.AddRT_MM(rPosRight, rY, new RepString(fp, page.iPageNo.ToString() + " / " + iPageCount.ToString()));
            }
        }
 /// <summary>Creates a column definition object with metric values.</summary>
 /// <param name="tlm">Table layout manager of this column</param>
 /// <param name="sHeader">Header of the column</param>
 /// <param name="rWidthMM">Width of the column</param>
 public ColumnMM(TableLayoutManager tlm, String sHeader, Double rWidthMM) : base(tlm, sHeader, RT.rMM(rWidthMM))
 {
 }
 //----------------------------------------------------------------------------------------------------x
 /// <summary>Creates a column definition object.</summary>
 /// <param name="tlm">Table layout manager of this column</param>
 /// <param name="sHeader">Header of the column</param>
 /// <param name="rWidth">Width of the column</param>
 public Column(TableLayoutManager tlm, String sHeader, Double rWidth) : base(tlm, rWidth)
 {
     headerCellDef = new HeaderCellDef();
     this.sHeader  = sHeader;
     fp_Header     = tlm.fp_Header;
 }
        internal protected override void Create()
        {
            fd = new FontDef(this, "Arial");
            FontProp fp        = new FontPropMM(fd, 1.4);
            FontProp fp_Header = new FontPropMM(fd, 1.4);

            fp_Header.bBold   = false;
            fp_Header.bItalic = false;

            using (TableLayoutManager tlm = new TableLayoutManager(fp_Header))
            {
                tlm.rContainerHeightMM    = rPosBottom - rPosTop;               // set height of table
                tlm.headerCellDef.rAlignV = RepObj.rAlignCenter;                // set vertical alignment of all header cells
                tlm.cellDef.pp_LineBottom = new PenProp(this, 0.05, Color.LightGray);
                tlm.eNewContainer        += new TableLayoutManager.NewContainerEventHandler(Tlm_NewContainer);

                TableLayoutManager.Column col;
                //for (int j = 0; j < this.Columnas1; j++)
                //{
                for (int i = 0; i < this.Head1.Length; i++)
                {
                    col = new TableLayoutManager.ColumnMM(tlm, this.Head1[i], this.WidthCol1[i]);
                    col.cellDef.textMode = TableLayoutManager.TextMode.MultiLine;
                    if (i > 2)
                    {
                        col.cellDef.rAlignH = RepObj.rAlignRight;
                    }
                }
                //}
                for (int i = 0; i < this.Datos1.Rows.Count; i++)
                {
                    tlm.NewRow();
                    for (int j = 0; j < Columnas1; j++)
                    {
                        tlm.Add(j, new RepString(fp, Datos1.Rows[i][this.Col1[j]].ToString()));
                    }
                }
                tlm.AdjustHeight();
            }
            using (TableLayoutManager tlm = new TableLayoutManager(fp_Header))
            {
                tlm.rContainerHeightMM    = rPosBottom - rPosTop;               // set height of table
                tlm.headerCellDef.rAlignV = RepObj.rAlignCenter;                // set vertical alignment of all header cells
                tlm.cellDef.pp_LineBottom = new PenProp(this, 0.05, Color.LightGray);
                tlm.eNewContainer        += new TableLayoutManager.NewContainerEventHandler(Tlm_NewContainer);
                TableLayoutManager.Column col;
                Subtitle1 = "Tarifarios de Entrega";
                //for(int j = 0; j < this.Columnas2; j++)
                //{
                for (int i = 0; i < this.Head2.Length; i++)
                {
                    col = new TableLayoutManager.ColumnMM(tlm, this.Head2[i], this.WidthCol2[i]);
                    col.cellDef.textMode = TableLayoutManager.TextMode.MultiLine;
                    if (i > 1)
                    {
                        col.cellDef.rAlignH = RepObj.rAlignRight;
                    }
                }
                //}
                for (int i = 0; i < this.Datos2.Rows.Count; i++)
                {
                    tlm.NewRow();
                    for (int j = 0; j < Columnas2; j++)
                    {
                        tlm.Add(j, new RepString(fp, this.Datos2.Rows[i][this.Col2[j]].ToString()));
                    }
                }
                tlm.AdjustHeight();
            }
            foreach (Page page in enum_Page)
            {
                Double rY = rPosBottom + 1.5;
                page.AddRT_MM(rPosRight, rY, new RepString(fp, page.iPageNo.ToString() + " / " + iPageCount.ToString()));
            }
        }