Questions tagged [openxml-powertools]
37 questions
4
votes
0 answers
Is it possible to construct and stream a big DocumentFormat.OpenXML spreadsheet document without loading everything into memory?
I have an ASP.NET Core app. There is a report created from data in DB that can be potentially several gigabytes in size.
Is it possible to stream data as a response from WebAPI in chunks, so that memory usage on server is minimized?
A very rough…

Anarion
- 2,406
- 3
- 28
- 42
4
votes
1 answer
Reference to type 'Bitmap' claims it is defined in 'System.Drawing', but it could not be found
I am trying to convert DOCX file to HTML using Open XML power tools in .Net Core Project. Everything was smooth until i encounter images in the document file.
I tried the below code for exporting the images using open XML power tools
using…
4
votes
2 answers
OpenXmlPowerTools DocumentBuilder merging documents on a seperate page
I am trying to merge 4 word documents and force content of each document starts at new page. But instead of appending text from each document to a separate page, it adds text from all docs to one page.
Like this:
How can i fix it?
This is the code:
…

Timur
- 131
- 1
- 3
- 13
3
votes
1 answer
How do you create multi-level ordered lists with Open XML in ASP.net?
I've spent countless hours trying to understand ordered lists in Open XML. Here's one of many references.
I found this incredibly helpful example of a simple document creator here.
Also if I may gripe a little bit, I must say this is a painful…

user1447679
- 3,076
- 7
- 32
- 69
2
votes
1 answer
Modifed word document not saving in memorystream
I am getting a word document from SharePoint using Microsoft graph API as a stream and changing some content in that file and downloading the saved content as a file but when I open the file, the modified content is not available. The downloaded…

praveen
- 95
- 15
2
votes
1 answer
OpenXML SpreadsheetDocument SaveAs() giving file-in-use error
I'm trying to generate an Excel spreadsheet dynamically, using OpenXMLPowerTools v4.5.3.2, DocumentFormat.OpenXML v2.9.1, called from a ASP.Net Core web app.
I've verified that able to generate the spreadsheet OK.
The problem is that I need to…

FoggyDay
- 11,962
- 4
- 34
- 48
2
votes
0 answers
Pivot Table using OpenXML Power Tool in C#
I am trying to generate Pivot tables programatically using C# OpenXML Power tool. I am trying to export the raw data to sheet 1 and Pivot table on sheet1.
When I am adding an integer column as a data value, Pivot table is generated with proper…

Sabarish
- 64
- 4
1
vote
0 answers
What should be the docx template to put two XML fields in one column using OpenXmlPowerTools
In my project we are generating reports using OpenXmlPowerTools by passing XML to DocumentAssembler.AssembleDocument method.
Everything works fine. Currently this is the table template in my .docx file
Now, I have added one more field to the…

Pawan Nogariya
- 8,330
- 12
- 52
- 105
1
vote
0 answers
OpenXmlPowerTools.TextReplacer.SearchAndReplace is not working on word document
I'm working on a simple document merge. Wanted to find some strings and replace it with another string (Outside table).
So here is the issue, when i try to use TextReplacer.SearchAndReplace after accessing table using var table =…

Akshay katale
- 137
- 3
- 10
1
vote
1 answer
OpenXmlPowerTools DocumentBuilder merging documents on a seperate page
public void DocMerger()
{
var source1 = Server.MapPath(Url.Content("~/1.docx")); //source 1
var source2 = Server.MapPath(Url.Content("~/2.docx")); //source 2
var merged = …

Rams
- 11
- 2
1
vote
1 answer
OpenXML SDK C# - Shared Formula corrupts my Excel file
I am trying to insert a Shared Formula into an existing Excel sheet. every time I open the finished Excel, it shows me an error and fixes the Excel. I have the code from OpenXML Productivity Tools. All other formulas work without problems ...
var…

br0ken.pipe
- 850
- 3
- 17
- 32
1
vote
0 answers
How to Replace a Line Break with a New Paragraph Using OpenXml
I have a set of documents that I replace placeholder text with text inputted by a user. A user has a list of words with definitions (data below is just an example). A tab separates the word from the definition. A new line is created for each new…

Mr. Cooper
- 364
- 3
- 12
1
vote
1 answer
How to handle floating images in OpenXML and convert to html equivalent
I am using OpenXML along with OpenXML Power Tools. So far I have managed to convert a lot of words functionality to html. The main point I can't yet figure out is floating images. I have taken the following example from PowerTools and slightly…

UncountedBrute
- 484
- 1
- 7
- 25
1
vote
0 answers
GCP bucket stream was not opened for writing with openxml sdk c#
I am struggling with modifying the data in stream which i got from google cloud bucket. Here is the code to get the stream -
var storageService = new StorageService(new BaseClientService.Initializer()
{
…

Sumit Sharma
- 126
- 2
- 11
1
vote
1 answer
OpenXML MainDocumentPart.Document.Save() doesn't seem to save in .Net 5 Core
I've been porting an application from .net framework to .net 5. I'm trying to generate a word document by reading a template file, using Open-XML-PowerTools to replace some text, and saving the new version.
I can't get the "Save()" to do…

RichC
- 49
- 3