How can I run a report setup file from within an app?

1 回表示 (過去 30 日間)
Magnus Fransson
Magnus Fransson 2019 年 8 月 19 日
コメント済み: Magnus Fransson 2019 年 8 月 20 日
I can run a report setup file from the command window to generate a report when all my data is in the workspace. If I try to run the report from within an app, constructed by appdesigner, the report contains no data in the Variable or the Array-Based Table components. How do I get the report setup file to fetch the data from the app?
Code from appdesigner used for a push button:
function REPORTButtonPushed(app, event)
MS_sumtab=table2cell(app.SumTab);
report Test -fpdf
end
The report is supposed to include the Assay-Based Table MS_sumtab, but it doesn't work.

採用された回答

Mary Abbott
Mary Abbott 2019 年 8 月 20 日
Hello,
The Variable and Array-Based Table components use variables from the base workspace. In the REPORTButtonPushed callback, the variable MS_sumtab is defined only in the callback's workspace. You can define the variable in the base workspace using the assignin function:
function REPORTButtonPushed(app, event)
assignin('base', 'MS_sumtab', table2cell(app.SumTab));
report Test -fpdf
end

その他の回答 (0 件)

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by