Have you ever wanted to create a report that enables you to print mailing labels? Well I will show you how to create a Microsoft Report Viewer report in Visual Studio that looks like the one in the Fig 1.1
Fig 1.1
For window forms you can try this link, I have tested this both in windows forms and web and found that it did not work for me in web but worked nicely in Windows Forms.
For Web do the following (I assume you have already created a report with a dataset linked otherwise you can go to this link):
- If you want three labels next to each other you need to add three list controls to your layout, side by side.
- Add your data in each of the list controls, and style them as you like.
- Right click on the list row and select row visibility, on the form that opens select; “Show or Hide based on expression”.
- Each of the list controls needs a visibility expression.
- First List: =IIf(RowNumber(Nothing) mod 3 = 1, false,true)
- Second List: =IIf(RowNumber(Nothing) mod 3 = 2, false,true)
- Third List: =IIf(RowNumber(Nothing) mod 3 = 0, false,true)
Save and run your report. What step 4 will do is hide rows depending on its RowNumber creating a mailing label list/Multi Column List.
Hope this was helpful.
Happy programming!
Yes – it was immensely helpful. EXACTLY what I needed and worked great. Thank you for publishing this and saving me hours and hours of research and frustration. 🙂
Definitely what I was looking for but it doesn;t seem to like the expression. i get:
Error 1 The Visibility.Hidden expression for the tablix ‘Tablix2’ contains an error: [BC30516] Overload resolution failed because no accessible ‘IIf’ accepts this number of arguments. D:Matrix MathsDevelopmentProjectsMatrixMathsMatrixMathssystemschoolrptLoginDetails.rdlc MatrixMaths
Using
=IIf(RowNumber(Nothing)Mod 2=0,False,True)
in Visula Studio 2010 .NET 4.0.
Any ideas?
I actually though the List was supposed to handle multiple columns anyway but this also doesn’t seem to work.
Any help much appreciated.
I was looking for a solution like this … for me it was the resolution of a very complicated problem … thanks
Fantastic,
just need to format the expression properly =IIf(RowNumber(Nothing) Mod 3 = 1,False,True) – the spaces matter
Thanks a lot
Thanks a lot, You saved my time.
You´re the best!!! Thanks
It’s Very Helpfull……Thanks
Very very helpful, Thank you so much.