Click here to Skip to main content
15,898,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When I add a Matrix to the Layout page in the BIDS designer, it creates two columns. I need more. I would expect the Matrix control to have a "ColumnCount" property, but it doesn't.

My next expectation would be that the Matrix would provide a context-sensitve menu allowing me to insert columns. It doesn't. If I click the matrix, it selects instead a textbox. Although I can get to the matrix by pressing the "Esc" key to make the Matrix the selected control, there still is no likely option in the context menu or on its properties page.

Adding columns has got to be one of the most common things to do - how is it done?

UPDATE: Trying to make sense of the .rdl file doesn't help me much; it seems to have no rhyme or reason to the way things are organized in it. On the design surface, I have a Matrix with two columns and two rows. Row 1 contains two labels in Textboxes. Row 2 contains textboxes with field expressions assigned to their Value property. Yet the .rdl (xml) file has one of the labels ("WEEK 1 USAGE") in a ColumnGroupings.ColumnGrouping.DynamicColumns.ReportItems section, and the other ("DESCRIPTION") in a Corner.ReportItems section.

As to the data, one (PROACTDESCRIPTION.Value) is in a RowGroupings.RowGrouping.DynamicRows.ReportItems section, and the other (WEEK1USAGE.Value) in a MatrixRows.MatrixRow.MatrixCells.MatrixCell.ReportItems section.

To prove that I haven't gone craz[ier,y], here's the rdl/xml for the matrix in question:

XML
  <Matrix Name="matrix1">

    <MatrixColumns>
      <MatrixColumn>
        <Width>2.375in</Width>
      </MatrixColumn>
    </MatrixColumns>

// PROACTDESCRIPTION data
    <RowGroupings>
      <RowGrouping>
        <Width>2.75in</Width>
        <DynamicRows>
          <Grouping Name="matrix1_RowGroup1">
            <GroupExpressions>
              <GroupExpression />
            </GroupExpressions>
          </Grouping>
          <ReportItems>
            <Textbox Name="textboxDescription">
              <Style>
                <FontSize>11pt</FontSize>
                <PaddingLeft>2pt</PaddingLeft>
                <PaddingRight>2pt</PaddingRight>
                <PaddingTop>2pt</PaddingTop>
                <PaddingBottom>2pt</PaddingBottom>
              </Style>
              <ZIndex>1</ZIndex>
              <CanGrow>true</CanGrow>
              <Value>=Fields!PROACTDESCRIPTION.Value</Value>
            </Textbox>
          </ReportItems>
        </DynamicRows>
      </RowGrouping>
    </RowGroupings>

// "WEEK 1 USAGE" label
    <ColumnGroupings>
      <ColumnGrouping>
        <Height>0.25in</Height>
        <DynamicColumns>
          <Grouping Name="matrix1_ColumnGroup1">
            <GroupExpressions>
              <GroupExpression />
            </GroupExpressions>
          </Grouping>
          <ReportItems>
            <Textbox Name="textbox3">
              <rd:DefaultName>textbox3</rd:DefaultName>
              <Style>
                <FontSize>12pt</FontSize>
                <FontWeight>700</FontWeight>
                <PaddingLeft>2pt</PaddingLeft>
                <PaddingRight>2pt</PaddingRight>
                <PaddingTop>2pt</PaddingTop>
                <PaddingBottom>2pt</PaddingBottom>
              </Style>
              <ZIndex>2</ZIndex>
              <CanGrow>true</CanGrow>
              <Value>WEEK 1 USAGE</Value>
            </Textbox>
          </ReportItems>
        </DynamicColumns>
      </ColumnGrouping>
    </ColumnGroupings>

// "DESCRIPTION" label
    <Corner>
      <ReportItems>
        <Textbox Name="textbox2">
          <rd:DefaultName>textbox2</rd:DefaultName>
          <Style>
            <FontSize>12pt</FontSize>
            <FontWeight>700</FontWeight>
            <PaddingLeft>2pt</PaddingLeft>
            <PaddingRight>2pt</PaddingRight>
            <PaddingTop>2pt</PaddingTop>
            <PaddingBottom>2pt</PaddingBottom>
          </Style>
          <ZIndex>3</ZIndex>
          <CanGrow>true</CanGrow>
          <Value>DESCRIPTION</Value>
        </Textbox>
      </ReportItems>
    </Corner>

// WEEK1USAGE data
    <MatrixRows>
      <MatrixRow>
        <Height>0.25in</Height>
        <MatrixCells>
          <MatrixCell>
            <ReportItems>
              <Textbox Name="textboxWeek1Usage">
                <Style>
                  <FontSize>11pt</FontSize>
                  <PaddingLeft>2pt</PaddingLeft>
                  <PaddingRight>2pt</PaddingRight>
                  <PaddingTop>2pt</PaddingTop>
                  <PaddingBottom>2pt</PaddingBottom>
                </Style>
                <CanGrow>true</CanGrow>
                <Value>=Fields!WEEK1USAGE.Value</Value>
              </Textbox>
            </ReportItems>
          </MatrixCell>
        </MatrixCells>
      </MatrixRow>
    </MatrixRows>
    <Height>0.5in</Height>
    <Left>0.25in</Left>
  </Matrix>
Posted
Updated 21-Jan-16 5:26am
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900