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" xata="Stuff"/>
<Footer x:Margin="0.25" xata="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?
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" xata="Stuff"/>
<Footer x:Margin="0.25" xata="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?