Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Print specific data on printer?

0 views
Skip to first unread message

Amit Prakash Pawar

unread,
Jan 4, 2010, 8:38:47 AM1/4/10
to
Hi,

I want to print the specific data from page instead of Full page data.

So i can't use window.print method.

I take my data in $data variable.

i want to print only this data.

any other method for print selected data??(not full page)

Jerry Stuckle

unread,
Jan 4, 2010, 8:54:20 AM1/4/10
to

You could if you're using a printer attached to the server. But not if
the printer is attached to the client. You would need client-side
scripting, and PHP is server-side.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstu...@attglobal.net
==================

The Natural Philosopher

unread,
Jan 4, 2010, 10:03:26 AM1/4/10
to

Way I solved this was to generate a downloadable PDF and print that at
the server end directly, or send it by e-mail, or set it up for client
downloading.

That's all within PHP and the server side.

Haven't looked at javascript yet.

Iván Sánchez Ortega

unread,
Jan 4, 2010, 11:39:06 AM1/4/10
to
The Natural Philosopher wrote:

>> I want to print the specific data from page instead of Full page data.
>

> Way I solved this was to generate a downloadable PDF and print that at
> the server end directly, or send it by e-mail, or set it up for client
> downloading.

I'd try CSS. You can specify different stylesheets for different media
(screen vs printer), so you can hide stuff when printing.

> That's all within PHP and the server side.
>
> Haven't looked at javascript yet.

javascript plus clever handling of CSS attributes would work. I'd let PHP
out of the equation for this problem.

--
----------------------------------
Iván Sánchez Ortega -ivan-sanchezortega-es-

Now listening to: FLY2 Project - Loungebeach: Session 4: Dubai: Aperitif &
Fashion Lounge Music (2007) - [11] J Eight (5:31) (0.000000%)

Adrienne Boswell

unread,
Jan 5, 2010, 12:31:28 AM1/5/10
to
Gazing into my crystal ball I observed Amit Prakash Pawar
<amitppa...@gmail.com> writing in news:9bee09df-c635-46ae-a356-
8f1aba...@h9g2000yqa.googlegroups.com:

Best thing to do is use CSS:

<div id="nav">
<ul><li>...</li></ul>
</div>
<div class="noprint">This is only for screen</div>
<div id="footer">
</div>

In the stylesheet:
@media print {
#nav, #footer, .noprint {display:none;}
}

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

0 new messages