How we can append an excel to a Hole

1 次查看(过去 30 天)
I have created one template in ".dotx" format there are various holes in it and I want to put one excel as an object in that template.
Is it possible to do that, If yes, how we can do that.
  3 个评论
Sapna Chaudhary
Sapna Chaudhary 2021-5-14
The object is excel sheet consisting the data..so, how we can add that excel sheet in the report template.
Image Analyst
Image Analyst 2021-5-14
What is the "one excel" that you want to make into an object and embed into a standard Excel workbook? Is it one of your variables? Is it an activeX connection to an Excel server object?
Let's say the "one excel" is just a standard double matrix. So what kind of "object" do you want to make it? Why don't you simply paste the matrix into Excel with writematrix()?
Since you're not doing that, I'm guessing your "one excel" is not such a simple thing as a double matrix, and the "Object" you want to create from it is also something a lot more complicated. But what are they? We have no idea.
If you have Windows, you can do almost anything with ActiveX that you can do in Excel manually/interactively, but we'd need to know what you want to put into Excel, and we don't know that.

请先登录,再进行评论。

采纳的回答

Rahul Singhal
Rahul Singhal 2021-5-16
Hi Sapna,
You can use moveToNextHole method to programmatically navigate the holes in the template. Here is a simple example: https://www.mathworks.com/help/rptgen/ug/fill-in-the-blanks-in-a-report-form.html
The excel file can be added using the mlreportgen.dom.EmbeddedObject class.
-Rahul
  3 个评论
Sapna Chaudhary
Sapna Chaudhary 2021-5-17
If I use the embedObj = EmbeddedObject('abc.xls','ABC'); It will create a Hyperlink in the report and it is not inserted as object. so, if I share that report to another person that abc.xls will not be accessible to that person...In this case what we can do to insert an excel as an object..
Rahul Singhal
Rahul Singhal 2021-5-17
Hi Sapna,
As you can see in the table in the documentation, only xlsx, pptx, and docx file types can be inserted as object in a Word report, all the other types are inserted as hyperlinks. I suggest you to save your excel file as xlsx instead of xls.
embedObj = EmbeddedObject('abc.xlsx'); % inserts as object
embedObj = EmbeddedObject('abc.xls','ABC'); % inserts as hyperlink
-Rahul

请先登录,再进行评论。

更多回答(0 个)

产品


版本

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by