private Rdl.TextboxType CreateTextBox(TextItem item) { Rdl.TextboxType textbox = new Rdl.TextboxType(); textbox.Name = item.Key; textbox.Items = new object[] { item.Text, CreateTextboxStyle(item), true, (item.Rect.Left / 96.0) + "in", (item.Rect.Top / 96.0) + "in", (item.Rect.Width / 96.0) + "in", (item.Rect.Height / 96.0) + "in", }; textbox.ItemsElementName = new Rdl.ItemsChoiceType14[] { Rdl.ItemsChoiceType14.Value, Rdl.ItemsChoiceType14.Style, Rdl.ItemsChoiceType14.CanGrow, Rdl.ItemsChoiceType14.Left, Rdl.ItemsChoiceType14.Top, Rdl.ItemsChoiceType14.Width, Rdl.ItemsChoiceType14.Height, }; return textbox; }
private Rdl.TextboxType CreateHeaderTableCellTextbox(TextItem item) { Rdl.TextboxType headerTableCellTextbox = new Rdl.TextboxType(); headerTableCellTextbox.Name = item.Text + "_Header"; headerTableCellTextbox.Items = new object[] { item.Text, CreateHeaderTableCellTextboxStyle(item), true, }; headerTableCellTextbox.ItemsElementName = new Rdl.ItemsChoiceType14[] { Rdl.ItemsChoiceType14.Value, Rdl.ItemsChoiceType14.Style, Rdl.ItemsChoiceType14.CanGrow, }; return(headerTableCellTextbox); }
private Rdl.TextboxType CreateTableCellTextbox(TextItem item) { Rdl.TextboxType textbox = new Rdl.TextboxType(); textbox.Name = item.Key; textbox.Items = new object[] { "=Fields!" + item.DataMember + ".Value", CreateTableCellTextboxStyle(item), true, }; textbox.ItemsElementName = new Rdl.ItemsChoiceType14[] { Rdl.ItemsChoiceType14.Value, Rdl.ItemsChoiceType14.Style, Rdl.ItemsChoiceType14.CanGrow, }; return(textbox); }
private Rdl.StyleType CreateTextboxStyle(TextItem item) { Rdl.StyleType style = new Rdl.StyleType(); style.Items = new object[] { GetAlign(item.Align.Alignment), GetVAlign(item.Align.LineAlignment), item.Font.Name, item.Font.Size + "pt", item.Font.Bold ? "700" : "100", }; style.ItemsElementName = new Rdl.ItemsChoiceType5[] { Rdl.ItemsChoiceType5.TextAlign, Rdl.ItemsChoiceType5.VerticalAlign, Rdl.ItemsChoiceType5.FontFamily, Rdl.ItemsChoiceType5.FontSize, Rdl.ItemsChoiceType5.FontWeight, }; return(style); }
private Rdl.StyleType CreateTextboxStyle(TextItem item) { Rdl.StyleType style = new Rdl.StyleType(); style.Items = new object[] { GetAlign(item.Align.Alignment), GetVAlign(item.Align.LineAlignment), item.Font.Name, item.Font.Size + "pt", item.Font.Bold ? "700" : "100", }; style.ItemsElementName = new Rdl.ItemsChoiceType5[] { Rdl.ItemsChoiceType5.TextAlign, Rdl.ItemsChoiceType5.VerticalAlign, Rdl.ItemsChoiceType5.FontFamily, Rdl.ItemsChoiceType5.FontSize, Rdl.ItemsChoiceType5.FontWeight, }; return style; }
private Rdl.StyleType CreateHeaderTableCellTextboxStyle(TextItem item) { Rdl.StyleType headerTableCellTextboxStyle = new Rdl.StyleType(); headerTableCellTextboxStyle.Items = new object[] { item.HeaderFont.Name, item.HeaderFont.Size + "pt", item.HeaderFont.Bold ? "700" : "100", "Center", "Middle", CreateBorderStyle(), }; headerTableCellTextboxStyle.ItemsElementName = new Rdl.ItemsChoiceType5[] { Rdl.ItemsChoiceType5.FontFamily, Rdl.ItemsChoiceType5.FontSize, Rdl.ItemsChoiceType5.FontWeight, Rdl.ItemsChoiceType5.TextAlign, Rdl.ItemsChoiceType5.VerticalAlign, Rdl.ItemsChoiceType5.BorderStyle, }; return(headerTableCellTextboxStyle); }
private Rdl.ReportItemsType CreateHeaderTableCellReportItems(TextItem item) { Rdl.ReportItemsType headerTableCellReportItems = new Rdl.ReportItemsType(); headerTableCellReportItems.Items = new object[] { CreateHeaderTableCellTextbox(item) }; return headerTableCellReportItems; }
private Rdl.TableCellType CreateHeaderTableCell(TextItem item) { Rdl.TableCellType headerTableCell = new Rdl.TableCellType(); headerTableCell.Items = new object[] { CreateHeaderTableCellReportItems(item) }; return headerTableCell; }
private Rdl.TableColumnType CreateTableColumn(TextItem item) { Rdl.TableColumnType tableColumn = new Rdl.TableColumnType(); tableColumn.Items = new object[] { (item.Rect.Width / 96.0) + "in" }; return tableColumn; }
private Rdl.StyleType CreateTableCellTextboxStyle(TextItem item) { Rdl.StyleType style = new Rdl.StyleType(); style.Items = new object[] { item.Font.Name, item.Font.Size + "pt", item.Font.Bold ? "400" : "100", GetAlign(item.Align.Alignment), "Middle", CreateBorderStyle(), "1pt", "1pt", "1pt", "1pt", }; style.ItemsElementName = new Rdl.ItemsChoiceType5[] { Rdl.ItemsChoiceType5.FontFamily, Rdl.ItemsChoiceType5.FontSize, Rdl.ItemsChoiceType5.FontWeight, Rdl.ItemsChoiceType5.TextAlign, Rdl.ItemsChoiceType5.VerticalAlign, Rdl.ItemsChoiceType5.BorderStyle, Rdl.ItemsChoiceType5.PaddingLeft, Rdl.ItemsChoiceType5.PaddingTop, Rdl.ItemsChoiceType5.PaddingRight, Rdl.ItemsChoiceType5.PaddingBottom, }; return style; }
private Rdl.TextboxType CreateTableCellTextbox(TextItem item) { Rdl.TextboxType textbox = new Rdl.TextboxType(); textbox.Name = item.Key; textbox.Items = new object[] { "=Fields!" + item.DataMember + ".Value", CreateTableCellTextboxStyle(item), true, }; textbox.ItemsElementName = new Rdl.ItemsChoiceType14[] { Rdl.ItemsChoiceType14.Value, Rdl.ItemsChoiceType14.Style, Rdl.ItemsChoiceType14.CanGrow, }; return textbox; }
private Rdl.TableCellType CreateTableCell(TextItem item) { Rdl.TableCellType tableCell = new Rdl.TableCellType(); tableCell.Items = new object[] { CreateTableCellReportItems(item) }; return tableCell; }
private Rdl.TextboxType CreateHeaderTableCellTextbox(TextItem item) { Rdl.TextboxType headerTableCellTextbox = new Rdl.TextboxType(); headerTableCellTextbox.Name = item.Text + "_Header"; headerTableCellTextbox.Items = new object[] { item.Text, CreateHeaderTableCellTextboxStyle(item), true, }; headerTableCellTextbox.ItemsElementName = new Rdl.ItemsChoiceType14[] { Rdl.ItemsChoiceType14.Value, Rdl.ItemsChoiceType14.Style, Rdl.ItemsChoiceType14.CanGrow, }; return headerTableCellTextbox; }
private Rdl.ReportItemsType CreateHeaderTableCellReportItems(TextItem item) { Rdl.ReportItemsType headerTableCellReportItems = new Rdl.ReportItemsType(); headerTableCellReportItems.Items = new object[] { CreateHeaderTableCellTextbox(item) }; return(headerTableCellReportItems); }
private Rdl.TableCellType CreateHeaderTableCell(TextItem item) { Rdl.TableCellType headerTableCell = new Rdl.TableCellType(); headerTableCell.Items = new object[] { CreateHeaderTableCellReportItems(item) }; return(headerTableCell); }
private Rdl.TableColumnType CreateTableColumn(TextItem item) { Rdl.TableColumnType tableColumn = new Rdl.TableColumnType(); tableColumn.Items = new object[] { (item.Rect.Width / 96.0) + "in" }; return(tableColumn); }
private Rdl.TableCellType CreateTableCell(TextItem item) { Rdl.TableCellType tableCell = new Rdl.TableCellType(); tableCell.Items = new object[] { CreateTableCellReportItems(item) }; return(tableCell); }
public ReportConfig(string frpFile) { _filename = frpFile; XmlDocument xdoc = new XmlDocument(); xdoc.Load(frpFile); XmlNode pnode = xdoc.SelectSingleNode("//configuration/pageset"); ReportConfig.GetAttribute(pnode, "unit", ref _unit); if (string.IsNullOrEmpty(_unit)) //没有单位 { //页面大小 int w = 0, h = 0; ReportConfig.GetAttribute(pnode, "width", ref w); ReportConfig.GetAttribute(pnode, "height", ref h); _autosize = h == 0; _pset.PaperSize = new PaperSize(frpFile, w, h); //页边距 int m_left = 0, m_top = 0, m_right = 0, m_bottom = 0; ReportConfig.GetAttribute(pnode, "margin-left", ref m_left); ReportConfig.GetAttribute(pnode, "margin-top", ref m_top); ReportConfig.GetAttribute(pnode, "margin-right", ref m_right); ReportConfig.GetAttribute(pnode, "margin-bottom", ref m_bottom); _pset.Margins = new Margins(m_left, m_right, m_top, m_bottom); } else { ReportConfig.GetAttribute(pnode, "width", ref _width); ReportConfig.GetAttribute(pnode, "height", ref _height); ReportConfig.GetAttribute(pnode, "margin-left", ref _lm); ReportConfig.GetAttribute(pnode, "margin-top", ref _tm); ReportConfig.GetAttribute(pnode, "margin-right", ref _rm); ReportConfig.GetAttribute(pnode, "margin-bottom", ref _bm); } //头 pnode = xdoc.SelectSingleNode("//configuration/header"); ReportConfig.GetAttribute(pnode, "height", ref _headheight); //字段 foreach (XmlNode node in xdoc.SelectNodes("//configuration/header/textitem")) { TextItem item = new TextItem(node); if (_header == null) { _header = new Dictionary <string, TextItem>(); } _header.Add(item.Key, item); } //尾 pnode = xdoc.SelectSingleNode("//configuration/footer"); ReportConfig.GetAttribute(pnode, "height", ref _footheight); //字段 foreach (XmlNode node in xdoc.SelectNodes("//configuration/footer/textitem")) { TextItem item = new TextItem(node); if (_footer == null) { _footer = new Dictionary <string, TextItem>(); } _footer.Add(item.Key, item); } //数据字段 foreach (XmlNode node in xdoc.SelectNodes("//configuration/dataitem/textitem")) { TextItem item = new TextItem(node); if (_dataitem == null) { _dataitem = new Dictionary <string, TextItem>(); } _dataitem.Add(item.Key, item); } }
private Rdl.StyleType CreateHeaderTableCellTextboxStyle(TextItem item) { Rdl.StyleType headerTableCellTextboxStyle = new Rdl.StyleType(); headerTableCellTextboxStyle.Items = new object[] { item.HeaderFont.Name, item.HeaderFont.Size + "pt", item.HeaderFont.Bold ? "700" : "100", "Center", "Middle", CreateBorderStyle(), }; headerTableCellTextboxStyle.ItemsElementName = new Rdl.ItemsChoiceType5[] { Rdl.ItemsChoiceType5.FontFamily, Rdl.ItemsChoiceType5.FontSize, Rdl.ItemsChoiceType5.FontWeight, Rdl.ItemsChoiceType5.TextAlign, Rdl.ItemsChoiceType5.VerticalAlign, Rdl.ItemsChoiceType5.BorderStyle, }; return headerTableCellTextboxStyle; }
private Rdl.FieldType CreateField(TextItem item) { Rdl.FieldType field = new Rdl.FieldType(); field.Name = item.DataMember; field.Items = new object[] { item.DataMember }; field.ItemsElementName = new Rdl.ItemsChoiceType1[] { Rdl.ItemsChoiceType1.DataField }; return field; }
public ReportConfig(string frpFile) { _filename = frpFile; XmlDocument xdoc = new XmlDocument(); xdoc.Load(frpFile); XmlNode pnode = xdoc.SelectSingleNode("//configuration/pageset"); ReportConfig.GetAttribute(pnode, "unit", ref _unit); if (string.IsNullOrEmpty(_unit)) //没有单位 { //页面大小 int w = 0, h = 0; ReportConfig.GetAttribute(pnode, "width", ref w); ReportConfig.GetAttribute(pnode, "height", ref h); _autosize = h == 0; _pset.PaperSize = new PaperSize(frpFile, w, h); //页边距 int m_left = 0, m_top = 0, m_right = 0, m_bottom = 0; ReportConfig.GetAttribute(pnode, "margin-left", ref m_left); ReportConfig.GetAttribute(pnode, "margin-top", ref m_top); ReportConfig.GetAttribute(pnode, "margin-right", ref m_right); ReportConfig.GetAttribute(pnode, "margin-bottom", ref m_bottom); _pset.Margins = new Margins(m_left, m_right, m_top, m_bottom); } else { ReportConfig.GetAttribute(pnode, "width", ref _width); ReportConfig.GetAttribute(pnode, "height", ref _height); ReportConfig.GetAttribute(pnode, "margin-left", ref _lm); ReportConfig.GetAttribute(pnode, "margin-top", ref _tm); ReportConfig.GetAttribute(pnode, "margin-right", ref _rm); ReportConfig.GetAttribute(pnode, "margin-bottom", ref _bm); } //头 pnode = xdoc.SelectSingleNode("//configuration/header"); ReportConfig.GetAttribute(pnode, "height", ref _headheight); //字段 foreach (XmlNode node in xdoc.SelectNodes("//configuration/header/textitem")) { TextItem item = new TextItem(node); if (_header == null) { _header = new Dictionary<string, TextItem>(); } _header.Add(item.Key, item); } //尾 pnode = xdoc.SelectSingleNode("//configuration/footer"); ReportConfig.GetAttribute(pnode, "height", ref _footheight); //字段 foreach (XmlNode node in xdoc.SelectNodes("//configuration/footer/textitem")) { TextItem item = new TextItem(node); if (_footer == null) { _footer = new Dictionary<string, TextItem>(); } _footer.Add(item.Key, item); } //数据字段 foreach (XmlNode node in xdoc.SelectNodes("//configuration/dataitem/textitem")) { TextItem item = new TextItem(node); if (_dataitem == null) { _dataitem = new Dictionary<string, TextItem>(); } _dataitem.Add(item.Key, item); } }