Urgent - Asp.NET Datagrid export Excel - landscape Issue

G

Guest

I would appreciate if some one could help me out with this problem.

I am trying to export the datagrid to an excel file in ASP.NET.
The functionality works fine.

But I would like to setup the excel file in a landscape oriented format with
predefined margins.
Aftre going through the internet, I found articles which are saying about
setting the styles for @page which should resolve the problem. But I am not
sure where should I place the style of @page. Event if I set it up for a
page, the excel file which opens, comes with its predefined margins and
orientation.

Can some body tell me -
How do add headers specific to excel landscape orientation to the Response
from ASP.NET?
If this is not possible how should I approach this problem. As I am not able
to find the exact place where my own @page style should go.

Any help would be appreciated.

Thanks,
Dinoo
 
M

Mischa Kroon

dinoo said:
I would appreciate if some one could help me out with this problem.

I am trying to export the datagrid to an excel file in ASP.NET.
The functionality works fine.

But I would like to setup the excel file in a landscape oriented format
with
predefined margins.
Aftre going through the internet, I found articles which are saying about
setting the styles for @page which should resolve the problem. But I am
not
sure where should I place the style of @page. Event if I set it up for a
page, the excel file which opens, comes with its predefined margins and
orientation.

Can some body tell me -
How do add headers specific to excel landscape orientation to the Response
from ASP.NET?
If this is not possible how should I approach this problem. As I am not
able
to find the exact place where my own @page style should go.

Any help would be appreciated.

Thanks,
Dinoo

Not exactly what you asked for but an alternative might be to use an
excelwriter component.

Free:
http://www.carlosag.net/Tools/ExcelXmlWriter/Default.aspx

Commercial:
http://officewriter.softartisans.com/

These generate real excel files with margins etc etc.

Other options:
http://bloggingabout.net/blogs/mischa/archive/2006/05/30/12271.aspx
 
G

Guest

I appreciate your help Mischa,
But I would prefer not to go to any third party tools.

Thanks,
Dinoo
 
M

Mischa Kroon

Try the second link then it has ways of doing what you want without any
third party tools.
 
G

Guest

The other link talk about working with Com object which may not be feasible
option on server side.

Is there any way I can select a Legal paper as default for the excel sheet
which has been rendered by ASP.NET?

dinoo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top