Link to home
Start Free TrialLog in
Avatar of john parsons
john parsonsFlag for United States of America

asked on

How to Start Printing on Label

Background:
Sometimes when printing postal addresses to mailing labels, there may be a limited number of mailing addresses that do not consume an entire sheet of Avery labels. If an Avery sheet starts out with 30 blank labels and there are 20 addresses to print, this would leave 10 unused labels on the sheet. I was using a report that I created in SSRS 2008 to print the labels.

At a later time, when I needed to print more mailing addresses, I would have my SQL Server query generate 20 empty records, plus UNION in the actual mailing addresses, and this data would be passed to the SSRS report. This caused SSRS 2008 to skip over the 20 labels that were already used on the sheet, and begin printing on label 21. This allowed me to finish using the remaining labels on the sheet. The addresses would be properly printed on the remaining unused labels.

There was probably a better way to manage this, but at the time, it was the only idea that worked.

Current Day:
Several months ago, our environment was upgraded to SQL Server 2012 and uses SSRS 2012. The 2008 SSRS report was successfully deployed to SSRS 2012, but it no longer works as it did in 2008. If I were to repeat the scenario described above, the query is still generating 20 blank rows, but what SSRS 2012 appears to do is execute a carriage return / linefeed 20 times, and then starts printing, instead of skipping pass 20 "used labels" in order to start printing on label 21.

I have been researching to see if there is a correct way in SSRS 2012 to manage label printing. I am not finding anything new. Is there a correct/better way in SSRS 2012 to manage what I am trying to do??

Thanks in advance
DoughBoy
Avatar of Russell Fox
Russell Fox
Flag of United States of America image

Try putting the entire record inside a Rectangle and setting the rectangle's PageBreak.BreakLocation to "End".  I also thought of a possible (awful) workaround: you can try printing to PDF instead of directly to the labels. If it looks correct as a PDF you can print that onto the labels.
Avatar of john parsons

ASKER

Russell

Thanks so much for your response. I gave your recommendations a try over the weekend and you have no idea how badly I wished they had worked. I have been at this for several weeks now and I am beginning to wonder if there is a solution. However, I greatly appreciate your suggestions.
Hmmm, try creating the blank records as html fields with non-breaking spaces. I.e., pick a text field and set it's textbox control to render html content, and then create blank records with that field as:
<p>&nbsp;&nbsp;</p>

Open in new window

That should force SSRS to render the two non-breaking spaces even though there isn't anything there that actually prints.
Russell,

I will try your recommendations this weekend and let you know early next week. In the mean time, thanks for the additional suggestions.
No joy in Mudville. But I really appreciate the suggestions from Russell. I was excited about your additional suggestions, but could only get any of HTML metadata to display in the report as hoped. For example "<html><b>Hello</b></html>" (without the quotes) would literally display <html><b>Hello</b></html>, instead of displaying Hello in bold. Also tried applying the following resource, but without success:

https://social.technet.microsoft.com/wiki/contents/articles/18748.ssrs-multi-font-color-multi-font-size-within-a-single-field-textbox.aspx

Your idea reminds me of the pre-SSRS days when I used script to dynamically build HTML tables on the fly that would fill in the <td></td> cells with either HTML spaces (&nbsp;) or live data in order to print labels from within our intranet site. I was so happy when SSRS came along, b/c there was a lot of Style=?? (and other) formatting that had to also be done within these dynamic HTML tables.

In addition, I have also tried the following in an effort to resolve my SSRS issue:

 * Wrapping the tablix inside of a CanShrink=false rectangle
 * Setting all controls/table cells to CanShrink=false
 * Dynamically setting the Top property of table/rectangle (not possible)
 * Dynamically setting the Padding-Top property of the table (an expression can be assigned, but is unresponsive during run-time)

Basically what I have done as a workaround (as opposed to a resolution) is that I have the report printing dummy records on top of the blank areas where labels have already been used and the dummy data is printing in light gray (to try to save some ink). When the live data lands on new (or unused) labels, the report starts printing in black. I do this by passing a record ID of 0 (zero) with every dummy row and the report uses an IIF statement that prints the label in gray when the ID is zero; for any other ID value, the report prints in black. Its a hack, but it gets the report working for now so that I can focus on other things in the meantime.

Thank you Russell for all your help,
Doughboy
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.