quiTech
asked on
Specify paper orientation and page size in Excel from ASP
I am creating an Excel page from ASP, using this line:
<% Response.ContentType = "application/vnd.ms-excel" %>
The rest of the page is HTML (created via ASP).
Is there any way I can tell the client that the Excel page-setup should be Landscape and using Legal Paper? How about the "fit to page" option?
Thanks!
<% Response.ContentType = "application/vnd.ms-excel"
The rest of the page is HTML (created via ASP).
Is there any way I can tell the client that the Excel page-setup should be Landscape and using Legal Paper? How about the "fit to page" option?
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks!
does this solution work for IE?
Yes and no. It is for Excel. Now, since IE can load Excel's DLLs and view Excel files, yes this works for IE insamuch that IE is just a shell for Excel when viewing the .xls stream from the web server.
well I am actually doing an export to excel. So I have a datagrid on an aspx page which I export to excel.
I tried the above mentioned way but it does not seem to work. The excel spreadsheet just open up in portrait format.
I tried the above mentioned way but it does not seem to work. The excel spreadsheet just open up in portrait format.
Are you using Excel 2007 by any chance? I'm going to guess this won't work for the newest Excel since MS changed a lot in the new Office.
no i am using excel 2002
@page
{
mso-page-orientation:lands
}