Ejemplo n.º 1
0
        /// <summary>
        /// Generates a table header text box to allow text alignment in a TableHeader
        /// object.
        /// </summary>
        /// <param name="name">Name of this textbox.</param>
        /// <param name="caption">Caption of this textbox.</param>
        /// <param name="isRightAligned">Indicate the textbox alignment. True: right-aligned.</param>
        public TableHeaderTextBox(string name, string caption, bool isRightAligned)
        {
            _name    = name;
            _caption = caption;

            if (!isRightAligned)
            {
                Dictionary <string, object> styleHolder = new Dictionary <string, object>();

                styleHolder.Add("style", ReportingServicesStyle.TextBoxStyle.TableHeaderTextBox);

                _textboxStyle = SimpleServiceLocator.Instance.Get <IReportingServicesStyle>("ReportingServicesStyle", styleHolder);
                // new ReportingServicesStyle(
                //ReportingServicesStyle.TextBoxStyle.TableHeaderTextBox);
            }
            else
            {
                Dictionary <string, object> styleHolder = new Dictionary <string, object>();

                styleHolder.Add("style", ReportingServicesStyle.TextBoxStyle.TableHeaderTextBox);
                styleHolder.Add("rightAlign", "Right");

                _textboxStyle = SimpleServiceLocator.Instance.Get <IReportingServicesStyle>("ReportingServicesStyleRight", styleHolder);//new ReportingServicesStyle(
                //ReportingServicesStyle.TextBoxStyle.TableHeaderTextBox, "Right");
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Adds a Textbox rendered in RDL to an XmlWriter. The parameters allow all
        /// information that a textbox may accept to be passed. If an empty string is
        /// passed then no element tags will added to the RDL for that element. Refer to
        /// Reporting Services documentation to see which elements are required.
        /// </summary>
        /// <param name="xmlWriter">The XmlWriter object to render to.</param>

        public static void AddTextbox2010(XmlWriter xmlWriter, string nameAttribute,
                                          string valueElement, IReportingServicesStyle textboxStyle, string textAlign,
                                          string top, string left, string width, string canGrow, string height,
                                          string zIndex, string visibility, string toolTip, string label,
                                          string linkToChild, string bookmark, string repeatWith, string canShrink,
                                          string hideDuplicates, string hyperlink = null)
        {
            //TODO: Code Review Issue 11/05/05: give comment and/or indent the code as in XML
            //to increase readability
            // Done 24/05/2005
            xmlWriter.WriteStartElement("Textbox");
            xmlWriter.WriteAttributeString("Name", nameAttribute);
            //AddLine(xmlWriter, "KeepTogether", keepTogether);
            xmlWriter.WriteStartElement("Paragraphs");
            xmlWriter.WriteStartElement("Paragraph");
            xmlWriter.WriteStartElement("TextRuns");
            xmlWriter.WriteStartElement("TextRun");
            xmlWriter.WriteStartElement("Value");
            xmlWriter.WriteString(valueElement);
            xmlWriter.WriteEndElement();//Value
            if (hyperlink != null)
            {
                xmlWriter.WriteStartElement("ActionInfo");
                xmlWriter.WriteStartElement("Actions");
                xmlWriter.WriteStartElement("Action");
                AddLine(xmlWriter, "Hyperlink", hyperlink);
                xmlWriter.WriteEndElement(); //Action</Action>
                xmlWriter.WriteEndElement(); //Actions</Actions>
                xmlWriter.WriteEndElement(); //ActionInfo
            }
            textboxStyle.Render2010TextRun(xmlWriter);
            xmlWriter.WriteEndElement(); //TextRun
            xmlWriter.WriteEndElement(); //TextRuns
            xmlWriter.WriteEndElement(); //Paragraph
            xmlWriter.WriteEndElement(); //Paragraphs
            textboxStyle.Render2010TextBox(xmlWriter);


            AddLine(xmlWriter, "CanGrow", canGrow);
            AddLine(xmlWriter, "Top", top);
            AddLine(xmlWriter, "Left", left);
            AddLine(xmlWriter, "Height", height);
            AddLine(xmlWriter, "Width", width);
            AddLine(xmlWriter, "ZIndex", zIndex);
            AddLine(xmlWriter, "Visibility", visibility);
            AddLine(xmlWriter, "ToolTip", toolTip);
            AddLine(xmlWriter, "DocumentMapLabel", label);
            AddLine(xmlWriter, "LinkToChild", linkToChild);
            AddLine(xmlWriter, "Bookmark", bookmark);
            AddLine(xmlWriter, "RepeatWith", repeatWith);
            AddLine(xmlWriter, "CanShrink", canShrink);
            AddLine(xmlWriter, "HideDuplicates", hideDuplicates);

            xmlWriter.WriteEndElement();//TextBox
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Adds a Textbox rendered in RDL to an XmlWriter. The parameters allow all
        /// information that a textbox may accept to be passed. If an empty string is
        /// passed then no element tags will added to the RDL for that element. Refer to
        /// Reporting Services documentation to see which elements are required.
        /// </summary>
        /// <param name="xmlWriter">The XmlWriter object to render to.</param>

        public static void AddTextbox(XmlWriter xmlWriter, string nameAttribute,
                                      string valueElement, IReportingServicesStyle textboxStyle, string textAlign,
                                      string top, string left, string width, string canGrow, string height,
                                      string zIndex, string visibility, string toolTip, string label,
                                      string linkToChild, string bookmark, string repeatWith, string canShrink,
                                      string hideDuplicates)
        {
            //TODO: Code Review Issue 11/05/05: give comment and/or indent the code as in XML
            //to increase readability
            // Done 24/05/2005
            xmlWriter.WriteStartElement("Textbox");
            xmlWriter.WriteAttributeString("Name", nameAttribute);

            xmlWriter.WriteStartElement("Value");
            xmlWriter.WriteString(valueElement);
            xmlWriter.WriteEndElement();

            textboxStyle.Render(xmlWriter);

            AddLine(xmlWriter, "Top", top);
            AddLine(xmlWriter, "Left", left);
            AddLine(xmlWriter, "Height", height);
            AddLine(xmlWriter, "Width", width);
            AddLine(xmlWriter, "CanGrow", canGrow);
            AddLine(xmlWriter, "ZIndex", zIndex);
            AddLine(xmlWriter, "Visibility", visibility);
            AddLine(xmlWriter, "ToolTip", toolTip);
            AddLine(xmlWriter, "Label", label);
            AddLine(xmlWriter, "LinkToChild", linkToChild);
            AddLine(xmlWriter, "Bookmark", bookmark);
            AddLine(xmlWriter, "RepeatWith", repeatWith);
            AddLine(xmlWriter, "CanShrink", canShrink);
            AddLine(xmlWriter, "HideDuplicates", hideDuplicates);


            xmlWriter.WriteEndElement();
        }