openxml

Unable to Query XML file with OPENXML in SQL

我怕爱的太早我们不能终老 提交于 2019-12-24 07:59:26
问题 I am trying to query a good number of XML files using SQL Server 2014. I am using the below code and I am unsure what is wrong with the syntax because nothing is being returned. My suspicion is there is something strange with the XML file. If put in only parts of the XML text directly into the query file instead of pointing to it locally then it seems to work but I have a lot of files and really need to be able to query from a local source without manual manipulation of the files. Example XML

How to delete an inserted OOXML comment using Word JS API?

核能气质少年 提交于 2019-12-24 07:15:01
问题 I am trying to insert comments inside word document using insertOoxml method. The comment gets inserted successfully. I want to delete this manually-inserted comment based on one of the user's actions. For example, when they switch from one feature of my add-in to another. I am trying to delete the comment parts from the Ooxml string using regex match and replace for this to work. Word.run(async(context) => { let body = context.document.body let bodyOOXML = body.getOoxml() await context.sync(

Specify Encoding Format when Export DataTable to Excel with Open Xml SDK in c#

元气小坏坏 提交于 2019-12-24 07:03:10
问题 I am just trying to export datatable as excel using open xml. Referred the below approach, Export DataTable to Excel with Open Xml SDK in c# But I couldn't specify the encoding format of the excel created. I want to save or create the excecl with UTF-Encoding-8 format. Can some one help on how could the formatting specificed using Open XML 回答1: To save an Excel file with UTF-Encoding-8 Format you need to specify the encoding format under Tools -> Web Options -> Encoding while saving the excel

Get height of row where the cells have WrapText set

≯℡__Kan透↙ 提交于 2019-12-24 03:53:37
问题 I am trying to compute the height of the row I'm inserting into my excel sheet. The row's cells are formatted with WrapText=true , so the height of the row is not fixed. Accessing row.Height will return null. I was thinking of using something similar to Graphics.MeasureString where I also specify the width constraint in order to retrieve the height. Didn't find any relevant info online. Any help would be appreciated. 回答1: See my post here using Graphics.MeasureString. It works very well.

How do you create multi-level ordered lists with Open XML in ASP.net?

半腔热情 提交于 2019-12-24 03:48:10
问题 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 learning curve. Creating numbering properties and referencing the correct abstractNumberId and the list goes on and on. Does anyone have a complete example of creating multi-level lists in code? I can do so with no custom settings, as in setting the

Matching one attribute to another using XPath/XQuery in SQL Server 2008

北城余情 提交于 2019-12-23 23:47:11
问题 Consider the XML and SQL: declare @xml xml = ' <root> <person id="11272"> <notes for="107">Some notes!</notes> <item id="107" selected="1" /> </person> <person id="77812"> <notes for="107"></notes> <notes for="119">Hello</notes> <item id="107" selected="0" /> <item id="119" selected="1" /> </person> </root>' select Row.Person.value('data(../@id)', 'int') as person_id, Row.Person.value('data(@id)', 'int') as item_id, Row.Person.value('data(../notes[@for=data(@id)][1])', 'varchar(max)') as

Merge cells in Excel using “Openxml writer”

自闭症网瘾萝莉.ら 提交于 2019-12-23 23:06:04
问题 I want to merge cells is excel. By using DOM approach I can do it easily. But as my excel file is too large, when I tries to get worksheet it throws Out of memory exception. So I have to use SAX approach to read excel file. But I dont know how to merge cells in this approach. Searched a lot but every one gives the solution of DOM approach. Can anyone help, Thanks in advance. 回答1: My solution is: read the whole data from the old sheet by openxmlreader than write into new sheet by openxmlwriter

When does Excel surround sheet names with single quotes in workbook.xml (or other xml) files?

让人想犯罪 __ 提交于 2019-12-23 20:40:39
问题 I have an .xlsx file that opens in Excel. However, if I remove the single quotes around the sheet name (which does not contain spaces) in the defined names field in workbook.xml, Excel repairs the file by removing that defined name. Can anyone tell the criteria when do we have to surround the sheetname with single quotes? The files are present here : https://www.dropbox.com/sh/eziv9jlbpsppw83/AACwurdX_aOhbK4R06FRizd3a?dl=0 00007113-ENGLISH_original.xlsx - Opens in Mac Excel 2011 00007113

C# DocX: Inserting new numbered list continues numbering

倾然丶 夕夏残阳落幕 提交于 2019-12-23 19:08:12
问题 I am trying to insert several numbered lists into a Word document using Novacode DocX. Something like this: var doc = DocX.Create("somedoc.docx"); var list = doc.AddList(listType: ListItemType.Numbered, startNumber: 1); doc.AddListItem(list, "Number 1", 0, listType); doc.AddListItem(list, "Number 2", 0, listType); doc.InsertList(list); doc.InsertParagraph(); //just to get some space between. var secondList= doc.AddList(listType: ListItemType.Numbered, startNumber: 1); doc.AddListItem

Meaning and unit of `x` and `y` in Office Open XML `wrapPolygon`

百般思念 提交于 2019-12-23 16:47:37
问题 Does someone knows what is the meaning and unit of x and y in Office Open XML wrapPolygon ? The documentation states: "Specifies a coordinate on the x-axis. The origin point for this coordinate shall be specified by the parent XML element. ...The possible values for this attribute are defined by the ST_Coordinate simple type (§ 5.1.12.16)." That sounds like it should be describing a polygon starting at x =0 and y =0 in top left point of the picture. And the unit would be EMU . But this cannot