Welcome Guest Search | Active Topics | Sign In | Register

Grid Print Options
Eleven
Posted: Tuesday, May 20, 2008 5:44:39 AM
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" />
Eleven
Posted: Tuesday, May 20, 2008 6:19:31 AM
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.

eo_support
Posted: Tuesday, May 20, 2008 10:11:58 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,218
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
Eleven
Posted: Wednesday, May 21, 2008 2:17:54 AM
Rank: Newbie
Groups: Member

Joined: 3/25/2008
Posts: 4
Is it possible to export to the data to PDF and/or excel?
eo_support
Posted: Wednesday, May 21, 2008 8:54:59 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,218
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


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.