public Rdl.TablixType CreateTable() { Tablix table = new Tablix(); table.Style = new Style { Border = new Border { Style = "Solid" }.Create() }.Create(); table.TablixBody = new TablixBody().Create(); TablixBody tableBody = new TablixBody(); tableBody.TablixColumns = new TablixColumnsType[] { CreateTablixColumns() }; TablixRows rows = new TablixRows(); List<TablixRowType> rowList = new List<TablixRowType>(); TablixMembersType m_rowHierarchy = new TablixMembersType(); List<TablixMemberType> members = new List<TablixMemberType>(); if (ShowHeader) { rowList.Add( CreateHeaderTableRow()); TablixMember m = new TablixMember(); m.KeepWithGroup = TablixMemberTypeKeepWithGroup.After; members.Add(m.Create()); } if (ShowDetails) { rowList.Add(CreateTableRow()); //����Ϊ��ϸ TablixMember m = new TablixMember(); GroupType g = new GroupType(); g.Name = "��ϸ��Ϣ"; m.Group = g; TablixMembersType childMembers = new TablixMembersType(); TablixMember childMember = new TablixMember(); childMembers.TablixMember = new TablixMemberType[] { childMember.Create() }; m.TablixMembers=childMembers; members.Add(m.Create()); } rows.TablixRow = rowList.ToArray(); //<TablixRowHierarchy> m_rowHierarchy.TablixMember = members.ToArray(); TablixHierarchy rowHierarchy = new TablixHierarchy(); rowHierarchy.TablixMembers = new TablixMembersType[] { m_rowHierarchy }; table.TablixRowHierarchy = rowHierarchy.Create(); //if (Parent.Grouping!=null) //{ // table.TableGroups = CreateTableGroups(); //} tableBody.TablixRows = new TablixRowsType[]{ rows.Create()}; table.TablixBody = tableBody.Create(); //<TablixColumnHierarchy> table.TablixColumnHierarchy = CreateTablixColumnHierarchy(); table.Top = "0.2mm"; table.Left = Parent.LeftMargin.ToString() + "mm"; return table.Create(TableName); }
public TablixMembersType CreateMs(TablixMembersType parent, bool isStart, bool isRow) { if (isStart) { _level = 0; } var limit = isRow ? this.Columns.Count : this.Rows.Count; var tablixMember = new TablixMember(); if ((!isRow && _level == limit - 1) || (isRow && _level==0)) { tablixMember.Visibility = new Visibility() {Hidden = "true"}.Create(); var group = new Group { GroupExpressions = new GroupExpressionsType() {GroupExpression=new string[]{""} } }; tablixMember.Group = group.Create(isRow?"RowGroup":"ColumnGroup"); } var heaer = new TablixHeader(); var contents = new CellContents() { Textbox = CreateTextbox("",true) }.Create(); heaer.CellContents = new CellContentsType[] { contents }; string size = isRow ? this.Columns[_level].Width : this.Rows[_level].Height; heaer.Size = new string[] { size }; tablixMember.TablixHeader = heaer.Create(); _level++; if (_level < limit) { tablixMember.TablixMembers = CreateMs(new TablixMembersType(), false, isRow); } parent.TablixMember = new TablixMemberType[] { tablixMember.Create() }; return parent; }
public TablixHierarchyType CreateTablixColumnHierarchy() { TablixMembersType main = new TablixMembersType(); List<TablixMemberType> members = new List<TablixMemberType>(); foreach (var f in m_fields) { TablixMember m = new TablixMember(); members.Add(m.Create()); } main.TablixMember = members.ToArray(); TablixHierarchy hie = new TablixHierarchy(); hie.TablixMembers = new TablixMembersType[] { main }; return hie.Create(); }