Hi,
I'm trying to save Excel files to XPS format, and I get an error when saving this to an Outputstream. With Aspose.Words and Aspose.PDF it works, but not with Aspose.Cells.Sample code:
Dim OutFile As New System.IO.FileInfo(Downloadlocatie) If (OutFile.Extension = ".doc") Or (OutFile.Extension = ".docx") Then Dim OutputDoc As New Aspose.Words.Document(Downloadlocatie) OutputDoc.Save(Context.Response.OutputStream, Aspose.Words.SaveFormat.Xps) ElseIf (OutFile.Extension = ".pdf") Then Dim OutputDoc As New Aspose.Pdf.Document(Downloadlocatie) OutputDoc.Save(Context.Response.OutputStream, Aspose.Pdf.SaveFormat.Xps) ElseIf (OutFile.Extension = ".xls") Or (OutFile.Extension = ".xlsx") Then Dim OutputDoc As New Aspose.Cells.Workbook(Downloadlocatie) 'OutputDoc.Save("c:\www\file.xps", Aspose.Cells.SaveFormat.XPS) OutputDoc.Save(Context.Response.OutputStream, Aspose.Cells.SaveFormat.XPS) End If
The code with extensions .doc / .docx / .pdf works perfectly. The code with .xls and .xlsx gives the following error. The outcommented part does work though!
The error I get:
De method is not supported
bij System.Web.HttpResponseStream.set_Position(Int64 value)
bij ..(Stream , ImageOrPrintOptions )
bij Aspose.Cells.Workbook.Save(Stream stream, SaveOptions saveOptions)
bij System.Web.UI.Control.LoadRecursive()
bij System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)De opgegeven methode wordt niet ondersteund.
bij System.Web.HttpResponseStream.set_Position(Int64 value)
bij ..(Stream , ImageOrPrintOptions )
bij Aspose.Cells.Workbook.Save(Stream stream, SaveOptions saveOptions)
bij System.Web.UI.Control.LoadRecursive()
bij System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
What can be wrong, is this a bug? Or should I change my code?
Kind regards,
Martin de Ruiter