OWC11 Spreadsheet layout help needed

G

Gerry Roston

I have a rather simple ASP.NET program for displaying a formatted
spreadsheet. (Needless to say, there will be some data added!):

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim xlsheet As New SpreadsheetClass

Dim rs As New StreamReader(Server.MapPath(".") + "mySheet.xml")
Dim xmlContentFromFile As String = rs.ReadToEnd()
xlsheet.XMLData = xmlContentFromFile

Dim xlFileName As String = System.DateTime.Now.Ticks.ToString() +
".xls"
xlsheet.Export(Server.MapPath(".") + "\\" + xlFileName,
OWC11.SheetExportActionEnum.ssExportActionNone,
OWC11.SheetExportFormat.ssExportHTML)
Response.ContentType = "application/x-msexcel"
Response.WriteFile(Server.MapPath(".") + "\\" + xlFileName)
End Sub

mySheet.xml is an Excel 2003 spreadsheet that was save in XML format.
Looking in the .XML file, one finds:

<PageSetup>
<Layout x:Orientation="Landscape"/>
<Header x:Margin="0.25" x:Data="Stuff"/>
<Footer x:Margin="0.25" x:Data="More Stuff"/>
<PageMargins x:Bottom="0.5" x:Right="0.25" x:Top="0.75"/>
</PageSetup>

When the aspx page is loaded, the page displays in portrait mode (or so it
appears). More importantly, if I "Save As" the spreadsheet as a .XLS file
and open it, all page layout information is lost. This include the margins,
header/footer text, orientation, etc.

What must I do to preserve this information?
 
G

Gerry Roston

NO.

If you can offer any advice, I will welcome is whole-heartedly!

--
Gerry Roston
(e-mail address removed)
734-516-6715
Alvin Bruney said:
Did you get help on this?

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Gerry Roston said:
I have a rather simple ASP.NET program for displaying a formatted
spreadsheet. (Needless to say, there will be some data added!):

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim xlsheet As New SpreadsheetClass

Dim rs As New StreamReader(Server.MapPath(".") + "mySheet.xml")
Dim xmlContentFromFile As String = rs.ReadToEnd()
xlsheet.XMLData = xmlContentFromFile

Dim xlFileName As String = System.DateTime.Now.Ticks.ToString() +
".xls"
xlsheet.Export(Server.MapPath(".") + "\\" + xlFileName,
OWC11.SheetExportActionEnum.ssExportActionNone,
OWC11.SheetExportFormat.ssExportHTML)
Response.ContentType = "application/x-msexcel"
Response.WriteFile(Server.MapPath(".") + "\\" + xlFileName)
End Sub

mySheet.xml is an Excel 2003 spreadsheet that was save in XML format.
Looking in the .XML file, one finds:

<PageSetup>
<Layout x:Orientation="Landscape"/>
<Header x:Margin="0.25" x:Data="Stuff"/>
<Footer x:Margin="0.25" x:Data="More Stuff"/>
<PageMargins x:Bottom="0.5" x:Right="0.25" x:Top="0.75"/>
</PageSetup>

When the aspx page is loaded, the page displays in portrait mode (or so it
appears). More importantly, if I "Save As" the spreadsheet as a .XLS file
and open it, all page layout information is lost. This include the
margins,
header/footer text, orientation, etc.

What must I do to preserve this information?
 
A

Alvin Bruney [MVP]

This behavior is by design. To keep the formatting, you will have to embed
the owc object into the page, which is a completely different route from
where you are at now. I don't know if this is worth the hassle.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Gerry Roston said:
NO.

If you can offer any advice, I will welcome is whole-heartedly!

--
Gerry Roston
(e-mail address removed)
734-516-6715
Alvin Bruney said:
Did you get help on this?

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Gerry Roston said:
I have a rather simple ASP.NET program for displaying a formatted
spreadsheet. (Needless to say, there will be some data added!):

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim xlsheet As New SpreadsheetClass

Dim rs As New StreamReader(Server.MapPath(".") + "mySheet.xml")
Dim xmlContentFromFile As String = rs.ReadToEnd()
xlsheet.XMLData = xmlContentFromFile

Dim xlFileName As String = System.DateTime.Now.Ticks.ToString()
+
".xls"
xlsheet.Export(Server.MapPath(".") + "\\" + xlFileName,
OWC11.SheetExportActionEnum.ssExportActionNone,
OWC11.SheetExportFormat.ssExportHTML)
Response.ContentType = "application/x-msexcel"
Response.WriteFile(Server.MapPath(".") + "\\" + xlFileName)
End Sub

mySheet.xml is an Excel 2003 spreadsheet that was save in XML format.
Looking in the .XML file, one finds:

<PageSetup>
<Layout x:Orientation="Landscape"/>
<Header x:Margin="0.25" x:Data="Stuff"/>
<Footer x:Margin="0.25" x:Data="More Stuff"/>
<PageMargins x:Bottom="0.5" x:Right="0.25" x:Top="0.75"/>
</PageSetup>

When the aspx page is loaded, the page displays in portrait mode (or so it
appears). More importantly, if I "Save As" the spreadsheet as a .XLS file
and open it, all page layout information is lost. This include the
margins,
header/footer text, orientation, etc.

What must I do to preserve this information?
 

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

Top