AsishRaj
asked on
Client Side Printing
i have an asp.net website.
i have created multiple reports and now one of the requirements is to print the reports on the client printer. i am able to achieve this using Javascript but all the formating goes out.
Now what other alternative i have to do the same. appreciate if some1 can help me out on this
Appreciate if some can help me solve this issue.
i have created multiple reports and now one of the requirements is to print the reports on the client printer. i am able to achieve this using Javascript but all the formating goes out.
Now what other alternative i have to do the same. appreciate if some1 can help me out on this
Appreciate if some can help me solve this issue.
ASKER
i should have mentioned earlier
i printing crystal report on button click. Code snippet included
print_content only includes the crystal report and nothing else. i am having issue with Crystal Report Layout.
i printing crystal report on button click. Code snippet included
print_content only includes the crystal report and nothing else. i am having issue with Crystal Report Layout.
function Clickheretoprint()
{
var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,";
disp_setting+="scrollbars=yes,width=650, height=600, left=100, top=25";
var content_vlue = document.getElementById("print_content").innerHTML;
var docprint=window.open("","",disp_setting);
docprint.document.open();
docprint.document.write('<html><head><title></title>');
docprint.document.write('</head><body onLoad="self.print()" style="padding: 0px; margin: 0px"><center>');
docprint.document.write(content_vlue);
docprint.document.write('</center></body></html>');
docprint.document.close();
docprint.focus();
var hiddenControl = '<%= CR_PrintLetter.ClientID %>';
document.getElementById(hiddenControl).style.display = 'none'
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
yeah, i think thats is a nice way out. appreciate if you can upload the activeX here, so that other people looking at this thread can benefit as well.
ASKER
moghazali
i was trying to get it from CR site but couldnt find it
i was trying to get it from CR site but couldnt find it
ASKER
one question
does printcontrol.cab version needs to be same as the CR version installed with the VS 2008
does printcontrol.cab version needs to be same as the CR version installed with the VS 2008
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the help. It took me a while to figure out how to do it. Really helpful Links
<link rel="stylesheet" media="print" href="print.css" />
in that css file just hide all the unnecessary elements (like nav bars etc) and set all the widths and styles to fit. in your testing remove media="print" so you can see it on screen but then add it back in to apply it to print only