openxml

Printing OpenXml Documents in C#

蓝咒 提交于 2019-12-12 04:24:33
问题 I have searched for this but cant find anything to help. I have a WordprocessingDocument - using DocumentFormat.OpenXml.Wordprocessing. Is there a way to print this straight off to a printer, I dont want to save it at all? Thanks 回答1: No, you'll need some sort of program to take the Open XML and translate into how it should be displayed for the printer. In its raw form its just XML and without the translation the printer won't print it how you would expect. 来源: https://stackoverflow.com

Creating Word file from ObservableCollection with C#

萝らか妹 提交于 2019-12-12 04:17:55
问题 I have an observable collection with a class that has 2 string properties: Word and Translation. I want to create a word file in format: word = translation word = translation word = translation word = translation... The word document needs to be in 2 Columns (PageLayout) and the Word should be in bold. I have first tried Microsoft.Office.Interop.Word. PageSetup.TextColumns.SetCount(2) sets the PageLayout. As for the text itself I used a foreach loop and in each iteration I did this: paragraph

Embedding Pdf with OpenXml in PowerPoint fails for newer versions

情到浓时终转凉″ 提交于 2019-12-12 04:05:05
问题 I need to progammatically embed Pdf documents in PowerPoint via OpenXml. According to this: Embedding files into Open XML documents using C# it is possible via OLE32.StgCreateStorageEx methods to create the necessary picture as well as the oleobject. Unfortunately this doesn't work with current versions of PDF. On a 64 bit OS, this seems to work only with Abobe version 9.Higher version fails with error code 0x8000FFFF which translates to Catastrophic failure. This is actual true after testing

.NetCore 1.0 RC2 OpenXML Support

做~自己de王妃 提交于 2019-12-12 03:37:48
问题 Can't find any appropriate package for working with Excel in my .NetCore 1.0 RC 2 Package DocumentFormat.OpenXml 2.5.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package DocumentFormat.OpenXml 2.5.0 supports: net (.NETFramework,Version=v0.0) One or more packages are incompatible with .NETCoreApp,Version=v1.0. I am realy stuck with it. Search on the topic returned no results. 回答1: Currently Open XML libraries are not support for ASP.NET Core Syncfusion File Format

EPPlus throws DataValidations exception “Requested value 'date' was not found.” when trying to save xlsm

不问归期 提交于 2019-12-12 03:18:46
问题 I'm attempting to make changes to a customer-supplied .xlsm file (a C# application will fill with data from a web-form and submit to a CMS) using EPPlus. But on package.Save(name) -- or packagae.SaveAs(name) -- an exception is thrown by the DataValidations collection: 2011-11-28 14:17:51,380 [9] ERROR app.ExcelConverter - System.ArgumentException: Requested value 'date' was not found. at System.Enum.EnumResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object

Reading a large Excel file by OpenXML

谁都会走 提交于 2019-12-12 02:57:12
问题 I am working on a project in which i am reading few cells from an excel file using OpenXML SDK in VB.Net and storing it in DataTable. It works just fine for the medium sized and small files however when when i try to open a large file of size 107MB, i get an OutOfMemory exception after reading through few sheets. I am able to open the file by double clicking(it takes a while though) Below are the code that i am using. Please let me know if i can improve the process of reading by reducing the

How to UnProtect Sheet using OpenXML code?

风流意气都作罢 提交于 2019-12-12 02:55:56
问题 I have created one Sheet, which i could protect using OpenXml code. But now there is requirement to read this excel file. I am getting all the values as NULL because it is protected. ( I haven't placed any password yet in the code to protect the sheet, there is only one sheet in the excel file.) I have got below code from my Search to unprotect the worksheet. workSheet.RemoveAllChildren<SheetProtection>(); But, this is not working. I am still getting the null values while reading this

Only one instance of the type is allowed for this parent, but drawing part is null

你。 提交于 2019-12-12 02:35:53
问题 I have this code ImagePartType ipt = ImagePartType.Jpeg; DrawingsPart drawingsPart1; ImagePart imagePart1; WorksheetDrawing worksheetDrawing1; if (sheet1.DrawingsPart == null) { drawingsPart1 = sheet1.AddNewPart<DrawingsPart>(); imagePart1 = drawingsPart1.AddImagePart(ipt, sheet1.GetIdOfPart(drawingsPart1)); worksheetDrawing1 = new WorksheetDrawing(); } but at drawingsPart1 = sheet1.AddNewPart<DrawingsPart>(); it throws an Exception " Only one instance of the type is allowed for this parent"

Apply a TableStyle to a Word Table

拟墨画扇 提交于 2019-12-12 01:48:28
问题 Trying to style a table using a predefined style but nothing is working. I've tried with a a newly created document and one created from a saved template. Using the SDK Productivity tool I can see the style is there in the template but it's not being applied. I've tried appended the style or setting it directly and neither seem to work. public static void CreateWordprocessingDocument(string fileName) { string[,] data = { {"Texas", "TX"}, {"California", "CA"}, {"New York", "NY"}, {

document generation only works the first time

纵饮孤独 提交于 2019-12-12 01:44:26
问题 I'm using openxml in my HTML5 mobile app to generate word documents on the mobile device. In general openxml works fine and straight forward, but I'm struggling with an annyoing problem. The document generation only works the first time after I've started the app. This time I can open and view the document. Restart the app means: - Redeploy from development machine - Removing the app from the task pane (pushing aside; I assume the app is removed then?) The second time I get the message the