How we can append an excel to a Hole

1 回表示 (過去 30 日間)
Sapna Chaudhary
Sapna Chaudhary 2021 年 5 月 14 日
コメント済み: Rahul Singhal 2021 年 5 月 17 日
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 件)

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by