Free Support Forum -

.Save writes spreadsheet to html

Hello...I've used cells for standalone apps and never had a prob...I'm writing my first Cells web app using and the output of the function below ("SaveToExcel()") writes the file directly to the browser, which displays it as the very top of the page versus asking to save the file/xls file. I've tried all "SaveType" and "FileFormatType" options to no avail. Any help/direction/guidance? Thanks. Patrick.

Private Function SaveToExcel() As Integer

Dim loAspose As New pmpAspose

Dim designerFile As String = loAspose.Common_FileDir & "Patient_Revenues.xls"



Dim license As Aspose.Cells.License = New Aspose.Cells.License()


'--- you must get the

Dim designer As WorkbookDesigner = New WorkbookDesigner()

With designer


.SetDataSource("Rev_NM1_FID1433", "Patrick")

'.SetDataSource("Location", lsLocation)

'.SetDataSource("NumBeds", lnNumBeds)

'.SetDataSource("HospDemog", lsHospDemog)


.Save("Patient_Revenues.xls", SaveType.OpenInExcel, FileFormatType.Default, Me.Response) ', SaveType.OpenInExcel, FileFormatType.Default

End With

designer = Nothing

Catch ex As Exception

Trace.Warn("PMP Exception: ", ex.ToString)


End Try

End Function

When you write the file to client browser, Open/Save prompt window will always show because it must to tell the user that a binary file will be downloaded. If you want to display an Excel on web pages, you can try another Aspose product: Aspose.Grid. You can download it at . And online demos can be accessed at .