alonrbar/easy-template-x

Is it possible to embed one or more spreadsheets?

Closed this issue · 5 comments

I'd like to insert spreadsheets, but not sure how it's possible?
I'm guessing maybe with rawXML, but I can't figure out how to start..

In Libreoffice Writer it can be done manually by choosing Insert > Object > Ole Object > Create new LibreOffice 7 Spreadsheet.
I suppose it's similar in Microsoft Word.

I've attached an example docx for reference.

image
embedded_spreadsheet_example.docx

From the top of my head I believe you'd need to write a new plugin for that. I'm assuming you'd need to add the embedded Excel file to the zip bundle and then add some xml markup to reference it. Two good places to start would be to have a look at the existing Image plugin and to extract as zip the docx file you've attached and inspect it's content.

Thanks @alonrbar, that's exactly what I did :)
Got a very crude version working on this fork: https://github.com/bitfabrikken/easy-template-x

Cool, if you ever want to feel free to send a pull request with the plugin :)

Cool, if you ever want to feel free to send a pull request with the plugin :)

I definitely will if/when it turns out I need it for my project.
Will have to figure out how to inherit the font styling and size from the tag in the docx.

How's it work for a pull request, should I do it on this main project or make a seperate plugin like you've done with easy-template-x-angular-expressions?

Up to you actually. For easy-template-x-angular-expressions (I really should have chosen a shorter name for this package :) I preferred a separate repo because it wasn't something I see as core capability of this library and since it adds an extra dependency that most users of the library won't use. The embedded content plugin on the other hand seems useful and I don't believe it requires any additional dependency. But I can always just add a link to your package in the readme so any way you choose is perfectly good.