/    Sign up×
Community /Pin to ProfileBookmark

I have problem in printing. I have made frame page this

<frameset rows=”0,*” frameborder=”0″ border=”0″>
<frame src=”ReceiptPage.aspx” name=”topFrame” scrolling=”No” noresize=”noresize” id=”topFrame” title=”topFrame” />
<frame src=”TransactionReport.aspx” name=”mainFrame” scrolling=”No” noresize=”noresize” id=”mainFrame” title=”mainFrame” />
</frameset>

and write following code to print the page without print dialog box but problem is that it is also printing mainFrame. I want to just printing topFrame only not mainFrame.
Can some body help me

[Code]
setTimeout(‘PrintReceipt()’,500);
setTimeout(‘Redirect()’,9000);
function Redirect()
{
window.location = “http://192.168.0.100/Enet/default.aspx”;
document.PrintMessage.submit();
}
function PrintReceipt(){
topFrame.focus()
if (navigator.appVersion.indexOf(“5.0”) == -1) {
var OLECMDID_PRINT = 6;
var OLECMDEXECOPT_DONTPROMPTUSER = 2;
var OLECMDEXECOPT_PROMPTUSER = 1;
var WebBrowser = “<OBJECT ID=”WebBrowser1″ WIDTH=0 HEIGHT=0 CLASSID=”CLSID:8856F961-340A-11D0-A96B-00C04FD705A2″></OBJECT>”;
document.body.insertAdjacentHTML(“beforeEnd”, WebBrowser);
WebBrowser1.ExecWB(6, 2);
WebBrowser1.outerHTML = “”;
}
[/Code]

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@ricpJan 03.2007 — The simplest way to print a frame only would be to call the print from that window object. I can't actually see where you are calling the print just now, but from any of the pages, you should be able to do..

<i>
</i>top.topFrame.print();
Copy linkTweet thisAlerts:
@milindsaraswalaauthorJan 03.2007 — The simplest way to print a frame only would be to call the print from that window object. I can't actually see where you are calling the print just now, but from any of the pages, you should be able to do..
[/QUOTE]


i m calling function in setTimeout('PrintReceipt()',500);
Copy linkTweet thisAlerts:
@felgallJan 03.2007 — Is that code on an intranet where you are only running Internet Explorer because most of the statements wont work in any other browser.
Copy linkTweet thisAlerts:
@milindsaraswalaauthorJan 04.2007 — yea it is using onli IE in all pc
×

Success!

Help @milindsaraswala spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...