Programmatic Report Generation - How to Create a Report in Landscape Orientation

2 次查看(过去 30 天)
I am trying to create a report in landscape orientation using the following commands:
import mlreportgen.dom.*;
d = Document('test','pdf');
open(d);
sect = d.CurrentDOCXSection;
pageSize = sect.PageSize;
pageSize.Orientation = 'landscape';
I am not having success with this. Am I doing something wrong?
Thank you.

采纳的回答

Sean de Wolski
Sean de Wolski 2015-3-17
The orientation is set, the page size just isn't changed.
import mlreportgen.dom.*;
d = Document('test','docx');
open(d);
sect = d.CurrentDOCXSection;
pageSize = sect.PageSize;
pageSize.Orientation = 'landscape';
pageSize.Height = '8.5in';
pageSize.Width = '11in';
close(d)
rptview(d.OutputPath)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB Report Generator 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by