Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript IE Headers/Footers

Status
Not open for further replies.

gbaughma

IS-IT--Management
Staff member
Nov 21, 2003
4,773
US
We use an Intranet that I've developed over the years for just about everything. However, here's my dilemma.

When a user prints something, HIPAA regs say that it has to be "stamped" with who printed it and with a time/date stamp.

So.... I'm looking for a way when someone clicks "print", or as it's about to print, to change the IE footer to reflect who printed it and when; (keeping in mind, the person has already logged in to the web page).

Right now, the title of the page is at the top, as well as the page number. The date is on the lower-right (which is OK), but the web URL is at the lower left. Is there a way to change that web URL to "Printed by username" ?



Just my 2¢

"In order to start solving a problem, one must first identify its owner." --Me
--Greg
 
Greg, these values that show up are default header/footer values that the user specifies in their local settings.

In FF:
File > Page Setup > Margins & Header/Footer Tab > Choose options from dropdowns

In IE6:
File > Page Setup > Modify the Header and Footer text fields


These values are not changable by the coder (as well as most other browser settings - otherwise malicious coders would be resetting your print margins, home page, etc.)

However, you can still print out these values in the content area of your page using CSS print styles. If you want those values to show up at the bottom of every page then you'll have to be clever with setting up page-breaks and keeping the header/footer hidden until printing (it's possible, a coworker did it for a report of ours about 4 months ago). Check out the section on @media print here:


-kaht

[small]How spicy would you like your chang sauce? Oh man... I have no idea what's goin' on right now...[/small]
[banghead]
 
There was another post on something similar recently where regulations required all print jobs to show who printed them.
In that case it was determined that the solution was an outside software package to intercept the print jobs and stamp them with information rather than at the individual application level.

I assume the HIPAA regulations require ALL print not just that coming from your web page to have this info appended?
If so then you really need a print-server side solution or you would have to write special apps for every possible way someone could print, not just from IE or even a web browser.


It's hard to think outside the box when I'm trapped in a cubicle.
 
  • Thread starter
  • Moderator
  • #4
So, I'm setting up a CSS for print rendering only, and I would need to figure out how to put a footer on each page before the page break?

Darn it... why can't it be something like:

<STYLE>
@print{
.footer='bla bla';
</STYLE>

hehe



Just my 2¢

"In order to start solving a problem, one must first identify its owner." --Me
--Greg
 
  • Thread starter
  • Moderator
  • #5
You know, maybe this could be easier....

What about dynamically changing the TITLE of the page, when someone goes to print it?

For example, when they select PRINT, it does something like:

document.title.value="Printed by blabla on date"

... and change it back (for the browser) after it's done?



Just my 2¢

"In order to start solving a problem, one must first identify its owner." --Me
--Greg
 
I don't see a reason why that wouldn't work. However, you'll need to be able to trap when a print request is issued. By putting a "print this page" link on your page and calling window.print() it would be no problem, you just change the title before the print command is issued. When the user goes to File > Print though, that's a different can of worms.

-kaht

[small]How spicy would you like your chang sauce? Oh man... I have no idea what's goin' on right now...[/small]
[banghead]
 
Apart from what I said above about not being able to intercept any non-browser prints there is an additional problem.
What if the client has turned off the settings for printing the header and footer data?

It's hard to think outside the box when I'm trapped in a cubicle.
 
  • Thread starter
  • Moderator
  • #8
Hehe.... since I set a session variable for the user's name, I just included a:

document.title="User: <%=Session("UserID")%>";

It sets the user name at the title (which I don't care about); but that will then print on the web pages. :)

Works for me.



Just my 2¢

"In order to start solving a problem, one must first identify its owner." --Me
--Greg
 
  • Thread starter
  • Moderator
  • #9
Well, we run Metaframe, so we just lock down their ability to change that. ;)



Just my 2¢

"In order to start solving a problem, one must first identify its owner." --Me
--Greg
 
And you do not have the same print requirement on documents other than those printed from your web browser?

In the previous similar thread they had to ensure that ALL documents printed from any source had identifying info.
So the solution was a system that tagged all print jobs with as they were directed to the printer.

If you do not have to worry about anything but these web pages and have no fears of people doing a print-screen of the page then you should be all set.


It's hard to think outside the box when I'm trapped in a cubicle.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top