Subscribe to Subscribers

Resources » TypeScript » Scripting Languages » Javascript

Report without using any reporting tool


Posted Date:     Category: Javascript    
Author: Member Level: Gold    Points: 4


Printing gridview or any element in asp.net or PHP or html page with a preview window and hiding form elements



Include the contents we want to print inside a div tag
Call the javascript function with the div id as argument

javascript function



function CallPrint(strid)
{
document.getElementById("btnPrint").style.visibility='hidden';
var prtContent = document.getElementById(strid);
var footer = "<b>abc.com</b>";
var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,";
disp_setting+="scrollbars=yes,width=650, height=600, left=100, top=25";
var docprint=window.open("","",disp_setting);
docprint.document.open();
docprint.document.write('<html><head><title>abc Hospital</title>');
docprint.document.write('</head><body onLoad="self.print()"><center>');
docprint.document.write(prtContent.innerHTML);
docprint.document.close();
docprint.focus();
}
</script>




assume there is a button 'btnPrint' inside the div tag.





Did you like this resource? Share it with your friends and show your love!


Responses to "Report without using any reporting tool"
Author: Pal (Parthiv) Patel    14 Aug 2010Member Level: Gold   Points : 1
good code for Report without using any reporting tool


there nice one mr ranjith.

keep it man

post your views your views.



Feedbacks      

Post Comment:




  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Next Resource: Text zoomer
    Previous Resource: Disable enter key stroke
    Return to Resources
    Post New Resource
    Category: Javascript


    Post resources and earn money!
     
    More Resources
    Popular Tags   Tag posting guidelines   Search Tags  
    Printing gridview or any element in asp.net with a preview window  .  

    Active Members
    TodayLast 7 Daysmore...

    Awards & Gifts
    Talk to Webmaster Tony John
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
    2005 - 2013 All Rights Reserved.
    .NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
    Articles, tutorials and all other content offered here is for educational purpose only.
    We are not associated with Microsoft or its partners.