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

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.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Vadim RappCommented:
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 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.
johnAuthor Commented:
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.
Vadim RappCommented:
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 website" , if not in web browser?
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

johnAuthor Commented:
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.
Vadim RappCommented:
> 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.

The answer to this is in the macro AutoNew.

One problem you may face however is if the label printer is not the default printer for the computer.

In my own applications (desktop ones, however), I addressed the problem of label printing by having an RTF file as template, with placeholders for the variable information. The application reads the template, replaces placeholders by their values, saves modified rtf file in %temp%, then calls write.exe /pt <file> <printer>.  This solution is fully standalone, and does not even require Office.
johnAuthor Commented:
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.
Vadim RappCommented:
Right, if there are multiple labels, then probably Word mail merge is the way.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Vadim RappCommented:
...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.
Vadim RappCommented:
...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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.