Introducing SoftArtisans OfficeWriter 3.0 Enterprise, with ASP Features - Generating an Excel Document
(Page 4 of 5 )
Let us now look at how to generate a simple Excel document using ExcelWriter. Copy the code given below and execute it appropriately.
Imports System
Imports System.Web.UI
Imports SoftArtisans.OfficeWriter.ExcelWriter
Namespace SoftArtisans.ExcelWriter.MyOfficeWriter
Public Class MyExcelDoc : Inherits System.Web.UI.Page
Private excelapp As ExcelApplication
Protected Sub Page_Load(sender As Object, e As EventArgs)
TriggerDocument()
End Sub
Private Sub TriggerDocument()
excelapp = New ExcelApplication()
Dim wbook As Workbook = excelapp.Create()
Dim wsheet As Worksheet = wbook.Worksheets(0)
wsheet.Cells(0, 0).Value = "This excel document has been generated by using
SoftArtisans OfficeWriter Enterprise Edition"
wsheet.Cells("C2").Value = "Microsoft"
wsheet.Cells("D2").Value = "Oracle"
wsheet.Cells("E2").Value = "Sybase"
excelapp.Save(wbook, Page.Response, "MyOfficeWriterExcelDocument.xls", True)
End sub
End Class
End Namespace
The final output will be as shown in figure 2:

You can also generate the document using the appropriate templates. The vendor has provided a detailed step-by-step guide at http://docs.softartisans.com/OfficeWriterWindows/
3.0.5/WordWriter/quickstart/WordTemplate.aspx.
Next: Documentation and Support >>
More ASP Articles
More By