Search Results

Search found 7479 results on 300 pages for 'openxml sdk'.

Page 1/300 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • OpenXML SDK Spreadsheet starter kits

    - by JWendel
    I am trying to start working with excel documents through the OpenXML SDK Spreadsheet API. But I havent found any good guides or even examples on how to create a xlsx file from scratch. Only how to open an existing document and modify it. I have been thinking on having a empty template document and make a copy of it an then begin my proccessing on it. But it doesent feel right. It might be easier but I not comfortable using a technique I dont feel that I understand "pretty" good atleast. So my question is: Anyone has any god tips on articles or books or any other type of resource that explains the API. Thanks in advance. /johan

    Read the article

  • Retrieve the content of Microsoft Word document using OpenXml and C#

    - by ybbest
    One of the tasks involves me to retrieve the contents of Microsoft Word document (word2007 above). I try to search for some resources online with not much luck; most of the examples are for writing contents to word document using OpenXml. I decide to blog this as my reference and hopefully people who read this post will find it useful as well. To retrieve the contents of Microsoft Word document using XML is extremely simple. 1. Firstly, you need to download and install the Open XML SDK 2.0 for Microsoft Office. (Download link) 2. Create a Console application then add the DocumentFormat.OpenXml.dll and WindowsBase.dll to the project, you can find these dlls in the .NET tab of the Add Reference window. 3. Write the following code to grab the contents from the word document and display it on the console window. You can download the complete source code here. References: Getting Started with the Open XML SDK 2.0 for Microsoft Office Walkthrough: Word 2007 XML Format Word Processing How To Open XML SDK 2.0 for Microsoft Office Office Developer Center openxmldeveloper Open XML Package Explorer

    Read the article

  • OpenXML SDK: Make Excel recalculate formula

    - by chiccodoro
    I update some cells of an Excel spreadsheet through the Microsoft Office OpenXML SDK 2.0. Changing the values makes all cells containing formula that depend on the changed cells invalid. However, due to the cached values Excel does not recalculate the formular, even if the user clicks on "Calculate now". What is the best way to invalidate all dependent cells of the whole workbook through the SDK? So far, I've found the following code snippet at http://cdonner.com/introduction-to-microsofts-open-xml-format-sdk-20-with-a-focus-on-excel-documents.htm: public static void ClearAllValuesInSheet (SpreadsheetDocument spreadSheet, string sheetName) { WorksheetPart worksheetPart = GetWorksheetPartByName(spreadSheet, sheetName); foreach (Row row in worksheetPart.Worksheet. GetFirstChild().Elements()) { foreach (Cell cell in row.Elements()) { if (cell.CellFormula != null && cell.CellValue != null) { cell.CellValue.Remove(); } } } worksheetPart.Worksheet.Save(); } Besides the fact that this snippet does not compile for me, it has two limitations: It only invalidates a single sheet, although other sheets might contain dependent formula It does not take into account any dependencies. I am looking for a way that is efficient (in particular, only invalidates cells that depend on a certain cell's value), and takes all sheets into account. Update: In the meantime I have managed to make the code compile & run, and to remove the cached values on all sheets of the workbook. (See answers.) Still I am interested in better/alternative solutions, in particular how to only delete cached values of the cells that actually depend on the updated cell.

    Read the article

  • Create page break using OpenXml

    - by arek
    I use OpenXml to create Word document with simple text and some tables under this text. How can I force Paragraph with this text to show always on new page? Maybe this paragraph should be some Header but I'm not sure how to do this. Thanks

    Read the article

  • Associating Worksheets with their Names using OpenXML SDK 1.0

    - by John Price
    I'm using version 1.0 of Microsoft's OpenXML SDK to do some basic parsing of .xlsx files. I can get and parse the worksheets, and I can get a list of worksheet names, but I cannot for the life of me figure out how to link up what name goes with what worksheet. I understand that an element like <sheet name="My Sheet" sheetId="1" r:id="rId1"/> in the workbook is linked up to a specific worksheet via the relationships defined in xl/_rels.xml, but I can't see where any of the relationship info is exposed in the API. I'm using C#, but any VB.NET examples would be just as helpful. I feel like this should be dead simple, but I can't figure it out. It also looks like it may be more straightforward in v2.0 of the SDK, but upgrading isn't an option at the moment.

    Read the article

  • OpenXML sdk Modify a sheet in my Excel document

    - by user465202
    hi! I create an empty template in excel. I would like to open the template and edit the document but I do not know how to change the existing sheet. That's the code: using (SpreadsheetDocument xl = SpreadsheetDocument.Open(filename, true)) { WorkbookPart wbp = xl.WorkbookPart; WorkbookPart workbook = xl.WorkbookPart; // Get the worksheet with the required name. // To be used to match the ID for the required sheet data // because the Sheet class and the SheetData class aren't // linked to each other directly. Sheet s = null; if (wbp.Workbook.Sheets.Elements().Count(nm = nm.Name == sheetName) == 0) { // no such sheet with that name xl.Close(); return; } else { s = (Sheet)wbp.Workbook.Sheets.Elements().Where(nm = nm.Name == sheetName).First(); } WorksheetPart wsp = (WorksheetPart)xl.WorkbookPart.GetPartById(s.Id.Value); Worksheet worksheet = new Worksheet(); SheetData sd = new SheetData(); //SheetData sd = (SheetData)wsp.Worksheet.GetFirstChild(); Stylesheet styleSheet = workbook.WorkbookStylesPart.Stylesheet; //SheetData sheetData = new SheetData(); //build the formatted header style UInt32Value headerFontIndex = util.CreateFont( styleSheet, "Arial", 10, true, System.Drawing.Color.Red); //build the formatted date style UInt32Value dateFontIndex = util.CreateFont( styleSheet, "Arial", 8, true, System.Drawing.Color.Black); //set the background color style UInt32Value headerFillIndex = util.CreateFill( styleSheet, System.Drawing.Color.Black); //create the cell style by combining font/background UInt32Value headerStyleIndex = util.CreateCellFormat( styleSheet, headerFontIndex, headerFillIndex, null); /* * Create a set of basic cell styles for specific formats... * If you are controlling your table then you can simply create the styles you need, * this set of code is still intended to be generic. */ _numberStyleId = util.CreateCellFormat(styleSheet, null, null, UInt32Value.FromUInt32(3)); _doubleStyleId = util.CreateCellFormat(styleSheet, null, null, UInt32Value.FromUInt32(4)); _dateStyleId = util.CreateCellFormat(styleSheet, null, null, UInt32Value.FromUInt32(14)); _textStyleId = util.CreateCellFormat(styleSheet, headerFontIndex, headerFillIndex, null); _percentageStyleId = util.CreateCellFormat(styleSheet, null, null, UInt32Value.FromUInt32(9)); util.AddNumber(xl, sheetName, (UInt32)3, "E", "27", _numberStyleId); util.AddNumber(xl, sheetName, (UInt32)3, "F", "3.6", _doubleStyleId); util.AddNumber(xl, sheetName, (UInt32)5, "L", "5", _percentageStyleId); util.AddText(xl, sheetName, (UInt32)5, "M", "Dario", _textStyleId); util.AddDate(xl, sheetName, (UInt32)3, "J", DateTime.Now, _dateStyleId); util.AddImage(xl, sheetName, imagePath, "Smile", "Smile", 30, 30); util.MergeCells(xl, sheetName, "D12", "F12"); //util.DeleteValueCell(spreadsheet, sheetName, "F", (UInt32)8); txtCellText.Text = util.GetCellValue(xl, sheetName, (UInt32)5, "M"); double number = util.GetCellDoubleValue(xl, sheetName, (UInt32)3, "E"); double numberD = util.GetCellDoubleValue(xl, sheetName, (UInt32)3, "F"); DateTime datee = util.GetCellDateTimeValue(xl, sheetName, (UInt32)3, "J"); //txtDoubleCell.Text = util.GetCellValue(spreadsheet, sheetName, (UInt32)3, "P"); txtPercentualeCell.Text = util.GetCellValue(xl, sheetName, (UInt32)5, "L"); string date = util.GetCellValue(xl, sheetName, (UInt32)3, "J"); double dateD = Convert.ToDouble(date); DateTime dateTime = DateTime.FromOADate(dateD); txtDateCell.Text = dateTime.ToShortDateString(); //worksheet.Append(sd); /* Columns columns = new Columns(); columns.Append(util.CreateColumnData(10, 10, 40)); worksheet.Append(columns); */ SheetProtection sheetProtection1 = new SheetProtection() { Sheet = true, Objects = true, Scenarios = true, SelectLockedCells = true, SelectUnlockedCells = true }; worksheet.Append(sheetProtection1); wsp.Worksheet = worksheet; wsp.Worksheet.Save(); xl.WorkbookPart.Workbook.Save(); xl.Close(); thanks!

    Read the article

  • jenkins-maven-android when running throwing the error "android-sdk-linux/platforms" is not a directory"

    - by Sam
    I start setting up the jenkins-maven-android and i'm facing an issue when running the jenkin job. My Machine Details $uname -a Linux development2 3.0.0-12-virtual #20-Ubuntu SMP Fri Oct 7 18:19:02 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux Steps to install the Android SDK in Ubuntu https://help.ubuntu.com/community/AndroidSDK since i'm working on headless env (ssh to client machine) i used following command to install the platform tools android update sdk --no-ui download apache maven and install on http://maven.apache.org/download.html mvn -version output root@development2:/opt/android-sdk-linux/tools# mvn -version Apache Maven 3.0.4 (r1232337; 2012-01-17 08:44:56+0000) Maven home: /opt/apache-maven-3.0.4 Java version: 1.6.0_24, vendor: Sun Microsystems Inc. Java home: /usr/lib/jvm/java-6-openjdk/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "3.0.0-12-virtual", arch: "amd64", family: "unix" root@development2:/opt/android-sdk-linux/tools# ran the following two command as mention in below sudo apt-get update sudo apt-get install ia32-libs Problems with Eclipse and Android SDK http://developer.android.com/sdk/installing/index.html As error suggest i gave the path to android SDK in jenkins build config still im getting the error clean install -Dandroid.sdk.path=/opt/android-sdk-linux Can someone help me to resolve this. Thanks Error I'm Getting Waiting for Jenkins to finish collecting data mavenExecutionResult exceptions not empty message : Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.1.1:generate-sources (default-generate-sources) on project base-template: Execution default-generate-sources of goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.1.1:generate-sources failed: Path "/opt/android-sdk-linux/platforms" is not a directory. Please provide a proper Android SDK directory path as configuration parameter <sdk><path>...</path></sdk> in the plugin <configuration/>. As an alternative, you may add the parameter to commandline: -Dandroid.sdk.path=... or set environment variable ANDROID_HOME. cause : Execution default-generate-sources of goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.1.1:generate-sources failed: Path "/opt/android-sdk-linux/platforms" is not a directory. Please provide a proper Android SDK directory path as configuration parameter <sdk><path>...</path></sdk> in the plugin <configuration/>. As an alternative, you may add the parameter to commandline: -Dandroid.sdk.path=... or set environment variable ANDROID_HOME. Stack trace : org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.1.1:generate-sources (default-generate-sources) on project base-template: Execution default-generate-sources of goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.1.1:generate-sources failed: Path "/opt/android-sdk-linux/platforms" is not a directory. Please provide a proper Android SDK directory path as configuration parameter <sdk><path>...</path></sdk> in the plugin <configuration/>. As an alternative, you may add the parameter to commandline: -Dandroid.sdk.path=... or set environment variable ANDROID_HOME. at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239) at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158) at hudson.maven.Maven3Builder.call(Maven3Builder.java:98) at hudson.maven.Maven3Builder.call(Maven3Builder.java:64) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:679) Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-generate-sources of goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.1.1:generate-sources failed: Path "/opt/android-sdk-linux/platforms" is not a directory. Please provide a proper Android SDK directory path as configuration parameter <sdk><path>...</path></sdk> in the plugin <configuration/>. As an alternative, you may add the parameter to commandline: -Dandroid.sdk.path=... or set environment variable ANDROID_HOME. at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) ... 27 more Caused by: com.jayway.maven.plugins.android.InvalidSdkException: Path "/opt/android-sdk-linux/platforms" is not a directory. Please provide a proper Android SDK directory path as configuration parameter <sdk><path>...</path></sdk> in the plugin <configuration/>. As an alternative, you may add the parameter to commandline: -Dandroid.sdk.path=... or set environment variable ANDROID_HOME. at com.jayway.maven.plugins.android.AndroidSdk.assertPathIsDirectory(AndroidSdk.java:125) at com.jayway.maven.plugins.android.AndroidSdk.getPlatformDirectories(AndroidSdk.java:285) at com.jayway.maven.plugins.android.AndroidSdk.findAvailablePlatforms(AndroidSdk.java:260) at com.jayway.maven.plugins.android.AndroidSdk.<init>(AndroidSdk.java:80) at com.jayway.maven.plugins.android.AbstractAndroidMojo.getAndroidSdk(AbstractAndroidMojo.java:844) at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:329) at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.execute(GenerateSourcesMojo.java:102) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) ... 28 more channel stopped Finished: FAILURE* android home Echo root@development2:~# echo $ANDROID_HOME /opt/android-sdk-linux

    Read the article

  • How does one get UI_USER_INTERFACE_IDIOM() to work with iPhone OS SDK < 3.2

    - by drootang
    Apple advises using the following code to detect whether running on an iPad or iPhone/iPod Touch: if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { // The device is an iPad running iPhone 3.2 or later. // [for example, load appropriate iPad nib file] } else { // The device is an iPhone or iPod touch. // [for example, load appropriate iPhone nib file] } The problem is that UI_USER_INTERFACE_IDIOM() and UIUserInterfaceIdiomPad are NOT defined in the SDKs priory to 3.2. This seems to completely defeat the purpose of such a function. They can only be compiled and run on iPhone OS 3.2 (iPhone OS 3.2 can only be run on iPad). So if you can use UI_USER_INTERFACE_IDIOM(), the result will always be to indicate an iPad. If you include this code and target OS 3.1.3 (the most recent iPhone/iPod Touch OS) in order to test your iPhone-bound universal app code, you will get compiler errors since the symbols are not defined in 3.1.3 or earlier. If this is the recommended-by-Apple approach to runtime device-detection, what am I doing wrong? Has anyone succeeded using this approach to device-detection?

    Read the article

  • UI_USER_INTERFACE_IDIOM() does not work with iPhone OS SDK < 3.2

    - by drootang
    Apple advises using the following code to detect whether running on an iPad or iPhone/iPod Touch: if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { // The device is an iPad running iPhone 3.2 or later. // [for example, load appropriate iPad nib file] } else { // The device is an iPhone or iPod touch. // [for example, load appropriate iPhone nib file] } The problem is that UI_USER_INTERFACE_IDIOM() and UIUserInterfaceIdiomPad are NOT defined in the SDKs priory to 3.2. This seems to completely defeat the purpose of such a function. They can only be compiled and run on iPhone OS 3.2 (iPhone OS 3.2 can only be run on iPad). So if you can use UI_USER_INTERFACE_IDIOM(), the result will always be to indicate an iPad. If you include this code and target OS 3.1.3 (the most recent iPhone/iPod Touch OS) in order to test your iPhone-bound universal app code, you will get compiler errors since the symbols are not defined in 3.1.3 or earlier. If this is the recommended-by-Apple approach to runtime device-detection, what am I doing wrong? Has anyone succeeded using this approach to device-detection?

    Read the article

  • iPhone SDK 3/4 App will not run on a iPhone 2.x device even with deployment target set to 2.0!

    - by MarqueIV
    Ok... I know about the difference between the base/active SDKs and the deployment target. I have my base SDK set at 4.0 and the deployment target set at 2.0. I am not using any APIs post 2.x, conditional or otherwise. Since I can't debug on a 2.x device, after building it, I use the iPhone Configuration Utility to install the app on the device, which it does just fine. Problem is, it doesn't run! I just get a blank screen. The main window never comes up! Now before you ask... I had this same problem with the iPhone SDK 3.x. I upgraded to the 4.x hoping it would be solved. It wasn't. Yes the provisioning profile is installed. (Couldn't install the app if it wasn't.) This same compiled app works fine on 3.x devices. Same with 4.x devices. Just not 2.x devices. Again, no I am not using any post-2.x SDKs. To prove this I created a brand-new, window-based app from the 'New Project' dialog and the only changes I made was the background color of the window (to prove the XIB loaded) and I set the deployment target to 2.0 (It's still compiled against the 4.x SDK though.) Again, it runs fine on 3.x or 4.x devices, but just a black, blank screen on 2.x devices. I've tried this on three separate 2.x devices included one freshly restored. I've used three separate dev machines (MacBook Pro with the 3.x SDK, MacBook Pro with the 4.x SDK and a Mac Pro with the 3.x SDK.) Same result every time. I am stumped. The fact that even an unmodified project doesn't run really has me confused. Could it be the XIB file? Did they change the format from 2.x to something newer in the 3.x SDK? If so, how do I set it back to 2.x. (Again, this is just a complete guess.) But I'm really stumped! Mark

    Read the article

  • Add Hyperlink to Cell in Excel 2007 Using Open XML SDK 2.0

    - by amurra
    I can't seem to find any documentation or code samples on how to add a hyperlink to a cell in Excel 2007 using the open xml sdk 2.0. I am using the following code, but is there a step I am missing? WorksheetPart workSheetPart = ExcelUtilities.GetWorkSheetPart(mWorkBookPart, "Program"); workSheetPart.AddHyperlinkRelationship(new Uri("http://www.google.com", UriKind.Absolute), true); workSheetPart.Worksheet.Save(); mWorkBookPart.Workbook.Save(); Then when I try and open the Excel document it says the file is corrupted because the relationship Id for the hyperlink cannot be found. How do you setup or create that relationship Id?

    Read the article

  • Development: SDK for Social Net

    - by loldop
    I have a task: development sdk for social networking service like facebook, twitter and etc. At now i'm developing facebook-extension-sdk which based on facebook-ios-sdk 3.0. But not all social networking services have good sdks. And all time i improved my facebook-extension-sdk, when i see ugly code :( Please, advise me good techniques to development these sdks (like design-patterns or your own experience or good books/sites). Thanks!

    Read the article

  • OpenXML - using Excel sheet as template vs. a "real" Excel template

    - by marc_s
    Does anyone have any good answer what kind of difference there is between using some arbitrary pre-formatted Excel 2007 *.xlsx file as a template, loading it in my C# app, and filling up some of its cells with data using the Microsoft OpenXML SDK versus creating specific Excel templates (*.xltx) files and using those as basis for my "data filling" exercise Do I loose something when I don't use the Excel templates (*.xltx)? If so - what do I loose?

    Read the article

  • Problem with pre-beta sdk - even after reinstalling SDK 3.2

    - by Anders Brenna
    I'm trying to upload the binary for a new app, but always get this errormessage: "The binary you uploaded was invalid. A pre-release beta version of the SDK was used to build the application." I know several people have asked a similar question, but I've tried all suggestions from the answers there without success. I used the XCode 4.0 beta 3 during development, and I've tried using it to compile for earlier releases (3.0, 3.1.3, 3.2 etc...) I've also tried downgrading to SDK 3.2, as well as removing 4.0 beta 3 and then installing SDK 3.2 as a fresh install. It seems to me that there might be some parameter in the "Edit Project Settings" that is sticking from the use of 4.0 beta 3, but I've tried to identify them without success. My last option seem to be a complete reinstall of both OS and SDK. Is there something else I might try first?

    Read the article

  • What is inside Windows SDK?

    - by AKN
    For developing programs for windows, we need windows SDK. I understand that this SDK is what helps to create windows and handle window events and all that. I suppose it also enables us to manipulate with files and registries. (Does the same SDK is the reason for thread creation and handling?) All that is fine! I would like to know what are the files and libraries that come as a part of this SDK. Also does it come when I install the OS or when I install editors like Visual studio? Sometimes I see links to windows SDK separately as such. Is it same as the one that I get when installing Visual Studio or has something more than that.

    Read the article

  • iPhone SDK 3.2 beta and iPhone SDK 3.1.2

    - by pratik
    Hello, Currently I am using iPhone SDK 3.1.2 for developing iPhone apps. Apple has recently released iPhone SDK 3.2 beta and I want to try my hands with it. But my problem is that I want to use both versions of SDKs, 3.1.2 since I am currently developing apps and uploading on app store, 3.2 beta to start trying the new version (but Apple will not accept apps on App Store, if developed using 3.2 beta) Please guide me. Regards, Pratik

    Read the article

  • how to connect facebook sdk with cocos2d

    - by iPhone Fun
    hi all, As we all know face book is providing SDK to add face book in our applications. In simple applications it's easy to add such sdk as all things are known, but how to add face book sdk in cocos2d applications. I am new to this thing, so if any one can help me out , how to add face book adk with cocos2d?? I've done the same in simple applications, but I am not able to work with cocos2d. Thanks in advance.

    Read the article

  • Open XML SDK 2.0 - Split table to new power point slide when content flows off current slide

    - by amurra
    I have a bunch of data that I need to export from a website to a power point presentation and have been using Open XML SDK 2.0 to perform this task. I have a power point 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, move that new content into the next slide. I have read Bryan and Jones blog on adding repeating data to a power point slide, but my scenario is a little different. They use the following code: A.Table tbl = current.Slide.Descendants<A.Table>().First(); A.TableRow tr = new A.TableRow(); tr.Height = heightInEmu; tr.Append(CreateDrawingCell(imageRel + imageRelId)); tr.Append(CreateTextCell(category)); tr.Append(CreateTextCell(subcategory)); tr.Append(CreateTextCell(model)); tr.Append(CreateTextCell(price.ToString())); tbl.Append(tr); imageRelId++; This won't work for me since they know what height to set the table row to since it will be the height of the image, but when adding in different amounts of text I do not know the height ahead of time so I just set tr.Heightto a default value. Here is my attempt at figuring at the table height: A.Table tbl = tableSlide.Slide.Descendants<A.Table>().First(); A.TableRow tr = new A.TableRow(); tr.Height = 370840L; tr.Append(PowerPointUtilities.CreateTextCell("This"); tr.Append(PowerPointUtilities.CreateTextCell("is")); tr.Append(PowerPointUtilities.CreateTextCell("a")); tr.Append(PowerPointUtilities.CreateTextCell("test")); tr.Append(PowerPointUtilities.CreateTextCell("Test")); tbl.Append(tr); tableSlide.Slide.Save(); long tableHeight = PowerPointUtilities.TableHeight(tbl); Here are the helper methods: public static A.TableCell CreateTextCell(string text) { A.TableCell tableCell = new A.TableCell( new A.TextBody(new A.BodyProperties(), new A.Paragraph(new A.Run(new A.Text(text)))), new A.TableCellProperties()); return tableCell; } public static Int64Value TableHeight(A.Table table) { long height = 0; foreach (var row in table.Descendants<A.TableRow>() .Where(h => h.Height.HasValue)) { height += row.Height.Value; } return height; } This correctly adds the new table row to the existing table, but when I try and get the height of the table, it returns the original height and not the new height. The new height meaning the default height I initially set and not the height after a large amount of text has been inserted. It seems the height only gets readjusted when it is opened in power point. I have also tried accessing the height of the largest table cell in the row, but can't seem to find the right property to perform that task. My question is how do you determine the height of a dynamically added table row since it doesn't seem to update the height of the row until it is opened in power point? Any other ways to determine when to split content to another slide while using Open XML SDK 2.0? I'm open to any suggestion on a better approach someone might have taken since there isn't much documentation on this subject.

    Read the article

  • Replace image in word doc using OpenXML

    - by fearofawhackplanet
    Following on from my last question here OpenXML looks like it probably does exactly what I want, but the documentation is terrible. An hour of googling hasn't got me any closer to figuring out what I need to do. I have a word document. I want to add an image to that word document (using word) in such a way that I can then open the document in OpenXML and replace that image. Should be simple enough, yes? I'm assuming I should be able to give my image 'placeholder' an id of some sort and then use GetPartById to locate the image and replace it. Would this be the correct method? What is this Id? How do you add it using Word? Every example I can find which does anything remotely similar starts by building the whole word document from scratch in ML, which really isn't a lot of use. EDIT: it occured to me that it would be easier to just replace the image in the media folder with the new image, but again can't find any indication of how to do this.

    Read the article

  • Opening Dot File with OpenXML

    - by OpenXML123
    Hi, I need to work on opening a DOT (word document template) file, replace the fillers and save it as Document file. On opening DOT file I am getting "Document File is Corrupted". Is it possible to work with DOT file using OpenXML.

    Read the article

  • Replace merge fields with text with OpenXML SDK 2.0

    - by uggwar
    What is the best way to remove all merge fields from a word 2010 document using openxml sdk 2.0, and replace them with a simple text? I have some difficulties to remove them cleanly. Have tried to remove all Run objects that includes a FieldCode with a "MERGEFIELD" defined, and appended a new Run with my text. But I am missing something crucial since the field seems to stay defined for this element.

    Read the article

  • uiview animation used to work on iphone sdk 2.2 and now it doesn't on sdk 3.0

    - by nico
    hello! I have an animation block that worked fine when runnung the app on iphone OS 2.2. Now I compile the same code for iphone OS 3.0 and it doesn't work. UIViewAnimationTransition trans = UIViewAnimationTransitionFlipFromLeft; [UIView beginAnimations: nil context: NULL]; UIView *forview = [[self view] superview]; [UIView setAnimationTransition: trans forView:forview cache: YES]; [UIView setAnimationDuration:1.0]; [[self navigationController] popViewControllerAnimated:NO]; [UIView commitAnimations]; What the code does, it uses the navigation controller to change the top most view, but with the flip transition and not with the built in one. any ideas on what might have change in the sdk or what I'm doing wrong? thanks!!

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >