Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Description

Excerpt

The Process method enters data source values in a template's data markers, and creates the output file (the new spreadsheet) in memory. The Save method can then save the output file to disk, stream it to the browser, or both.

Signature
C#C#
Wiki Markup
{description}
{excerpt}The [Process|ExcelTemplate.Process()] method enters data source values in a template's data markers, and creates the output file \(the new spreadsheet\) in memory. The [Save|ExcelTemplate.Save] method can then save the output file to disk, stream it to the browser, or both.{excerpt}
{signature:C#}
 public virtual void Process()
Signature
{signature}{signature:vb.net
vb.net
}
Public Overridable Sub Process()
Remarks

Call Process after SetDataSource and before Save.

You can call Process only once for each instance of ExcelTemplate.

{signature}
{remarks}Call {{Process}} after [SetDataSource|ExcelTemplate.SetDataSource] and before [Save|ExcelTemplate.Save].

You can call {{Process}} only once for each instance of [ExcelTemplate].
          
{remarks}
{example}{code:csharp|title=C#}

          ExcelTemplate xlt = new ExcelTemplate();
          xlt.Open(Application["templatepath"] +
               @"\DataBinding\ArrayBindingTemplate2.xls");

          //--- Set a data source for the data marker "SimpleArray."
          string[] onedim = {"SoftArtisans", "OfficeWriter", "ExcelTemplate"};
          xlt.SetColumnDataSource(onedim, "SimpleArray");

          //--- Process the template to populate it with the data source data.
          xlt.Process();

          //--- Stream the processed document to the client.
          xlt.Save(Page.Response, "ArrayBinding.xls", false);
       
{code}
{code:vb.net
|title=vb.net
}

          Dim xlt As New ExcelTemplate()
          xlt.Open(Application("templatepath") & _
               "\DataBinding\ArrayBindingTemplate2.xls")

          '--- Set a data source for the data marker "SimpleArray."
          Dim onedim As String() = {"SoftArtisans", "OfficeWriter", "ExcelTemplate"}
          xlt.SetColumnDataSource(onedim, "SimpleArray")

          '--- Process the template to populate it with the data source data.
          xlt.Process()

          '--- Stream the processed document to the client.
          xlt.Save(Page.Response, "ArrayBinding.xls", False)
        {code}

{example}
Example
Code Block
csharpcsharp
titleC#
Code Block
vb.nettitle