Skip to content

Conversation

@martinivanoff
Copy link
Contributor

…rmation about the new append to document feature.

…rmation about the new append to document feature.
>IWorkbookExporter inherits from [IDisposable](https://msdn.microsoft.com/en-us/library/system.idisposable(v=vs.110).aspx). Make sure the object is disposed when you are done with it. Otherwise, the content won't be written in the exported file. The best way to ensure this is handled properly is to wrap it in a *using* statement.
__Append content to the opened stream__

The __CreateWorkbookExporter__ method creates a new workbook which overrides the content of the stream if it's not empty. You can change that by using the second overload of the CreateWorkbookExporter method and pass the export mode explicitly. You can do that via the last parameter of the method (exportMode) which is of type __SpreadExportMode__. SpreadExportMode is an enum that exposes two constants - __Create__ and __Append__. The default export mode is Create which overrides the stream's content. If you set the export mode to __Append__, an existing workbook from the stream will be opened if there is any content in it. Then you can append the new content to it.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CreateWorkbookExporter method creates a new workbook which overrides the content of the document contained in the stream if it's not empty.
...
The default export mode is Create, which overrides the stream's content.
...
Then you can append the new content to the already existing one.


>tip The Аppend mode is not supported in Xamarin.
<!-- -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete that?

{{endregion}}

>IWorkbookExporter inherits from [IDisposable](https://msdn.microsoft.com/en-us/library/system.idisposable(v=vs.110).aspx). Make sure the object is disposed when you are done with it. Otherwise, the content won't be written in the exported file. The best way to ensure this is handled properly is to wrap it in a *using* statement.
__Append content to the opened stream__
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Append Content to an Existing Document (format it as a heading)

@martinivanoff martinivanoff merged commit df6cecb into R1-2017 Jan 10, 2017
@martinivanoff martinivanoff deleted the SpreadStreamProcessing_WorkBookExporter_ExportMode branch January 10, 2017 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants