Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my grid, number of columns will be dynamic. So if there is 3 or 4 columns, it was ok.
But if over 10 columns, it's not fit with A4 size. So I want to know how I can use page margin or page set up features. Thanks
Posted

C#
function Print()
    {
     var sysOption="toolbar=yes,location=no,directories=yes,menubar=yes,scrollbars=yes,left=100,top=25";
     var winprint=window.open("","",sysOption);
      winprint.document.open();
               winprint.document.write(document.getElementById("GridView1").innerHTML);
        winprint.document.close();

        winprint.focus();
        winprint.print();
        winprint.close();
    }
 
Share this answer
 
Comments
satheshjan 4-Jul-13 6:49am    
Its Working fine ..if no rows low its working ,But No of Rows increase more then one page that time print only the few columns.thank you for your use full reply.
Naz_Firdouse 4-Jul-13 7:25am    
Hi satheshjan, mark it as answer so that it will be sueful for others

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900