Adding tables from spreadsheets
Home › Forums › WordprocessingML › Adding tables from spreadsheets
Tagged: tables graphics
- This topic has 4 replies, 2 voices, and was last updated 10 years ago by
riaan_badenhorst@hotmail.com.
-
AuthorPosts
-
April 7, 2016 at 11:52 pm #3329
Eric White
KeymasterHi,
I am currently working on (in the background) a conversion of SpreadsheetML to HTML/CSS. One idea here is that you can generate the HTML/CSS for a table or region in a spreadsheet, and then create a DOCX using the HtmlToWmlConverter module. You can then integrate this DOCX into other DOCX using DocumentBuilder.
However, I am only half done with this module – I have coded the SmlDataRetriever, which retrieves the data along with relevant formatting information. One thing that this module does, which will be super important to you, is that it puts together the display value. In other words, it converts from the raw data in the XLSX to the value that you see when looking at the spreadsheet using Excel (the value you retrieve when getting the value using VBA).
It is actually not a huge job remaining to create the HTML/CSS from the data that SmlDataRetriever returns, but I haven’t had the time.
You very well may want to take the same approach – use SmlDataRetriver to get the data, and then generate HTML/CSS from that data, and then generate the DOCX markup using HtmlToWmlConverter. (If you want to contribute this code to Open-Xml-PowerTools, I would be happy!)
But in any case, SmlDataRetriever is what you want to use.
-Eric
April 10, 2016 at 6:43 pm #3344riaan_badenhorst@hotmail.com
ParticipantHi Eric,
Thanks for the reply. I’ve just started to work with C# (or programming actually) so I’ll be honest and say, having looked at your XMLPowerTools, it’s still a bit “next level” for me. For the moment I’m happy to have taught myself enough C# to extract what I need from an SQL database with linq.
Having said that, I learn fairly quickly (with some guidance) so maybe some day in the future I can contribute something useful.
I’ll see if I can figure anything out!
Have a nice day.
-
This reply was modified 10 years ago by
riaan_badenhorst@hotmail.com.
April 11, 2016 at 12:06 am #3346Eric White
KeymasterTake a look at SmlDataRetriever – you don’t need to be able to code it, just use it. 🙂
Its use is pretty easy. Look at the SmlDataRetriever01 example to see it in action.
April 11, 2016 at 9:10 am #3347riaan_badenhorst@hotmail.com
ParticipantThanks Eric, I had not seen the latest updates. Download it and will give it a try.
Thanks a lot!
-
This reply was modified 10 years ago by
-
AuthorPosts
- You must be logged in to reply to this topic.