none
How to print address labels vertical with 3 columns in Reporting Services RRS feed

  • Question

  • How to make the address labels print vertical in reporting services.

    Currently my report show horizontal. I want to print accross.

     

    James Smith                                 Michael Allen                        Becky Miller

    12345 Martin Luther King                8764 5th Ave                        7704 25th Ave NE

    Seattle, WA                                  Redmond, WA                      Bellevue, WA                           

     

     

    James Smith

    12345 Martin Luther King

    Seattle, WA

     

    Michael Allen

    8764 5th Ave

    Redmond, WA

     

    Becky Miller

    7704 25th Ave NE

    Bellevue, WA

     

     

    Thursday, September 18, 2008 11:14 PM

Answers

  • Here's how I've done this in the past:

    1. Add three List controls to the report, each pointing to the same dataset.

    2. Add the exact same fields to each List control.

    3. Build the report - each List will display the exact same data, repeated/duplicated in each List. Because of this, you have to find a way to hide some of the records in each List control. The MOD operator is perfect for this.

    4. Add an expression to the Visibility.Hidden property for each List:
    Leftmost List: "=IIF(ROWNUMBER("YourDataSet") MOD 3=1,FALSE, TRUE)"
    Middle List: "=IIF((ROWNUMBER("YourDataSet") MOD 3=2,FALSE, TRUE)
    Rightmost List: "=IIF(ROWNUMBER("YourDataSet") MOD 3=0,FALSE, TRUE)"

    5. Each list will now only display every third row so that when the report is created, the user sees all the records in a horizontal layout.


    Keep in mind that I pulled this from memory, so the code may not be exactly correct, but you should be able to get the the main gist of the method.
    Friday, September 19, 2008 7:36 PM
  • Sweet....thanks guys for looking into it. I made it work, let me recap.

     

    1. Create a blank report

     

    2. Create my dataset

     

    3. Add three List controls to the report, each pointing to the same dataset.

     

    4. Add the exact same fields to each List control.

     

    5. Build the report - each List will display the exact same data, repeated/duplicated in each List. Because of this, you have to find a way to hide some of the records in each List control. The MOD operator is perfect for this.


    6. instead of using the code above JoeBu mentioned. I used this instead for each List.

     

    =IIF(Fields!Rank.value mod 3=1,false,true)

    =IIF(Fields!Rank.value mod 3=2,false,true)

    =IIF(Fields!Rank.value mod 3=0,false,true)

     

    7. How to use the Expression this article might help http://altoonait.com/CS/blogs/lee/archive/2007/12/13/printing-labels-with-sql-server-reporting-services.aspx

    Friday, September 19, 2008 8:44 PM

All replies

  • Textboxes have a WritingMode property that may be set to Vertical.  You may also need to adjust the Direction property.

    Friday, September 19, 2008 2:37 AM
    Moderator
  • The WritingMode property TextBoxes  wouldn't solve printing the labels across. I used rectangle and List Controls to create my address labels.

     

    Does anyone know if the list control allow the data display Horizontal.

    Friday, September 19, 2008 6:26 PM
  • Hi,

     

    I'm trying to understand the data for this contact. From the example you gave, is it from 3 rows of data, or 1? The reason I'm asking was because if the query returns 3 rows, then using List, simply stack the name and addresses into one set. Unless it is more complicated than that, then my apology.

     

     

     

     

     

    Name

     

     

    Address Line 1

     

     

    Address Line 2

     

     

     

     

     

    Friday, September 19, 2008 6:41 PM
    Answerer
  • The query returned 3 rows.

    What do you mean stack the name and address into one set?

     

    I used the rectangle and list controls for example

     

    List control

     

     

    rectangle control

     

     

    Name

     

     

    Address Line 1

     

     

    Address Line 2

     

     

     

     

     

     

    The result in Reporting Services I got is

     

    Name 1

    Address

    City, State Zip

     

    Name 2

    Address

    City, State Zip

     

    Name 3

    Address

    City, State Zip

     

    I want to print

     

    Name 1                                    Name2                                               Name 3

    Address                                   Address                                             Address

    City, State Zip                          City, State Zip                                     City, State, Zip

     

     

    Friday, September 19, 2008 7:04 PM
  • Ahhh, sorry. I misunderstood you. I thought you want the other way around .. my bad .. I'll look into it.

     

    Friday, September 19, 2008 7:35 PM
    Answerer
  • Here's how I've done this in the past:

    1. Add three List controls to the report, each pointing to the same dataset.

    2. Add the exact same fields to each List control.

    3. Build the report - each List will display the exact same data, repeated/duplicated in each List. Because of this, you have to find a way to hide some of the records in each List control. The MOD operator is perfect for this.

    4. Add an expression to the Visibility.Hidden property for each List:
    Leftmost List: "=IIF(ROWNUMBER("YourDataSet") MOD 3=1,FALSE, TRUE)"
    Middle List: "=IIF((ROWNUMBER("YourDataSet") MOD 3=2,FALSE, TRUE)
    Rightmost List: "=IIF(ROWNUMBER("YourDataSet") MOD 3=0,FALSE, TRUE)"

    5. Each list will now only display every third row so that when the report is created, the user sees all the records in a horizontal layout.


    Keep in mind that I pulled this from memory, so the code may not be exactly correct, but you should be able to get the the main gist of the method.
    Friday, September 19, 2008 7:36 PM
  • Sweet....thanks guys for looking into it. I made it work, let me recap.

     

    1. Create a blank report

     

    2. Create my dataset

     

    3. Add three List controls to the report, each pointing to the same dataset.

     

    4. Add the exact same fields to each List control.

     

    5. Build the report - each List will display the exact same data, repeated/duplicated in each List. Because of this, you have to find a way to hide some of the records in each List control. The MOD operator is perfect for this.


    6. instead of using the code above JoeBu mentioned. I used this instead for each List.

     

    =IIF(Fields!Rank.value mod 3=1,false,true)

    =IIF(Fields!Rank.value mod 3=2,false,true)

    =IIF(Fields!Rank.value mod 3=0,false,true)

     

    7. How to use the Expression this article might help http://altoonait.com/CS/blogs/lee/archive/2007/12/13/printing-labels-with-sql-server-reporting-services.aspx

    Friday, September 19, 2008 8:44 PM
  • Another way to do this is with report columns.  If you go to the report properties you can choose 3 columns for a report, which will automatically wrap from bottom to top of page (similar to columns in Word).  The catch is that the column will go all the way to the bottom of the page before filling in the other columns--so top to bottom, rather than left-to-right as you describe above.

     

    Saturday, October 11, 2008 12:02 AM
    Moderator
  • I have not been able to get this method to work.  I am currently working through the examples in Microsoft SQL Server 2005 Reporting Services By Brian Larson.  In this book (Chapter 7) there is a report (Employee Mailing Labels Report)where the end result is supposed to be some mailing labels that span 3 columns per page using 3 report columns.  The figure in the book shows this working, but working through the example and changing the Report Properties --> Layout tab --> Columns = 3 is not producing this result for me. 

     

    Any ideas?

     

    Any help is much appreciated.

    Friday, October 17, 2008 12:50 PM
  • You can check out the templates on http://www.reportdemos.com/ .
    Monday, November 9, 2009 11:25 PM
  • I have run this with report columns and it should work.  What are the results?  Not in report viewer -- but viewing a deployed report.  If memory serves me correct, and it does, in 2005 report view is not a paginated view -- export to word to see a paginated view which would correctly show the columns.

    As for List or table -- I would use a table -- just add 3 detail rows.  More structured and alighned than textboxes for me. Just as a final remark -- the other answers work, just seem complicated.
    • Proposed as answer by Sandra Mueller Monday, November 23, 2009 5:04 PM
    Monday, November 23, 2009 4:56 PM
  • Sorry...I deleted my post.
    Thanks for the answer, I will see if exporting it to pdf would correctly show the columns.
    Get a life. Go party!
    Monday, November 23, 2009 5:12 PM
  • I have run this with report columns and it should work.  What are the results?  Not in report viewer -- but viewing a deployed report.  If memory serves me correct, and it does, in 2005 report view is not a paginated view -- export to word to see a paginated view which would correctly show the columns.

    As for List or table -- I would use a table -- just add 3 detail rows.  More structured and alighned than textboxes for me. Just as a final remark -- the other answers work, just seem complicated.

    What do you mean by "What are the results?Not in report viewer -- but viewing a deployed report" ?
    Let me say that I'm in windows plataform, WinForms.

    And it didnt work. My table has 3 subreports, and I made a simple test using List, but I dont know how to use subreport in it.
    Like you said, as for List or table, i would use table.

    My conclusion is that with Table this way do not work, but with List it works, however, I dont know how to use all features that I use in table with List's.

    Get a life. Go party!
    Monday, November 23, 2009 5:36 PM
  • What do you mean by "What are the results?Not in report viewer -- but viewing a deployed report" ?
    Let me say that I'm in windows plataform, WinForms.

        Original question was about report services and when you view the report on the view tab -- in 2005 the paging options would not all display correctly.  So output to PDF -- or send to the report server and view in IE (the deployed report).  Nothing mentioned anything about WinForms -- you are using the report control?

    And it didnt work. My table has 3 subreports, and I made a simple test using List, but I dont know how to use subreport in it.
    Like you said, as for List or table, i would use table.

    -- JobaDiniz -- I don't even see your question here so I am confused.  This thread was about a mailing list with 3 columns...

    Monday, November 23, 2009 6:32 PM
  • My question is here . Please, take a look.
    Somebody answered it and here I am.
    Get a life. Go party!
    Monday, November 23, 2009 6:53 PM
  • LOL -- that explains the confusion.  completely different issue
    Monday, November 23, 2009 7:21 PM
  • So, you don't have any idea how could it be done?
    Get a life. Go party!
    Monday, November 23, 2009 7:58 PM
  • missqti Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals

    I have tried exactly what you suggested but no luck.  The other 2 columns dissapear and all data is just displayed in one long row.  Any help here?

    Thanks.
    Thursday, December 3, 2009 5:10 PM
  • mattkovo, please look at your post in this link and see if the steps i suggested will work.
    http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/d9f62ba3-9378-4d2b-bd51-1b8156edb347
    Chicagoan ...
    Thursday, December 3, 2009 5:33 PM
    Answerer
  • The MOD function worked for me perfectly. However, I have two columns to report, so I changed the MOD function to calculate based on 2 columns.

    ie.

    =IIF(ROWNUMBER("<DATASET>") MOD 2=1, FALSE, TRUE)           for 1st column

    and

    =IIF(ROWNUMBER("<DATASET>") MOD 2=0, FALSE, TRUE)           for 2nd column

    Thursday, July 25, 2013 1:13 AM