Пример #1
0
        private static TextboxType CreateTablixTextBoxField(RdlColumnHeader item)
        {
            var textBoxStyle = new StyleType
            {
                Items = new object[]
                {
                    "2pt",
                    "2pt",
                    "2pt",
                    "2pt",
                    new BorderType
                    {
                        Items = new object[]
                        {
                            "Solid",
                            "LightGrey"
                        },
                        ItemsElementName = new []
                        {
                            ItemsChoiceType2.Style,
                            ItemsChoiceType2.Color,
                        }
                    }
                },
                ItemsElementName = new[] {
                    ItemsChoiceType4.PaddingLeft,
                    ItemsChoiceType4.PaddingRight,
                    ItemsChoiceType4.PaddingTop,
                    ItemsChoiceType4.PaddingBottom,
                    ItemsChoiceType4.Border,
                }
            };
            var textBoxParagraphs = new ParagraphsType
            {
                Paragraph = (new List <ParagraphType>
                {
                    new ParagraphType
                    {
                        Items = new object[]
                        {
                            new TextRunsType
                            {
                                TextRun = (new List <TextRunType>
                                {
                                    new TextRunType
                                    {
                                        Items = new object[]
                                        {
                                            new LocIDStringWithDataTypeAttribute
                                            {
                                                Value = "=Fields!" + item.Value + ".Value"
                                            },
                                            new StyleType
                                            {
                                                Items = new object[]
                                                {
                                                    "8pt"
                                                },
                                                ItemsElementName = new []
                                                {
                                                    ItemsChoiceType4.FontSize
                                                }
                                            }
                                        },
                                        ItemsElementName = new []
                                        {
                                            ItemsChoiceType11.Value,
                                            ItemsChoiceType11.Style,
                                        }
                                    }
                                }).ToArray()
                            }
                        },
                        ItemsElementName = new[]
                        {
                            ItemsChoiceType12.TextRuns,
                            ItemsChoiceType12.Style,
                        }
                    }
                }).ToArray()
            };

            return(new TextboxType
            {
                Name = item.Value,
                Items = new object[]
                {
                    true,
                    true,
                    textBoxParagraphs,
                    textBoxStyle
                },
                ItemsElementName = new[]
                {
                    ItemsChoiceType14.CanGrow,
                    ItemsChoiceType14.KeepTogether,
                    ItemsChoiceType14.Paragraphs,
                    ItemsChoiceType14.Style,
                }
            });
        }
Пример #2
0
        private static TextboxType CreateTablixTextBoxHeader(RdlColumnHeader item)
        {
            var textBoxStyle = new StyleType
            {
                Items = new object[] {
                    "2pt",
                    "2pt",
                    "2pt",
                    "2pt",
                    "#1b75cd",
                    new BorderType {
                        Items = new object[] {
                            "Solid",
                            "LightGrey"
                        },
                        ItemsElementName = new [] {
                            ItemsChoiceType2.Style,
                            ItemsChoiceType2.Color,
                        }
                    }
                },
                ItemsElementName = new[] {
                    ItemsChoiceType4.PaddingLeft,
                    ItemsChoiceType4.PaddingRight,
                    ItemsChoiceType4.PaddingTop,
                    ItemsChoiceType4.PaddingBottom,
                    ItemsChoiceType4.BackgroundColor,
                    ItemsChoiceType4.Border,
                }
            };
            var textBoxParagraphs = new ParagraphsType
            {
                Paragraph = (new List <ParagraphType> {
                    new ParagraphType {
                        Items = new object[] {
                            new TextRunsType {
                                TextRun = (new List <TextRunType> {
                                    new TextRunType {
                                        Items = new object[] {
                                            new LocIDStringWithDataTypeAttribute {
                                                Value = item.Text
                                            },
                                            new StyleType {
                                                Items = new object[] {
                                                    "White",
                                                    "Bold"
                                                },
                                                ItemsElementName = new [] {
                                                    ItemsChoiceType4.Color,
                                                    ItemsChoiceType4.FontWeight,
                                                }
                                            }
                                        },
                                        ItemsElementName = new [] {
                                            ItemsChoiceType11.Value,
                                            ItemsChoiceType11.Style,
                                        }
                                    }
                                }).ToArray()
                            },
                            new StyleType {
                                Items = new object[] {
                                    "Center"
                                },
                                ItemsElementName = new [] {
                                    ItemsChoiceType4.TextAlign,
                                }
                            }
                        },
                        ItemsElementName = new[] {
                            ItemsChoiceType12.TextRuns,
                            ItemsChoiceType12.Style,
                        }
                    }
                }).ToArray()
            };

            return(new TextboxType
            {
                Name = "textBox" + Guid.NewGuid().ToString().Split('-')[0],
                Items = new object[] {
                    true,
                    true,
                    textBoxParagraphs,
                    textBoxStyle
                },
                ItemsElementName = new[] {
                    ItemsChoiceType14.CanGrow,
                    ItemsChoiceType14.KeepTogether,
                    ItemsChoiceType14.Paragraphs,
                    ItemsChoiceType14.Style,
                }
            });
        }