フィルターのクリア

How to change the position of table in Report Generator?

9 ビュー (過去 30 日間)
Tong Wang
Tong Wang 2018 年 6 月 27 日
コメント済み: Tong Wang 2018 年 6 月 27 日

I set the paper to 'landscape', then i put a table on that, but you can see above the table, there is a big area of blank(red line), i want to move the top of table to green line, how could i do this? I also have the code below.

 import mlreportgen.dom.*
d = Document('formal','pdf');
open(d)
% Set Orientation
s = d.CurrentPageLayout;
s.PageSize.Orientation  ='landscape';
s.PageSize.Height = '8.264in';
s.PageSize.Width = '11.694in';
img = Image(which('b747.jpg'));
img.Style = {ScaleToFit};
table = Table({img, Paragraph('Entry 2')});
table.Border = 'solid';
table.Width = '2in';
table.entry(1,1).Style = {Height('5in'), Width('8in')};
table.entry(1,2).Border = 'solid';
% Add a row
row1 = TableRow;
append(row1, TableEntry('entry 11'));
append(table,row1);
append(d,table);
close(d);
rptview(d.OutputPath);

採用された回答

Rahul Singhal
Rahul Singhal 2018 年 6 月 27 日
Hi Tong,
The default layout of the page defines the size for the page margins (top, bottom, left, right) to be "1in" each and also the size for headers and footers to be "0.5in" each. This comes out to be the blank area in your report. You can manipulate these sizes to get the desired output. These can be accessed as:
s = d.CurrentPageLayout;
% To change top-margin to "0in"
s.PageMargins.Top = "0in";

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Report Generator Task Examples についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by