필터 지우기
필터 지우기

Word Report generator Tableau Empecher une ligne de tablerau de se mettre sur 2 pages

조회 수: 1 (최근 30일)
bonjour
J'exporte des données matlab vers des tableaux word avec le report generator.
Parfois une ligne s"'imprime sur 2 pages. Je voudrait empêcher cela enforcanbt la nouvelle ligne du tableau à s"'imprimer surla pas suivante.
J'ai vu qu'il faut utiliser l'objet AllowBreakAcrossPages(tf) avec tf= false
mais je n'arrive pas à comprendre comment utiliser cette commande ou cet objet.
est ce qu'il faut l'associer au tableau oiu à chaque ligne et comment ?. (dans Style?)
il me faudrait un exemple de mise en oeuvre de cet objet sur un tableau
Merci

채택된 답변

Kausthub
Kausthub 2023년 9월 1일
편집: Kausthub 2023년 9월 14일
Hi Daniel Monterrain,
I understand that when the table overflows, you would like it in the next page rather than the next line and you need guidance on how to use the AllowBreakAcrossPages() class.
You can refer to the example in the MATLAB command-line help for this class:
>> help mlreportgen.dom.AllowBreakAcrossPages
Yes, you are right about using the AllowBreakAcrossPages(), it should be used with “style” and should be associated to a row.
For example:
table.row(6).Style = {AllowBreakAcrossPages(false)};
Here is the documentation to the AllowBreakAcrossPages():
Hope it helps!
  댓글 수: 3
Kausthub
Kausthub 2023년 9월 7일
편집: Kausthub 2023년 9월 7일
I have attached a working example and the corresponding output pictures and you could manipulate it as per your needs.
Please run the testPageBreak.m file and try commenting and uncommenting line 31 in the example to see the difference.
table.row(3).Style = {AllowBreakAcrossPages(false)};
Hope this helps!
Daniel MONTERRAIN
Daniel MONTERRAIN 2023년 9월 13일
Thank you very much for this example. It works perfectly and, using it, I was abble to solve the difficulty on my project.
it is not clear the reason why it operates with your approach and not with my older tests. It seems that the property "AllowbreakAccrossPages(false) must be applied on each row and after the append (dataTable, Row) like above:
append(dataTable, Row1);
dataTable.row(1).Style=[dataTable.row(1).Style,{AllowBreakAcrossPages(false)},{BackgroundColor('silver')},{RowSep('solid')}];
my previous error was to put the property to the row before to do append(dataTable, Row1);
I do not understand the reason of that.
Your example gives the somlution. thank you.

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

추가 답변 (0개)

제품


릴리스

R2016b

Community Treasure Hunt

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

Start Hunting!