473,748 Members | 2,502 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to open new (printer-friendly) window

Hi all

I have a php script that presents a rather simple form. After the user
filled in parameters and presses <submit>, the results from a postgres
database search follows on the page.

Now, if the user wishes to print the page, it'll be ugly containing
the form boxes. So one solution would be to present a
"printer-friendly" option on the page. Clicking there will present the
results in a new window free from the form boxes. I don't want to
repeat the database search in this new window, just "forward" the
variables to this new url.

I guess it could be done, but how?

Grateful for any help!
Jul 17 '05 #1
4 3677
Gandalf wrote:
Hi all

I have a php script that presents a rather simple form. After the user
filled in parameters and presses <submit>, the results from a postgres
database search follows on the page.

Now, if the user wishes to print the page, it'll be ugly containing
the form boxes. So one solution would be to present a
"printer-friendly" option on the page. Clicking there will present the
results in a new window free from the form boxes. I don't want to
repeat the database search in this new window, just "forward" the
variables to this new url.

I guess it could be done, but how?


Well, imho you should use CSS for this part...

Use "media" and include 2 stylesheets... one for the screen
(media="screen" ) and one for the print (media="print")

http://www.w3.org/TR/REC-CSS2/media.html

Regards,
johan

Jul 17 '05 #2
Gandalf wrote:

[snip]
Now, if the user wishes to print the page, it'll be ugly containing
the form boxes. So one solution would be to present a
"printer-friendly" option on the page. Clicking there will present the
results in a new window free from the form boxes. I don't want to
repeat the database search in this new window, just "forward" the
variables to this new url.


I guess the easiest solution to this problem would be to use an
alternative stylesheet which removes all the formatting. Linking this to
your document with the following statement would result in nice prints
with most browsers:

<link rel="stylesheet " type="text/css" href="print.css " media="print">

I know this isn't excactly the solution you asked for, but i recommend
you give it a thought.

--
Tormod Fjeldskår
to****@fritidsp roblemer.no
http://tormod.fritidsproblemer.no/
Jul 17 '05 #3
Tormod Fjeldskår wrote:
Please check your date settings... or are you from the future? ;)

Regards,
Johan

Jul 17 '05 #4
Johan Holst Nielsen wrote:
Please check your date settings... or are you from the future? ;)


I'm terribly sorry! Did some time-related php-scripts and forgot to
return to the present ;)

--
Tormod Fjeldskår
to****@fritidsp roblemer.no
http://tormod.fritidsproblemer.no/
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
27588
by: Ben Smeets | last post by:
Hi folks, Have been trying to figure out a solution for the following problem by reading lots of threads here, but doesn't work out. Hope someone can help me. I have a parent window which opens a popup window (child). What i would like to do, is to be abke to keep surfing to other pages in the parent and after (lets say) a couple of new pages, still be able to say "child.setFocus()";
1
2444
by: Ed Brandmark | last post by:
I want to be able to open a window in the background of my page - without that flicker you see if you just open the window and then blur it (or focus the main window). The reason I want to do this is that I want to open a window and retrieve an URL. That URL may have 'nothing to say' and thus it will just do a self.close() In this case the user sees this flicker and then there is nothing back there. If something is returned the popup...
3
2376
by: ACaunter | last post by:
Hi all, I need to set a session variable and open a new window with a single click of an asp.net button. My problem is that it always takes two clicks.. one sets the session and the other opens the window... if i write the open window code in the page load, then the window gets open on 1 click and no session variable was saved... any ideas how to get around this... this is my code:
1
1138
by: Alessandro | last post by:
Hi ! There is a way to use a Linkbutton as an hyperlink? I want execute some code and then open a new window: if i use a linkbutton no new window will be opened, if i use an hyperlink i open new window but i don't execute code before opening it !
6
1983
by: slacker | last post by:
In my jsp I have: <Script langauge="Javascript"> window.location.replace("first url"); window.close(); window.open("second url"); </Script> The child window opens from the parent window just fine and then it closes, but I cannot reopen a new child window; I am working with IE 6
1
6844
by: sathyanrockie | last post by:
Plase tell me what is the difference between window.open and window.showmodelessdialog. Can we use window.showmodelessdialog in place of window.open?
19
4237
by: Sonnich | last post by:
Hi! I have used JS, but I am still new to it. I have something like this: oNewWindow = new Object(); oNewWindow = open("sonnich.xls","Qopen","resizable=yes,scroll=yes, status=yes, width=320px, height=470px",true); oNewWindow.focus();
2
2126
by: tshad | last post by:
I have an aspx window that is going to open a window (javascript) and display a graphic. I want to resize the window to the size of the graphic before it actually displays - how do I do that? In my calling routine I have the following: *********************************** function OpenLogoPreviewWindow() { window.open('logoDisplay.htm','mywindow'); }
0
2038
by: hcuellar | last post by:
Hi. Please I need your help for this: After a database query, a table is created with a cell for each information retrieved, and for each record, two buttons, and second one have besides it an text imput field to asign this, open a mail client to send a mail to some people. All this, is made in php. In other words, user logs in, a window is open (after query) showing new appointments (set in other office), and each new appointment...
5
3927
by: hcross | last post by:
This project is a web based html and Javascript site. I am working on mac at the moment. This script works except for attempting to open new window once complete. As you can see, i am new to javascript coding. Can i open a new browser window after my prompts and alerts have finished. I am not sure what i am doing wrong. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
0
8994
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9555
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9329
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8247
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3315
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.