Using the import mlreportgen.dom.* the report is OK with rpt.CurrentPageLayout.PageMargins. However, the margin changed by itself on second page (the content flows to the sedond page as it's going). Repeating the definition with margins did not correct it.
What's wrong did I do?

댓글 수: 4

Rhea Chandy
Rhea Chandy 2020년 9월 28일
Hi John, It appears that you asking how to keep the same pageMargins even when the content cannot fit entirely on one page.
I am trying to recreate the issue, please help me by providing your MATLAB release details.
John
John 2020년 9월 28일
Hi, Rhea:
It's R2019b. And the effect is shown below.
Thanks.
John
John 2020년 9월 28일
John
John 2020년 9월 28일
As the content goes to the third page, the margin comes back to the same as the first page.
So, it looks like the report genrator automatically used the "book margin" to alternate the left side margin.
Now the question becomes: How to disable the "book margin" for the report generator, import mlreportgen.dom.* ?
Thanks for help!

댓글을 달려면 로그인하십시오.

 채택된 답변

Rhea Chandy
Rhea Chandy 2020년 9월 29일

1 개 추천

The class PageMarginsObj = PageMargins() will specify default page margins for the section of the document.
In the file I’ve attached, I’ve implemented a code with dummy text that spills over to a second page.
In this case, it is following expected behavior, adhering to the set PageMargins.

댓글 수: 1

John
John 2020년 9월 29일
Hi, Rhea:
Thanks.
I found my mistake. I copied an example which had a "PageMargins.Gutter" included. Comment out it, the page margin becomes equal on all pages.
Also, can you please help me on making the table on the same page, which is more important topic for our report project:

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

질문:

2020년 9월 25일

댓글:

2020년 9월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by