openxml-sdk

What indicates an Office Open XML Cell contains a Date/Time value?

房东的猫 提交于 2019-12-17 04:48:23
问题 I'm reading an .xlsx file using the Office Open XML SDK and am confused about reading Date/Time values. One of my spreadsheets has this markup (generated by Excel 2010) <x:row r="2" spans="1:22" xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main"> <x:c r="A2" t="s"> <x:v>56</x:v> </x:c> <x:c r="B2" t="s"> <x:v>64</x:v> </x:c> . . . <x:c r="J2" s="9"> <x:v>17145</x:v> </x:c> Cell J2 has a date serial value in it and a style attribute s="9" . However, the Office Open XML

Export DataTable to Excel with Open Xml SDK in c#

 ̄綄美尐妖づ 提交于 2019-12-17 04:48:15
问题 Sorry for my english please. I'm new in open xml sdk. My program have ability to export some data and DataTable to Excel file (template) In the template I insert the data to some placeholders. It's works very good, but I need to insert a DataTable too... My sample code: using (Stream OutStream = new MemoryStream()) { // read teamplate using (var fileStream = File.OpenRead(templatePath)) fileStream.CopyTo(OutStream); // exporting Exporting(OutStream); // to start OutStream.Seek(0L, SeekOrigin

How to apply font and color on text in cells of Excel file using openxml

隐身守侯 提交于 2019-12-14 03:56:44
问题 I am new in Openxml. I am trying to create a xlsx file using openxml. I want to apply different font and color to the text of different cells in excel file. I am using this for creating a xlsx file but not able to do the font and color part. SpreadsheetDocument spreadsheetDocument = SpreadsheetDocument.Create("E:\\Word9.xlsx", SpreadsheetDocumentType.Workbook); WorkbookPart workbookpart = spreadsheetDocument.AddWorkbookPart(); workbookpart.Workbook = new Workbook(); WorksheetPart

Read/import existing Excel file programmatically (cell-by-cell) in Windows Phone 8

冷暖自知 提交于 2019-12-14 01:31:18
问题 I am working on a Windows Phone 8 app to READ/WRITE Excel files. I asked a question here about this and the comment provided and many other links led me to OpenXml. All of this got me good on how to create an Excel file and how to launch it. But now I am stuck at very basic of these all i.e. How to read an existing Excel file (probably created outside using MS Excel) cell-by-cell i.e. I want to access each cells and their values through my code. In the openXML thing I did this: Stream

Adding spacing and blank lines to Open Office XML

狂风中的少年 提交于 2019-12-13 05:57:54
问题 I am trying to output a word file using Open Office XML, but can't seem to get spacing correct. Variable name:ATTEND Description:Student's attendance status during the I want the word file to be this (with spaces after the :): Variable name: ATTEND Description:Student's attendance status during the My code is as follow, and the spacing disappears: start of my function // Add a new main document part. MainDocumentPart mainPart = wordDocument.AddMainDocumentPart(); // Create the Document DOM.

Relationship error when trying to embed and image into a Word document

巧了我就是萌 提交于 2019-12-13 04:58:42
问题 I add a PNG image to a word 2010 document like this: var imagePart = report.MainDocumentPart.AddImagePart(ImagePartType.Png); var imagePath = Path.Combine(imageFolder, "1.png"); var stream = new FileStream(imagePath, FileMode.Open); imagePart.FeedData(stream); stream.Close(); I find the blip element of an empty Picture content control and change its reference property to point to the new image: var blip = image.Descendants<Blip>().Single(); blip.Embed = report.MainDocumentPart.GetIdOfPart

Ribbon not showing up with dynamically generated ribbon XML from the database

一曲冷凌霜 提交于 2019-12-13 03:57:34
问题 I am trying to form ribbon XML with the data from the database and following is what I wrote:- XNamespace xNameSpace = "http://schemas.microsoft.com/office/2006/01/customui"; XDocument document = new XDocument(); document.Add( new XElement (xNameSpace+"customUI" , new XElement("ribbon" , new XElement("tabs")))); // more code to add the groups and the controls with-in the groups ....... // code below to add ribbon XML to the document and to add the relationship RibbonExtensibilityPart

How can I use Custom Xml / User-Defined Tags in .pptx /.pptm so PowerPoint 2013 won't wipe it?

人走茶凉 提交于 2019-12-13 03:44:14
问题 I need to embed custom data in a .pptx that I generate, so that it can later be uploaded and have the images in the doc updated by my code. I've tried a couple of methods now, and done lots of looking. I've found a couple of answers quite similar to this, but their solutions haven't worked for me - though perhaps I've just implemented them wrong. (links at the bottom) The methods I've tried are: 1) Storing the custom data in an ExtendedAttribute: //OpenXmlDrawing = DocumentFormat.OpenXml

Word 2010 + Save math equation as image

冷暖自知 提交于 2019-12-13 03:21:08
问题 how can I save a math equation (from a word document) as an image, using c#?? Perhaps, I should use openxml sdk ? Anyone can help? 回答1: Save the document as Word 97-2000 (i.e. .doc instead of .docx) then save the document as a webpage. All equations will be saved as image in the for_img directory. 来源: https://stackoverflow.com/questions/6533984/word-2010-save-math-equation-as-image

Can I use VSTO instead of Open XML to manipulate altChunk features?

混江龙づ霸主 提交于 2019-12-13 02:36:55
问题 I would like to embed one Word document (call it "hidden.docx") into another Word document (call it "host.docx"). The document hidden.docx would not be visible at all when host.docx is opened in Word by an end-user. Document hidden.docx would only be carried inside host.docx, sort of as unstructured cargo data. All research I have done points me to the use of something called altChunk offered by the Open XML SDK. I have installed Open XML SDK and got a sample working: http://msdn.microsoft