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

1 view (last 30 days)
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.

Accepted Answer

Sean de Wolski
Sean de Wolski on 17 Mar 2015
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)

More Answers (0)

Categories

Find more on MATLAB Report Generator in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!