openxml

OpenXML: Excel, extracting Cell text and Image/Picture data

时间秒杀一切 提交于 2019-11-28 10:28:30
I am writing code to extract the cells and pictures/images in cells from an Excel doc into a database. With this code I can get the cell values that are not Pictures. However, the Cell object doesn't have a picture it in. Note that every row starts with an image. A1- Picture B1- Text C1- Text and so on. How do I get the image from the "A" column? WorkbookPart wbPart = document.WorkbookPart; var workSheet = wbPart.WorksheetParts.FirstOrDefault(); foreach (Row r in workSheet.Worksheet.Descendants<Row>()) { //Note only has Colum B,C. Not A as A has an image??? foreach(Cell c in r.ChildElements) {

How to split table to new PowerPoint slide when content flows off current slide using Open XML SDK 2.0

ぃ、小莉子 提交于 2019-11-28 10:25:40
I have a bunch of data that I need to export from a website to a PowerPoint presentation and have been using Open XML SDK 2.0 to perform this task. I have a PowerPoint presentation that I am putting through Open XML SDK 2.0 Productivity Tool to generate the template code that I can use to recreate the export. On one of those slides I have a table and the requirement is to add data to that table and break that table across multiple slides if the table exceeds the bottom of the slide. The approach I have taken is to determine the height of the table and if it exceeds the height of the slide,

Duplicating Word document using OpenXml and C#

回眸只為那壹抹淺笑 提交于 2019-11-28 10:03:36
I am using Word and OpenXml to provide mail merge functionality in a C# ASP.NET web application: 1) A document is uploaded with a number of pre-defined strings for substitution. 2) Using the OpenXML SDK 2.0 I open the Word document, get the mainDocumentPart as a string and perform the substitution using Regex. 3) I then create a new document using OpenXML, add a new mainDocumentPart and insert the string resulting from the substitution into this mainDocumentPart. However, all formatting/styles etc. are lost in the new document. I'm guessing I can copy and add the Style, Definitions, Comment

How to create .doc file or word processor in iOS application?

依然范特西╮ 提交于 2019-11-28 08:54:08
问题 I am looking for word file processing in IOS application. I digging many things on google from that i found word file is based on OOXML. It`s possible for iOS to follow this format.Then please refer me if anyone have idea. Then i tried to found another way to changes styles of .doc file. and i found, we can perform such thing in UIWebView using JavaScripts on .html file. But still not get how to store this .html file in .doc. if anyone have idea regarding word-processor then guide me how it`s

OLE DB vs OPEN XML SDK vs Excel.interop

蹲街弑〆低调 提交于 2019-11-28 07:42:36
I need to read XLSX files and extract a maximum amount of content from it. Which of the API's should I use? OLE DB, open XML SDK, or Excel Interop? Which is the easiest to use? Can you retrieve all the information using one or the other? i.e, date, times, merged cells, tables, pivottables, etc. You can try all of them and choose the one that fits you most... Depending on data you want to read, I'd suggest you to use Open XML over Interop or Ole DB. I don't know an open XML SDK, although I've some experience with EPPlus library which I'm using a lot and can say only good words about it - it's

How to retrieve Tab names from excel sheet using OpenXML

前提是你 提交于 2019-11-28 06:58:24
I have a spreadsheet document that has 182 columns in it. I need to place the spreadsheet data into a data table, tab by tab, but i need to find out as I'm adding data from each tab, what is the tab name, and add the tab name to a column in the data table. This is how I set up the data table. I then loop in the workbook and drill down to the sheetData object and walk through each row and column, getting cell data. DataTable dt = new DataTable(); for (int i = 0; i <= col.GetUpperBound(0); i++) { try { dt.Columns.Add(new DataColumn(col[i].ToString(), typeof(string))); } catch (Exception e) {

How to add a comment to a cell in Excel 2007 using the Open XML SDK 2.0?

拟墨画扇 提交于 2019-11-28 05:51:03
问题 Has anyone ever had any luck figuring out how to add a comment to Excel using the Open XML SDK 2.0? I couldn't find any documentation on where to get started on this issue. 回答1: The below code will take the worksheet that you want to add comments to and then iterate over the commentsToAdd dictionary. The dictionary key is the cell reference (ie. A1) and the value is the comment text to be added. /// <summary> /// Adds all the comments defined in the commentsToAddDict dictionary to the

how to create and download excel document using asp.net

守給你的承諾、 提交于 2019-11-28 05:07:41
How to create and download excel document using asp.net ? The purpose is to use xml, linq or whatever to send an excel document to a customer via a browser. Edit : Use case The customer load a gridview ( made with ajax framework ) in a browser, the gridview is directly linked to an sql database. I put a button 'export to excel' to let customer save this gridview data on his computer ansd i would like to launch a clean download of an excel. The solutions proposed here are not clean, like send an html document and change the header to excel document etc, i'm searching a simple solution on

Add HTML String to OpenXML (*.docx) Document

大憨熊 提交于 2019-11-28 05:02:19
I am trying to use Microsoft's OpenXML 2.5 library to create a OpenXML document. Everything works great, until I try to insert an HTML string into my document. I have scoured the web and here is what I have come up with so far (snipped to just the portion I am having trouble with): Paragraph paragraph = new Paragraph(); Run run = new Run(); string altChunkId = "id1"; AlternativeFormatImportPart chunk = document.MainDocumentPart.AddAlternativeFormatImportPart( AlternativeFormatImportPartType.Html, altChunkId); chunk.FeedData(new MemoryStream(Encoding.UTF8.GetBytes(ioi.Text))); AltChunk altChunk

How do you display a formatted Word Doc in HTML/PHP?

时光毁灭记忆、已成空白 提交于 2019-11-27 22:37:04
What is the best way to display a formatted Word Doc in HTML/PHP? Here is the code I currently have but it doesn't format it: $word = new COM("word.application") or die ("Could not initialise MS Word object."); $word->Documents->Open(realpath("ACME.doc")); // Extract content. $content = (string) $word->ActiveDocument->Content; echo $content; $word->ActiveDocument->Close(false); $word->Quit(); $word = null; unset($word); I know nothing about COM, but poking around the Word API docs on MSDN, it looks like your best bet is going to be using Document.SaveAs to save as wsFormatFilteredHTML to a