Printing label sheets through RDLC

Today, I needed to create a label sheet to print bar codes for a client implementation. So I thought I could share it with all of you. I think that some of you might already know how to do this, but anyway here it is.
First I made my data set which is pretty straightforward:

Report Dataset Designer

Add an Item with the No. and Description, next add the Cross Reference of type Bar Code which is not discontinued.

As for the layout of the sheet, I didn’t have the exact layout yet, so I looked on the internet for a typical label sheet, just to know the dimensions, and started from there. Here is what I used as an example.
Sample Label Sheet

My next step was to figure out how to set this up in our RDLC Designer. When we look at the Report Properties this is what we see:

Report Properties Page Setup

We can basically set the page size and margins, but nothing else. So I started there. My example said it was A4, so I set that. I didn’t notice a left or right margin in the example, so I set them to 0, I left a little top and bottom margin.

Our first setup look good, but how do I get multiple labels on a sheet. these are basically columns, but I do not wish to add a table with columns, because that would mean I need to add the “layout” multiple times. When we look at the properties list of the Report, this is what I found:

Report Properties List

A function called columns! with the option to set the spacing between. I changed Columns to 3 and set no spacing, here is what the Design now looked like:

Design Look

Now I could start by adding a list linked to the dataset, and add my fields. Before that, I also set the body size to 70mm wide and 36mm height.

As to actually print a bar code, all you need to do is set the TextBox font to a bar code font, and also install this at the customer side. Here is my end result:

Bar Code Font Properties

Final Design

After saving and running the report, here is the actual result, the output:

Result

So, as you can see, it really wasn’t that hard. When the label needs to be changed, I only need to change it 1 time. When I get the actual sheet size and label size, I need to change my page setup and the body size and I’m set.

I hope this helps you finding the properties whenever you’ll need to make a label sheet or something similar.

48 thoughts on “Printing label sheets through RDLC

  1. Pingback: Printing label sheets through RDLC | Pardaan.com

  2. Hi, I followed the steps you outlined here, but my labels are still all showing under the first column. Am I missing something?

  3. HI,

    I have a basic question about this post.
    In First step your create a dataset, so how can i create this dataset ?
    a) Can i create this on report designer?
    b) Or i need to create at code side?

    Please guide me properly.

    • Hello Raj,

      By adding DataItems & Columns in the development environment, the dataset is created, you do not need to do anything special for it.

      Magno

  4. Hi thanks,

    Would like to know how to print on a specific position on the sheet. Say, I wanted to start printing on the 3rd position… is that possible?

    • Hi Vince,
      Maybe you could keep a boolean Visible in your dataset, and apply this boolean to every control on the report?
      I think this would be the easiest way.

      In your NAV code, you could send x blank records with the visible boolean set to false to RDLC.

      Magno

  5. I downloaded you demo report, but that is not printing in next column. All the items are printed below each other. Am I missing some thing.

    • Hello Manish,

      Did you try looking at the “Print Layout” (button next to the printer button)? Or try looking at the PDF version.
      Since the preview rendering is not always what the actual result is. In this case, it seems that the preview itself cannot handle the columns.

      Regards,
      Magno

  6. Hello

    I’m using MSSQL & VS2012…I inserted a “list” in the first column of my rdlc, put all the fields I wanted from my dataset in the list box, and I’m getting multiple pages with all the data in the first column as well.

    • Hi Alex,

      Have you tried the sample report I provided, to see if that also prints in only 1 column?

      http://nav-magno.be/?wpfb_dl=9

      In the comment above, Manish also stated he only gets data in the first column. But I honestly have no idea, what the problem could be, nor have I been able to reproduce this behavior, except visually in the preview rendering…

      If the report allows to import into a clean standard NAV database (without a lot of custom or add-on source fields), you can always share the text export. I could have a quick look to check if I get the same result as you say.

  7. very interesting and helpful post, I have one query please, is it possible to print the same label for a given number of times decided at runtime? thanks

    • Sure, You could create another integer data item and loop however many times you want it. Basically the same as you would do with a copy loop for any document report.

  8. How to fix 3 columns and 5 rows per page and if data is not there then 3×5 empty box should come?? Mailing label concept

    • Hello Rashid,

      If I understand correctly, you want to print a rectangle around the data, and only the rectangle if there is no data?
      For your case, I think the most convenient would be to check if there is data before, and send blank data if there is none.

      Regards,
      Magno

      • Each page I need display 5 rows and 3 coloumns fixed per page ,if I have one record in database ,that record should fill in first cell or box remaining cells I should get blank

        • If you only supply 1 record, it will be printed in the first row, first column by default. The rest should be printed without data, not sure how rectangles, lines, … will react though.

    • Some barcode scanners use different fonts they can recognize. You might want to check the supported barcodes and if necessary change the font on your RDLC to 1 which is supported by your scanner.

      • Thank you for your reply. In fact the barcode scanner reads code 128. I have tried all the different type of code 128 (A, B, C) but none is rendering the same output for the barcode.
        Example: try generate the value 15005 from this website for code 128 (standard) – http://www.barcode-generator.org/

        I want to have the same output from the one I am printing from NAV 2013 R2

        May be you can help on that. Thank you again

  9. Hello…. I followed your instructions but I’m only getting the first column and only the first record to be displayed in the report viewer. Do you have an idea what could be causing this issue? Thank you for the help.

  10. Hi, I am also facing the same problem. I had also saved it into pdf but its only showing first record.

  11. Hi, am create these format report but my report show only one column…

    its have 500 datas but show only one column datas…how to show 3 column..plz help..

    • Hi Guru,

      Which version of NAV are you using?
      If the report itself doesn’t contain to much customized fields, would you be able / willing to show me an export? (maybe share through pastebin)

      Magno

  12. Hello,
    I have been trying to print barcode from a receipt printer using roll paper, but can figure it out yet. Can you help?

  13. it only works in one column for the print preview but works a treat when they print or export to pdf etc. thanks for this though it was very useful.

  14. In regards with the comments on the barcodes. As far as I can tell the string to become barcode needs to be encoded first then sended to the textbox. I´ve writen a vba application in the past and that was the first issue I ran into. So you need to find a library to encode it first then send it to the textbox.

  15. Can we print label column wise like side by side. For E.g. For 1×8 report i am printing 10 labels
    so on 2nd page label no 9 will print and 10 number will print side by 9 no. not below.

    i applied column grouping but after 8 label getting rendering error.

    Thanks

  16. Hi there! Thanks a lot for this informations,you made me life easier! 🙂 At first my labels was printed under one column also.I had 2 columns and 6 rows. But then i realised that labels are printed not left to right as i assumed! it printed 6 under one column,and after that it was printed under 2nd. Maybe this info will be helpful to someone, that your report is good but just need more labels to print to see that 🙂

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.