Reputation: 305
Does anyone have any experience of creating a report that will print labels that are on a roll?
I can see plenty of examples for a sheet of labels, but nothing with any great detail regarding a roll.
Would the best method be to set the report page up to have 1 column and then adjust the size of the page to be the size of the label?
There will be different info on each label, and a varying number of labels per print.
So basically set up the report to mirror the label size and then repeat pages depending on how many labels need printing?
Upvotes: 0
Views: 5095
Reputation: 21683
You should just be able to set your report to have the same page size as your label then design the report as normal.
As for producing multiple labels, you can either
Option 1 is probably the simplest method... Step-by-Step for option 1 In this example I've used the Microsoft sample database WideWorldImporters, just so I could get some names and addresses.
Step 1: Write your query to get your data. In my example I used the following..
SELECT top 10 o.OrderID, c.CustomerName, c.DeliveryAddressLine1, c.DeliveryAddressLine2, cty.CityName, c.DeliveryPostalCode
FROM [Sales].[Orders] o
JOIN Sales.Customers c on o.CustomerID = c.CustomerID
JOIN Application.Cities cty on c.DeliveryCityID = cty.CityID
ORDER BY OrderID
This just gives me the order number, company name and address.
Step 2: Create a new report. I'm using Visual Studio but the process is almost identical in Report Builder if you use that.
size
property to your label size. I used 100mm, 40mmPageSize
property to the same values as above and the margins to 0Step 3: Add a table to contain the data
Add Group => Parent Group
. Select OrderID
as the field to group on and click OK(OrderID)
Row group and go to Group properties, click Page Break and choose 'between'Clean up the formatting and that should be it. One label per page and each page set to your label size.
You may need to adjust the layout slightly to adjust for margins etc but this should give you a good start.
Upvotes: 2