We help IT Professionals succeed at work.

How can I create Avery style mailing labels from my ASP.net website with sql server database backend

Last Modified: 2014-10-24
I am trying to figure out what is the best way to create Avery type labels from my .aspx pages.  I've seen posts about .rdlc reports, pdf dll's, data dumps and Word mail merge.  Has anyone had any success?

I have a SQL Server database back end and ASP.Net/VB front end.
Watch Question


There's no good way to do that. The application that will be printing your labels is web browser, and web browsers don't have a lot of flexibility in precise printing. The best is to create desktop application using the same Visual Studio. Incidentally, everything you mentioned as what you heard, does pertain to desktop applications, with the exception of the rdlc report.

If desktop application is an option, we can tell further details, how to achieve what you want.

If you still want to pursue asp.net route, start with experimenting with your web browser. Create a simple static html webpage, and print it from your browser on your printer with the labels, and to achieve the result you want.


I've already determined the web browser is not the way to go.  Although, someone had mentioned there were .rdlc templates out there for Avery labels.  But I could not find them to try and I'm not a big .rdlc fan because of cross browser formatting/printing issues.

My sites are not public sites. They are business web applications.  So I can control what the user is forced to use - and I can give training if necessary.  I would like to avoid training though.  I want it to be as easy to use as possible.

Any suggestions would be helpful.

So if you already determined that web browser is not the way to go, then how do you plan to "create Avery style mailing labels from my ASP.net website" , if not in web browser?


I was thinking I could have premade Word templates with data connections in them in a folder on the website. The user would be able to view these templates as links on their website.  

I was going to allow them to build their data source by entering their search parameters and then click on the template and view/print it.  The word label template would fill with data from the sql datasource.

I am just not sure if I can create Word label templates with an Sql connection and datasource that will refresh with the current datasource each time it is clicked.  That is the option I am pursuing right now.

If that's not possible I was thinking of doing a vb program that they could download from the website.  

I've also read about add on products that I could install on my webserver to which I could create pdf files formatted as labels from my website.

So I am looking for solutions to my problem however they may need to happen.
This one is on us!
(Get your first solution completely free - no credit card required)


That works ok for form letters where you are only replacing single place holders.   Not sure how I would create an .rtf template file that I could use for Avery 5160 labels for example that would create a file with varying amounts of names and addresses.
This one is on us!
(Get your first solution completely free - no credit card required)

...with vba code like this:

with MailMerge
.OpenDataSource Name:="C:\myfile.ODC", sqlstatement:="select firstname from employees", connection:="Provider=SQLOLEDB;Integrated Security=SSPI;Initial Catalog=mydb;Data Source=myserver"
end with

Open in new window

myfile.ODC can be an empty file, but must exist.

...although, once I thought little more about it, it's still possible to do with the RTF technique. For example, introduce hidden placeholder "next record", and when parsing the text and encountering it, loop to the next record in the code.

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.