Welcome to WebmasterWorld Guest from 54.145.173.36

Forum Moderators: not2easy

Message Too Old, No Replies

Labels from the browser solved

a little DHTML,CSS, JS and VBScript go a long way.

   
3:34 pm on Aug 31, 2002 (gmt 0)

WebmasterWorld Senior Member txbakers is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I needed a way to be able to generate labels from a database using ASP, and have those labels print directly from the browser.

My first attempt worked for about 60% of my clients, the bad ones attributed to printer differences. We were all using the same browser. side note: does the screen resolution have an effect on <br> tags?

So I investigated DHTML with absolute positioning. The client gets to choose which fields to include on the label, which type face, which size, and color per line. There is also a DB filter and a drop down box of options to order the labels. For now I'm using the standard mailing labels Avery 5160 and clones.

Through a combination of JS arrays I was able to capture the incoming Form variables and set the color, size, and positioning through CSS.
I had to calculate the page breaks as well since the requirement was one click to the print icon to print all labels.

The beauty of it is that the HTML portion of the code is only about 10 lines. The rest is ASP related.

We deploy today, and it tested OK on several sites. Let's hope for 100%.....

7:24 pm on Aug 31, 2002 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Glad you were able to find an answer (let us know if anything is still hanging out).

does the screen resolution have an effect on <br> tags?

Font size will, but screen resolution certainly should not. And I can't see why screeen res would affect the printer in any way. Have you discovered otherwise?

11:53 pm on Aug 31, 2002 (gmt 0)

WebmasterWorld Senior Member txbakers is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I haven't discovered anything that would make it work oddly.

In the previous version I used <p> and <br> tags and the old trial and error plain vanilla HTML, which worked on my printer. Others weren't so lucky.

I'm hoping that different OS and different browsers - even different builds of the same browser - rendered ever so slightly differently.

With absolute positioning, I hope my clients will have more success.