|
Rank: Newbie Groups: Member
Joined: 3/25/2008 Posts: 4
|
Hi, i need help printing data in a grid. I've got about 12 columns in my grid and i'm using the following code to print it. The problem I get is that it only prints the visible part of the grid, how can I make sure it print the entire grid? And how can I force it to print in Landscape mode? Is there another approach I could use?
Code: JavaScript
function CallPrint(strid)
{
var prtContent = document.getElementById(strid);
var WinPrint = window.open('','','letf=0,top=0,width=400,height=100,toolbar=0,scrollbars=0,status=0');
WinPrint.document.write(prtContent.innerHTML);
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
prtContent.innerHTML=strOldOne;
}
Code: HTML/ASPX
<div id="divPrint">
<eo:Grid ID="Grid1" runat="server">...</eo:Grid>
</div>
Then I have a button:
Code: HTML/ASPX
<input type="button" id="btnPrint" value="Print Report" onclick="javascript:CallPrint('divPrint');"
runat="server" />
|
|
Rank: Newbie Groups: Member
Joined: 3/25/2008 Posts: 4
|
The printout looks something like the image below. There's clearly enough space on the paper but its leaving that space blank.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Unfortunately we are not aware of any way to do it except for using a second Grid (probably in a second page) with no scrollbars. When scrollbars are enabled on the Grid, what's outside the Grid is clipped off. And since you use innerHTML to print and the clip are set on those HTML elements, there doesn't seem to be a reliable way to have it appear differently than on the screen.
Thanks
|
|
Rank: Newbie Groups: Member
Joined: 3/25/2008 Posts: 4
|
Is it possible to export to the data to PDF and/or excel?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
You can export it in any format, but it would have nothing to do with the Grid. The Grid does not provide anything related to exporting. You would basically write the code to get the data from your data source and dump it to a PDF Writer or Excel file writer. Excel is very easy because you can simply do a .csv file, which is plain text.
Thanks
|
|