locked
Is Repeating Columns Possible? RRS feed

  • Question

  • User-1542511547 posted

    Good Afternoon,

    I have a list of names, say 500, I would like to have five columns on the page.

    Column 1 the first (25) names, column 2 the next (25) and so on to column 5.  This way I get (125) names on the first page.

    Report inserts a page break and repeats until all names are exhausted.

    Is there a way to do this with the design time tools or do I need to hand code a series of loops with TR and TD tags?

    Guessing I need to code and that design time tools won't do it but couldn't hurt to ask some of the experts out there.

    Thx,

    Douglas

    Monday, October 15, 2012 1:02 PM

Answers

  • User2105670541 posted

    Hi Dmoody007,

    I'm unaware if there are straight support for such situation but I have a workarround for you.

    in your procedure or sql query, from where you are getting the values add one more column. I would call that column Group1 and add four different values to it like below recordset:

    Names, Group1
    ABC A
    CDE B
    FGH C
    IJK D

    1ABC A
    1CDE B
    1FGH C
    1IJK D

    2ABC A
    2CDE B
    2FGH C
    2IJK D

    3ABC A
    3CDE B
    3FGH C
    3IJK D

    Now you can have a query like below in your dataset:

    select Names, Group1 from your TempTable

    Now add a matrix, and in the rows of column group add the names, and in the header add group1. This thing will solve your purpose. Now you just set need to set the text visibility so that you cannot see the A,B,C,D as column header.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 17, 2012 2:05 AM

All replies

  • User-1542511547 posted

    Been playing around and I found that I can create a second report that allows me to do exactly what I want.  I then need to embed this second report as a subreport.  My current issue is dealing with Parameters.  My Primary report and my new secondary (sub report) both require the same Parameter.  The stored procedures behind each is looking for @NameSrc.  In the ASP page, I have the following for the data sources:

                <SelectParameters>
                    <asp:QueryStringParameter DefaultValue="UCA" Name="NameSrc" QueryStringField="NameSrc" Type="String" />
                </SelectParameters>

    Any suggestions would be appreciated.

    Monday, October 15, 2012 3:48 PM
  • User-1716253493 posted

    Use tiled listview with groupitemcount=5

        <asp:ListView ID="ListView1" runat="server" DataKeyNames="ID" 
            DataSourceID="SqlDataSource1" GroupItemCount="5">

    Monday, October 15, 2012 11:07 PM
  • User-1542511547 posted

    oned_gk,

    First off, thank you!

    Your response didn't exactly answer the question but sent me in a direction that appears to work.  I failed to mention that I am using Visual Studio 2008.  My reports are written in the design time features so I couldn't use the ASP.net code above.  Or, I should say, if I can, I don't know how to input this code in the report designer.

    I was able to use list but I had to follow this example:

    Make four list containers, each tied to the same dataset and each side by side across the report.  In the properties of each list, Under the visibility tab, I input an expression as follows: =iif(rownumber(nothing) mod 4=1,false, true).  I repeat from left to right changing only 4=2, 3, and lastly 0.

    This is giving me a list of names alpha from left to right.  So:

    A       B     C     D

    E      

    I originally wanted this:

    A       D

    B        E

    C

    Also, I noticed a small glitch towards the end of the list:

    Widmer           Wye              Yoon            Weiner

    York                Yorty                                 Yoon

    I don't understand why Yoon is listed twice and out of position.

    If you have ideas or suggestions, it would be appreciated.

    Douglas

    Tuesday, October 16, 2012 11:04 AM
  • User2105670541 posted

    Hi Dmoody007,

    I'm unaware if there are straight support for such situation but I have a workarround for you.

    in your procedure or sql query, from where you are getting the values add one more column. I would call that column Group1 and add four different values to it like below recordset:

    Names, Group1
    ABC A
    CDE B
    FGH C
    IJK D

    1ABC A
    1CDE B
    1FGH C
    1IJK D

    2ABC A
    2CDE B
    2FGH C
    2IJK D

    3ABC A
    3CDE B
    3FGH C
    3IJK D

    Now you can have a query like below in your dataset:

    select Names, Group1 from your TempTable

    Now add a matrix, and in the rows of column group add the names, and in the header add group1. This thing will solve your purpose. Now you just set need to set the text visibility so that you cannot see the A,B,C,D as column header.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 17, 2012 2:05 AM
  • User-1542511547 posted

    Ashutosh,

    Thank you.  Longer process than I wanted but it works and output meets the boss's needs.  Appreciate the help.

    Douglas

    Friday, October 19, 2012 11:30 AM