Click here to Skip to main content
15,914,943 members
Home / Discussions / Web Development
   

Web Development

 
Questionhow Browser works Pin
Chandan_Kr23-May-06 23:29
Chandan_Kr23-May-06 23:29 
AnswerRe: how Browser works Pin
J4amieC24-May-06 1:01
J4amieC24-May-06 1:01 
AnswerRe: how Browser works Pin
RichardGrimmer26-May-06 3:15
RichardGrimmer26-May-06 3:15 
QuestionAdd Collection Property editor in custom control? Pin
Irfan.x23-May-06 23:05
Irfan.x23-May-06 23:05 
QuestionI need an algorithm writed by Javascript to compress big text. Pin
simonchen.net23-May-06 20:20
simonchen.net23-May-06 20:20 
AnswerRe: I need an algorithm writed by Javascript to compress big text. Pin
alex.barylski25-May-06 13:54
alex.barylski25-May-06 13:54 
QuestionPrinting using javascrip Pin
deepaks323-May-06 19:19
deepaks323-May-06 19:19 
AnswerRe: Printing using javascrip Pin
arpita200626-May-06 4:54
arpita200626-May-06 4:54 
script.js

function getPrint(print_area)
{
//Creating new page
var pp = window.open();
//Adding HTML opening tag with … portion
pp.document.writeln('<title>Print Preview')
pp.document.writeln('<base target="_self" />')
//Adding Body Tag
pp.document.writeln('');
//Adding form Tag
pp.document.writeln('');
//Creating two buttons Print and Close within a table
pp.document.writeln('
');
//Writing print area of the calling page
pp.document.writeln(document.getElementById(print_area).innerHTML);
//Ending Tag of , and
pp.document.writeln('');

}

*****************************************************************************

NOTE:

I was facing problem during print. Print was not working when 1st time clicked. I solved that problem by reload
location.reload(true);


getPrint(print_area)Function take DIV Id which section you want
to print. Then, it creates a new page object and it writes necessary HTML tags
and add print and close button and finally it writes print_area
content and closing tag.

And call the following way from the aspx page. Here,
getPrint('print_area') has been added for printing print_area
DIV section. print_area is the DIV id of DataGrid and rest
of two will work for others DIVs.So, whatever areas that you want to print must
be defined inside of DIV tags.
And include Script.js
file in the aspx page.

'calling getPrint() function in the button onclick event

btnPrint.Attributes.Add("Onclick", "getPrint('print_area');")

Arpita
QuestionRun a Exe File in Struts Pin
k.n.ruban23-May-06 18:24
k.n.ruban23-May-06 18:24 
QuestionHTML in in Lotus notes Pin
Gktony23-May-06 4:52
Gktony23-May-06 4:52 
AnswerRe: HTML in in Lotus notes Pin
KrIstOfK23-May-06 20:59
KrIstOfK23-May-06 20:59 
GeneralRe: HTML in in Lotus notes Pin
Gktony23-May-06 22:14
Gktony23-May-06 22:14 
QuestionDelete image in asp.net Pin
hi_arv23-May-06 1:13
hi_arv23-May-06 1:13 
Questionhow to split ......? Pin
jayan meledom23-May-06 1:02
jayan meledom23-May-06 1:02 
AnswerRe: how to split ......? Pin
sathish s23-May-06 2:20
sathish s23-May-06 2:20 
Questionjava script urgently..... Pin
adarsh70722-May-06 20:03
adarsh70722-May-06 20:03 
AnswerRe: java script urgently..... Pin
KrIstOfK22-May-06 21:28
KrIstOfK22-May-06 21:28 
QuestionExecuting EXE File through Java Pin
k.n.ruban22-May-06 18:02
k.n.ruban22-May-06 18:02 
Questionjapan text, ColdFusion and MySQL Pin
progman22-May-06 13:00
progman22-May-06 13:00 
QuestionFrontpage Pin
boldeagle22-May-06 8:52
boldeagle22-May-06 8:52 
QuestionCSS Layout vs. Table Layout Pin
econner22-May-06 5:51
econner22-May-06 5:51 
AnswerRe: CSS Layout vs. Table Layout Pin
Guffa22-May-06 10:09
Guffa22-May-06 10:09 
GeneralRe: CSS Layout vs. Table Layout Pin
econner22-May-06 10:23
econner22-May-06 10:23 
AnswerRe: CSS Layout vs. Table Layout Pin
Guffa22-May-06 11:21
Guffa22-May-06 11:21 
GeneralRe: CSS Layout vs. Table Layout [modified] Pin
NeverHeardOfMe22-May-06 11:36
NeverHeardOfMe22-May-06 11:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.