예제 #1
0
 /// <summary>
 /// Write the attributes of the tag specified
 /// </summary>
 /// <param name="p_Cell"></param>
 /// <param name="p_Position"></param>
 /// <param name="p_Export"></param>
 /// <param name="p_Writer"></param>
 /// <param name="p_ElementTagName"></param>
 protected override void ExportHTML_Attributes(Cells.ICellVirtual p_Cell, Position p_Position, IHTMLExport p_Export, System.Xml.XmlTextWriter p_Writer, string p_ElementTagName)
 {
     base.ExportHTML_Attributes(p_Cell, p_Position, p_Export, p_Writer, p_ElementTagName);
     if (p_ElementTagName == "img")
     {
         p_Writer.WriteAttributeString("align", Utility.ContentToHorizontalAlignment(ImageAlignment).ToString().ToLower());
         p_Writer.WriteAttributeString("src", p_Export.ExportImage(Image));
     }
 }
예제 #2
0
        /// <summary>
        /// Write the content of the tag specified
        /// </summary>
        /// <param name="p_Cell"></param>
        /// <param name="p_Position"></param>
        /// <param name="p_Export"></param>
        /// <param name="p_Writer"></param>
        /// <param name="p_ElementTagName"></param>
        protected override void ExportHTML_Element(Cells.ICellVirtual p_Cell, Position p_Position, IHTMLExport p_Export, System.Xml.XmlTextWriter p_Writer, string p_ElementTagName)
        {
            base.ExportHTML_Element(p_Cell, p_Position, p_Export, p_Writer, p_ElementTagName);
            if (p_ElementTagName == "td")
            {
                #region Image
                //non esporto le immagini di ordinamento
                if (Image != null && CanExportHTMLImage(Image))
                {
                    p_Writer.WriteStartElement("img");

                    ExportHTML_Attributes(p_Cell, p_Position, p_Export, p_Writer, "img");
                    ExportHTML_Element(p_Cell, p_Position, p_Export, p_Writer, "img");

                    //img
                    p_Writer.WriteEndElement();
                }
                #endregion
            }
            else if (p_ElementTagName == "img")
            {
            }
        }
예제 #3
0
        /// <summary>
        /// Write the content of the tag specified
        /// </summary>
        /// <param name="p_Cell"></param>
        /// <param name="p_Position"></param>
        /// <param name="p_Export"></param>
        /// <param name="p_Writer"></param>
        /// <param name="p_ElementTagName"></param>
        protected override void ExportHTML_Element(Cells.ICellVirtual p_Cell, Position p_Position, IHTMLExport p_Export, System.Xml.XmlTextWriter p_Writer, string p_ElementTagName)
        {
            ICellCheckBox  l_CheckBox = (ICellCheckBox)p_Cell;
            CheckBoxStatus l_Status   = l_CheckBox.GetCheckBoxStatus(p_Position);

            if (p_ElementTagName == "td")
            {
                if (l_Status.Checked == true)
                {
                    p_Writer.WriteRaw("<input type=\"checkbox\" checked>");
                }
                else
                {
                    p_Writer.WriteRaw("<input type=\"checkbox\">");
                }

                base.ExportHTML_Element(p_Cell, p_Position, p_Export, p_Writer, p_ElementTagName);
            }
            else if (p_ElementTagName == "font")
            {
                Utility.ExportHTML_Element_Font(p_Writer, l_Status.Caption, GetCellFont());

                //do not call base ExportHTML_Element because we use the caption not the display text
                //base.ExportHTML_Element(p_Cell, p_Position, p_Export, p_Writer, p_ElementTagName);
            }
            else
            {
                base.ExportHTML_Element(p_Cell, p_Position, p_Export, p_Writer, p_ElementTagName);
            }
        }
예제 #4
0
        /// <summary>
        /// Write the content of the tag specified
        /// </summary>
        /// <param name="p_Cell"></param>
        /// <param name="p_Position"></param>
        /// <param name="p_Export"></param>
        /// <param name="p_Writer"></param>
        /// <param name="p_ElementTagName"></param>
        protected virtual void ExportHTML_Element(Cells.ICellVirtual p_Cell, Position p_Position, IHTMLExport p_Export, System.Xml.XmlTextWriter p_Writer, string p_ElementTagName)
        {
            if (p_ElementTagName == "td")
            {
                #region Font
                p_Writer.WriteStartElement("font");

                ExportHTML_Attributes(p_Cell, p_Position, p_Export, p_Writer, "font");
                ExportHTML_Element(p_Cell, p_Position, p_Export, p_Writer, "font");

                //font
                p_Writer.WriteEndElement();
                #endregion
            }
            else if (p_ElementTagName == "font")
            {
                Utility.ExportHTML_Element_Font(p_Writer, p_Cell.GetDisplayText(p_Position), GetCellFont());
            }
        }
