openxml

Read only or Lock the particular cells or rows using open xml sdk

落花浮王杯 提交于 2019-12-22 09:31:54
问题 I am using open xml sdk to export excel. I get the excel file and copying that file to another place and then I'm inserting new rows with the data. I should make that rows as read only (or I've to lock) using open xml sdk.. How to do that ? 回答1: I've referred the following link Excel File Password Protection with Open XML SDK. Here I gave you full code to open the file from directory and insert cells. Here I've inserted only one cell. You can insert as you want. Here I've inserted locked

OPEN XML add custom not visible data to paragraph/table

喜你入骨 提交于 2019-12-22 09:07:41
问题 Is there a way to store additional data for a paragraph, that would be persisted after user opens and saves a document in MS Word. Ive been using CusotmXML for this, but it turns out that this is no logner possible due to the fact that MS-Word strips all CusotmXML elements from the document structure. Every single paragraph or a table has an ID that I would like to "pair back" to my data-source. So later when I read the docx again I can identify origins of every unchanged paragraph/table in

OpenXml create word document and download

走远了吗. 提交于 2019-12-22 08:26:46
问题 I'm just starting to explore OpenXml and I'm trying to create a new simple word document and then download the file Here's my code [HttpPost] public ActionResult WordExport() { var stream = new MemoryStream(); WordprocessingDocument doc = WordprocessingDocument.Create(stream, DocumentFormat.OpenXml.WordprocessingDocumentType.Document, true); MainDocumentPart mainPart = doc.AddMainDocumentPart(); new Document(new Body()).Save(mainPart); Body body = mainPart.Document.Body; body.Append(new

Save PowerPoint 2007 as PowerPoint 2003 using Open Office SDK 2.0

左心房为你撑大大i 提交于 2019-12-22 07:08:44
问题 Is there anyway to use the Open Office SDK 2.0 to save a PowerPoint presention that you created using OOXML to a PowerPoint 2003 presentation? I know if you open a 2007 file and click Save As you have the option to save it as a PowerPoint 97 to 2003 document and I didn't know if I could do this grammatically using this SDK. The reason I am asking this question is because I need to give the user the option to save data on a website in either Office 2007 or 2003 format. I much rather just use

How to get all merge fields of word document using open xml sdk

雨燕双飞 提交于 2019-12-22 06:57:17
问题 I am beginner to open xml sdk. I am trying to find out all merge fields of document. But I am not getting the headers and footers merge fields. Can any one suggest a working solution? I am trying some thing like this - foreach (FieldCode field in docGenerated.MainDocumentPart.RootElement.Descendants<FieldCode>()) { String fieldText = field.Text; if (fieldText.StartsWith(" MERGEFIELD")) { Int32 endMerge = fieldText.IndexOf("\\"); Int32 fieldNameLength = fieldText.Length - endMerge; String

OpenXML / EPPlus - Create PivotCache in .Net

﹥>﹥吖頭↗ 提交于 2019-12-22 05:55:13
问题 I'm hoping this could help me, at least, answer one of the 2 questions I asked here, but I am looking how to create a PivotCache in EPPlus / OpenXML and can't find anything online / in their documentation that shows how to do it. So, suposing I have one Excel sheet, wksRawData created in EPPlus and I want to create a second sheet with a pivot table based upon the pivot cache of wksRawData.Cells(wksRawData.Dimension.Address) - In the hopes that then I could delete wksRawData but still keep the

OpenXML / EPPlus - Create PivotCache in .Net

╄→尐↘猪︶ㄣ 提交于 2019-12-22 05:55:04
问题 I'm hoping this could help me, at least, answer one of the 2 questions I asked here, but I am looking how to create a PivotCache in EPPlus / OpenXML and can't find anything online / in their documentation that shows how to do it. So, suposing I have one Excel sheet, wksRawData created in EPPlus and I want to create a second sheet with a pivot table based upon the pivot cache of wksRawData.Cells(wksRawData.Dimension.Address) - In the hopes that then I could delete wksRawData but still keep the

XLSX- how to get rid of the default namespace prefix x:?

我是研究僧i 提交于 2019-12-22 04:39:15
问题 I'm generating XLSX spreadsheet using OOXML SDK, and I need to get rid of x: namespace prefix. How can I achieve this? using (SpreadsheetDocument doc = SpreadsheetDocument.Open("template.xlsx", true)) { //Save the shared string table part if (doc.WorkbookPart.GetPartsOfType().Count() > 0) { SharedStringTablePart shareStringPart = doc.WorkbookPart.GetPartsOfType().First(); shareStringPart.SharedStringTable.Save(); } //Save the workbook doc.WorkbookPart.Workbook.Save(); } Here, the original

Link to Microsoft Open XML SDK tutorials [closed]

时间秒杀一切 提交于 2019-12-22 04:22:20
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . Anyone know any link to a good Microsoft Open XML tutorials? 回答1: This is the official place to learn about Open XML: http://msdn.microsoft.com/en-us/office/bb265236.aspx. You can just skim through all results in msdn.microsoft.com for Open XML SDK 回答2: Here are some other links to get your started: http:/

How can I embed some VBA code into a spreadsheet created using ClosedXML?

自作多情 提交于 2019-12-22 04:13:18
问题 I am using ClosedXML to generate spreadsheets from C# (asp.net-mvc) and it works great. I have one additional requirement so I wanted to get some feedback on how I could achieve this. I want to save as a macro enabled workbook and when I just give it a "xlsm" extension it doesn't seem to open (versus a xlsx). Here is my code: public ActionResult ExportExcel() { MemoryStream stream = nModel.GenerateSS(); return File(stream, @"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet