Home     Products      Support      Corporate     Sign In 

Migrating ExcelTemplate
ASP.NETApplications from Interop
to Pure .NET

In previous versions of OfficeWriter for Excel, .NET support was added through the introduction of Interop assemblies. These Interop assemblies facilitated communication between .NET applications and the COM version of OfficeWriter.

 OfficeWriter Resources

 OfficeWriter Demos

 Evaluation Software Login to Access this Item


In OfficeWriter v3, .NET support has been further improved with the introduction of the SAXW5NET.dll assembly, which provides a pure .NET ExcelTemplate object. To migrate your existing Interop-based OfficeWriter application to use the new pure .NET ExcelTemplate object there are four main areas where you will need to make modifications:

1. OfficeWriter for Excel Namespace and Application References

Old Namespace Import: New Namespace Import:
[C#]
using
SoftArtisans.ExcelWriter;


[VB.NET]
Imports
SoftArtisans.ExcelWriter
[C#]
using
SoftArtisans.OfficeWriter.ExcelWriter;


[VB.NET]
Imports
SoftArtisans.Officewriter.ExcelWriter


Old Object Instantiation: New Object Instantiation:
[C#]
SAExcelTemplateDotNet
oXlw = new SAExcelTemplateDotNet();

[VB.NET]
Dim oXlw As New SAExcelTemplateDotNet()
[C#]
ExcelTemplate
oXlw = new ExcelTemplate();

[VB.NET]
Dim oXlw As New SAExcelTemplate ()

2. Setting Data Sources

    With the pure .NET ExcelTemplate object, the setting of data sources has changed to accommodate more native .NET types. The most significant change is that you can now use ADO.NET DataTables and DataReaders as data sources (in addition to DataSets). In the previous version you needed to pass in the DataSet that contained the DataTable. Now you can just pass in the DataTable to one of the overloaded SetDataSource methods. The new .NET ExcelTemplate also includes many new methods for setting array data sources (1-dimensional and 2-dimensional).

3. Template Processing and Saving

    To process and save a spreadsheet with the Interop version of ExcelTemplate, a single call to Process was required. In the .NET ExcelTemplate, a call to Process and a call to Save are required. This second approach allows you to save more than one copy of a generated file, and/or both save the file on the server and stream it to the client. Using multiple Process and Save calls, you can generate multiple files from a single template and an updated data source.

4. Data Marker Syntax

    Most of your existing templates should still work with the pure .NET ExcelTemplate object. However, there are two things to be aware of:

    1. The data markers must be comprised of the characters and/or numbers: a-z, A-Z, and 0-9.

    2. The dollar sign ($) is no longer necessary in all non-database data markers. This makes it easier for developers to use mock data in arrays during development; when the report is deployed to use a database, the data markers will not have to be changed. The $ is now only required when binding to a single object or single columnar array, where a field name or field ordinal is not specified in the data marker.

Please Note: Your existing templates will still work, if you leave the $ in place. This allows for the re-use of templates created for the Interop ExcelTemplate object without any modifications.

OfficeWriter
Evaluate
Features
OfficeWriter Features
Office on the Server
Two-Way Data Update
Return on Investment
Performance Testing
New Features in v3.5
Features for Excel
Features for Word
Customers & Partners
OfficeWriter Customers
Customer List
Success Stories
Product Reviews
OfficeWriter Partners
OEM & Reseller
Web Hosting
Platforms
OfficeWriter Platforms
ASP & ASP.NET
SQL Reporting Services
System Requirements
Product Resources
OfficeWriter Resources
OfficeWriter FAQ
Getting Started
System Requirements
Brochures
Order OfficeWriter
Order OfficeWriter
Developer License
Order Upgrade
Pricing & Licensing
Self-Help Resources
Support Home
Knowledge Base
OfficeWriter Docs
OfficeWriter Forums
Sample Code
Version Differences
Support Options
Support Subscriptions
Maintenance Plans
Per-Issue Support
Consulting
Training
Support Request Form
Downloads
Evaluation Software
Product Updates
Corporate
About SoftArtisans
Contact Us
Partners
Resellers & OEMs
Web Hosting
Order Info/Privacy Policy
Career Opportunities

To learn more about Officewriter and pricing information, contact SoftArtisans:

 
Email: sales@softartisans.com
Toll Free:1(877)SOFTART(763-8278), option 1
International:+1(617)607-8800, option 1
Purchase  |  Evaluate  |  Demos  |  Support  |  Contact Us  |  Site Map
Copyright 2008 © SoftArtisans, Inc. All Rights Reserved.