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

1 Ansicht (letzte 30 Tage)
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

Akzeptierte Antwort

Kausthub
Kausthub am 1 Sep. 2023
Bearbeitet: Kausthub am 14 Sep. 2023
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 Kommentare
Kausthub
Kausthub am 7 Sep. 2023
Bearbeitet: Kausthub am 7 Sep. 2023
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 am 13 Sep. 2023
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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte


Version

R2016b

Community Treasure Hunt

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

Start Hunting!