Printing A Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a Web Page with two forms and a databse results section

the database results are at the top of the page.

the first form adds the data to the database and updates the page

the second form inputs the data required for the database results query to
ignore all records entered before the button on form 2 was pressed.

what i'd like to do is add a print button so that only the DBR are printed
and nothing else.

Is it possible? How do I do it?

Al...

P.S. Even if you cant help thanks for reading this far anyway.
 
Sproul said:
I have a Web Page with two forms and a databse results section

the database results are at the top of the page.

the first form adds the data to the database and updates the page

the second form inputs the data required for the database results query to
ignore all records entered before the button on form 2 was pressed.

what i'd like to do is add a print button so that only the DBR are printed
and nothing else.

Is it possible? How do I do it?

Al...

P.S. Even if you cant help thanks for reading this far anyway.
Al, insert this in the form choosing Web Components from the Insert drop
down menu > Advanced Controls Component Type> HTML> click Finish. The enter
this in the dialog box that opens:
<form id="printMe" name="printMe"> <input type="button" name="printMe"
onClick="printSpecial()" value="Print this Page"> </form>
 
Thanks chuck, but unfortunatley it doesnt work, i'm assuming it's something
to do with ' onClick="printSpecial()" ' should there not be somesort of
function called printSpecial, the page loads fine, but i get an error in the
status bar at the bottom when i click the 'Print this Page' button.

I am using IE6, frontpage 2003.

Al...
 
Should be, yes. In addition any of those will fail in Mac/IE5. Try this -

Put this in the head of the document -

<script type="text/javascript">
function print_page(where){
var is_mac=(navigator.platform.indexOf("ac") != -1);
(document.all && is_mac)?
alert("Select \"Print\" from the menu") : where? where.window.print() :
window.print();
}

function writeOutPrintLink(){
document.getElementById('printLink').innerHTML = '<a
href="javascript:print_page();">Print this</a>'

}

</script>

Put this in the body of the document -

<body onload="writeOutPrintLink();">
<span id="printLink"></span>

That way, the link only shows up if you have javascript enabled.
 
not working, am i supposed to be changing any of the data below, do i place
what i want printed between the SPAN tags so that everything else is missed
out. i'm not sure whats going on with this, my page is in a frame page will
that make any difference.

Al....
 
I don't know if i'm getting accross what i'm trying to do, I need to print
out a particular portion of a page, using a print button and omit the details
on the rest of the page,

at the top of the page is the database results
then an input form for the database
then another input form.

i only want to printout the database results

Al....
 
my page is in a frame page will
that make any difference.

Perhaps not, if the button and the form are in the same frame, but why are
you using frames?
am i supposed to be changing any of the data below,
No.

do i place
what i want printed between the SPAN tags so that everything else is
missed
out.

No. It will print the entire page (except on a Mac/IE5).

Why don't you show me what you have done by posting a link to the page?
 
You can use a CSS print stylesheet to hide those regions of the page you
don't want to print (of course, your page would have to have been built with
this functionality in mind so that those regions of the page could be
explicitly styled by the stylesheet).
 
I would show you the page, but unfortunatley it's on an internal network
which cant be accessed outside the company.

the whole page including the button (which didn't appear in your script) are
on the same frame.

the reason i'm using frames is that the heading is also navigation, so
instead of adding it to every page (because i cant get the CSS stuff to work
cause our IT guys are as thick as me and won't / can't set it up) i just put
it in once in the top frame, other than that there are no other frames used.


Al...
 
i think it would be too big, also pointless ay you dont have the database
that i sent and retrieve from.

basically take a blank page, build a form with a few inputs, send the data
to a database, once that's working, go to the top of the page and insert the
database results table from the same database, that's basically it.

all i want to do is print the database results and nothing else.
 
Create a page just for your DBRW and a link to it for printing (say as a popup window)
- then use FP Include page to include that DBRW page in your normal page

--




|I don't know if i'm getting accross what i'm trying to do, I need to print
| out a particular portion of a page, using a print button and omit the details
| on the rest of the page,
|
| at the top of the page is the database results
| then an input form for the database
| then another input form.
|
| i only want to printout the database results
|
| Al....
|
| "Murray" wrote:
|
| > Should be, yes. In addition any of those will fail in Mac/IE5. Try this -
| >
| > Put this in the head of the document -
| >
| > <script type="text/javascript">
| > function print_page(where){
| > var is_mac=(navigator.platform.indexOf("ac") != -1);
| > (document.all && is_mac)?
| > alert("Select \"Print\" from the menu") : where? where.window.print() :
| > window.print();
| > }
| >
| > function writeOutPrintLink(){
| > document.getElementById('printLink').innerHTML = '<a
| > href="javascript:print_page();">Print this</a>'
| >
| > }
| >
| > </script>
| >
| > Put this in the body of the document -
| >
| > <body onload="writeOutPrintLink();">
| > <span id="printLink"></span>
| >
| > That way, the link only shows up if you have javascript enabled.
| >
| >
| > --
| > Murray
| > ============
| >
| > | > > Thanks chuck, but unfortunatley it doesnt work, i'm assuming it's
| > > something
| > > to do with ' onClick="printSpecial()" ' should there not be somesort of
| > > function called printSpecial, the page loads fine, but i get an error in
| > > the
| > > status bar at the bottom when i click the 'Print this Page' button.
| > >
| > > I am using IE6, frontpage 2003.
| > >
| > > Al...
| > >
| > >
| > > "Chuck Davis" wrote:
| > >
| > >>
| > >> | > >> >I have a Web Page with two forms and a databse results section
| > >> >
| > >> > the database results are at the top of the page.
| > >> >
| > >> > the first form adds the data to the database and updates the page
| > >> >
| > >> > the second form inputs the data required for the database results query
| > >> > to
| > >> > ignore all records entered before the button on form 2 was pressed.
| > >> >
| > >> > what i'd like to do is add a print button so that only the DBR are
| > >> > printed
| > >> > and nothing else.
| > >> >
| > >> > Is it possible? How do I do it?
| > >> >
| > >> > Al...
| > >> >
| > >> > P.S. Even if you cant help thanks for reading this far anyway.
| > >> Al, insert this in the form choosing Web Components from the Insert
| > >> drop
| > >> down menu > Advanced Controls Component Type> HTML> click Finish. The
| > >> enter
| > >> this in the dialog box that opens:
| > >> <form id="printMe" name="printMe"> <input type="button" name="printMe"
| > >> onClick="printSpecial()" value="Print this Page"> </form>
| > >>
| > >>
| > >>
| > >>
| >
| >
| >
 
Back
Top