예제 #5
0
        /// <summary>
        /// Write the attributes of the tag specified
        /// </summary>
        /// <param name="p_Cell"></param>
        /// <param name="p_Position"></param>
        /// <param name="p_Export"></param>
        /// <param name="p_Writer"></param>
        /// <param name="p_ElementTagName"></param>
        protected virtual void ExportHTML_Attributes(Cells.ICellVirtual p_Cell, Position p_Position, IHTMLExport p_Export, System.Xml.XmlTextWriter p_Writer, string p_ElementTagName)
        {
            if (p_ElementTagName == "td")
            {
                //check for rowspan and colspan
                if (p_Cell is ICell)
                {
                    //TODO non è bellissimo mettere questo if (pensare come poter fare in un altro modo)
                    ICell l_Cell = (ICell)p_Cell;
                    //colspan, rowspan
                    p_Writer.WriteAttributeString("colspan", l_Cell.ColumnSpan.ToString());
                    p_Writer.WriteAttributeString("rowspan", l_Cell.RowSpan.ToString());
                }

                //write backcolor
                if ((p_Export.Mode & ExportHTMLMode.CellBackColor) == ExportHTMLMode.CellBackColor)
                {
                    p_Writer.WriteAttributeString("bgcolor", HTMLExport.ColorToHTML(BackColor));
                }

                string l_Style = "";

                //border
                l_Style = HTMLExport.CellBorderToHTMLStyle(Border);

                //style
                p_Writer.WriteAttributeString("style", l_Style);

                //alignment
                p_Writer.WriteAttributeString("align", Utility.ContentToHorizontalAlignment(TextAlignment).ToString().ToLower());
                if (Utility.IsBottom(TextAlignment))
                {
                    p_Writer.WriteAttributeString("valign", "bottom");
                }
                else if (Utility.IsTop(TextAlignment))
                {
                    p_Writer.WriteAttributeString("valign", "top");
                }
                else if (Utility.IsMiddle(TextAlignment))
                {
                    p_Writer.WriteAttributeString("valign", "middle");
                }
            }
            else if (p_ElementTagName == "font")
            {
                p_Writer.WriteAttributeString("color", HTMLExport.ColorToHTML(ForeColor));
            }
        }
예제 #6
0
        /// <summary>
        /// Export the cell contents in html format
        /// </summary>
        /// <param name="p_Cell"></param>
        /// <param name="p_Position"></param>
        /// <param name="p_Export"></param>
        /// <param name="p_Writer"></param>
        public virtual void ExportHTML(Cells.ICellVirtual p_Cell, Position p_Position, IHTMLExport p_Export, System.Xml.XmlTextWriter p_Writer)
        {
            //start element td
            p_Writer.WriteStartElement("td");

            //cell attributes
            ExportHTML_Attributes(p_Cell, p_Position, p_Export, p_Writer, "td");

            //cell content
            ExportHTML_Element(p_Cell, p_Position, p_Export, p_Writer, "td");

            //td
            p_Writer.WriteEndElement();
        }
예제 #7
0
 /// <summary>
 /// Export the specified cell to HTML
 /// </summary>
 /// <param name="p_CurrentPosition"></param>
 /// <param name="p_Cell"></param>
 /// <param name="p_Export"></param>
 /// <param name="p_Writer"></param>
 protected override void ExportHTMLCell(Position p_CurrentPosition, Cells.ICellVirtual p_Cell, IHTMLExport p_Export, System.Xml.XmlTextWriter p_Writer)
 {
     //export only real cell (not position occupied by rowspan or colspan
     if (p_Cell != null && ((ICell)p_Cell).Range.Start == p_CurrentPosition)
     {
         p_Cell.VisualModel.ExportHTML(p_Cell, p_CurrentPosition, p_Export, p_Writer);
     }
 }