Exemplo n.º 1
0
        //TODO: Code Review Issue 11/05/05: Give a more detailed summary.
        // Done 24/05/2005
        /// <summary>
        /// Renders this object as an RDL MatrixRow to an XmlWriter instance.
        /// </summary>
        /// <param name="xmlWriter">The XmlWriter to render the object to.</param>
        public void Render(XmlWriter xmlWriter)
        {
            string TextboxValue = "";

            if (_isSummable)
            {
                if (_groupingLevel == 0)
                {
                    TextboxValue = "=Sum(Fields!" + _fieldName + ".Value)";
                }
                else
                {
                    TextboxValue = @"=Sum(iif(Fields!GroupingLevel.Value <= " + _groupingLevel +
                                   ", cdbl(Fields!" + _fieldName + ".Value), cdbl(0)))";
                }
            }
            _textboxStyle.Format = RdlFormatter.FormatData(_dataType);

            //TODO: Code Review Issue 11/05/05: indent the code as in XML to increase readability
            // Done 24/05/2005
            xmlWriter.WriteStartElement("MatrixRow");
            RdlRender.AddLine(xmlWriter, "Height", "1cm");
            xmlWriter.WriteStartElement("MatrixCells");
            xmlWriter.WriteStartElement("MatrixCell");
            xmlWriter.WriteStartElement("ReportItems");

            RdlRender.AddTextbox(xmlWriter, _name, TextboxValue, _textboxStyle, "",
                                 "", "", "", "true", "", "", "", "", "", "", "", "", "", "");

            xmlWriter.WriteEndElement();             // ReportItems
            xmlWriter.WriteEndElement();             // MatrixCell
            xmlWriter.WriteEndElement();             // MatrixCells
            xmlWriter.WriteEndElement();             // MatrixRow
        }
        /// <summary>
        /// Makes object render itself as an RDL TableCell to an XmlWriter instance.
        /// </summary>
        /// <param name="xmlWriter">The XMLWriter to be rendered to.</param>
        public void Render2010(XmlWriter xmlWriter)
        {
            string TextboxValue = _isEmpty ? "" : "=Fields!" + _name + ".Value";
            string Alignment    = RdlFormatter.FormatAlignment(_dataType);

            _textboxStyle.Format = RdlFormatter.FormatData(_dataType);

            xmlWriter.WriteStartElement("TablixCell");
            xmlWriter.WriteStartElement("CellContents");
            RdlRender.AddTextbox2010(xmlWriter, "Details" + _name, TextboxValue, _textboxStyle,
                                     Alignment, "0in", "0in", ".5in", "true", "", "", "", "", "", "", "", "", "", "", _hyperlink);
            xmlWriter.WriteEndElement(); //CellContents
            xmlWriter.WriteEndElement(); //TablixCell
        }
        //TODO: Code Review Issue 11/05/05: Give a more detailed summary.
        // Done 24/05/2005
        /// <summary>
        /// Makes object render itself as an RDL TableCell to an XmlWriter instance.
        /// </summary>
        /// <param name="xmlWriter">The XMLWriter to be rendered to.</param>
        public void Render(XmlWriter xmlWriter)
        {
            string TextboxValue = _isEmpty ? "" : "=Fields!" + _name + ".Value";
            string Alignment    = RdlFormatter.FormatAlignment(_dataType);

            _textboxStyle.Format = RdlFormatter.FormatData(_dataType);

            xmlWriter.WriteStartElement("TableCell");
            xmlWriter.WriteStartElement("ReportItems");
            RdlRender.AddTextbox(xmlWriter, "Details" + _name, TextboxValue, _textboxStyle,
                                 Alignment, "0in", "0in", ".5in", "true", "", "", "", "", "", "", "", "", "", "");
            xmlWriter.WriteEndElement();
            xmlWriter.WriteEndElement();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Makes object render itself as an RDL TableCell to an XmlWriter object.
        /// </summary>
        /// <param name="xmlWriter">The XMLWriter to be rendered to.</param>
        public void Render2010(XmlWriter xmlWriter)
        {
            string TextboxValue = "";

            // If this textbox is empty and the data that its column represents may
            // be summed, then it displays the sum of the values in its column
            // that are within its group.
            if (_isEmpty)
            {
                /* TEMPORARILY REMOVED */
                if (_isSummable)
                {
                    if (_groupingLevel == 0)
                    {
                        TextboxValue = @"=Sum(Fields!" + _itemName + ".Value)";
                    }
                    else
                    {
                        // Only give this textbox a value if the field this textbox is grouped by
                        // is at a lower or equal grouping level than this textbox
                        if (_newGroupListIndex <= _groupingLevel)
                        {
                            TextboxValue = @"=Sum(iif(Fields!GroupingLevel.Value <= " + _groupingLevel +
                                           ", cdbl(Fields!" + _itemName + ".Value), cdbl(0)), " + '\u0022' + "Grouping" + _groupName + '\u0022' + ")";
                        }
                    }
                }
                /* */
            }
            else
            {
                TextboxValue = "=Fields!" + _name + ".Value";
            }
            _textboxStyle.Format = RdlFormatter.FormatData(_dataType);

            xmlWriter.WriteStartElement("TablixCell");
            xmlWriter.WriteStartElement("CellContents");
            RdlRender.AddTextbox2010(xmlWriter, "Group" + _name, TextboxValue, _textboxStyle,
                                     RdlFormatter.FormatAlignment(_dataType), "0in", "0in", ".5in", "true",
                                     "", "", "", "", "", "", "", "", "", "", _hyperlink);
            xmlWriter.WriteEndElement(); //CellContents
            xmlWriter.WriteEndElement(); //TablixCell
        }