homepage Welcome to WebmasterWorld Guest from 54.163.91.250
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
Labels from the browser solved
a little DHTML,CSS, JS and VBScript go a long way.
txbakers




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

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%.....

 

tedster




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

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?

txbakers




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

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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved