You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
Can I nest the function pptpop() in appdesigner and compile it?
1 view (last 30 days)
Show older comments
Hi All
I want my compiled app, write outputs , images to powerpoint, and I used the pptpop function in my app that I am gonna compile, but it gives :
Error: Functionality not supported with figures created with the uifigure function. For more information, see Graphics Support in App Designer.
19 Comments
farzad
on 9 May 2020
farzad
on 9 May 2020
If I change it to
img = plot('plot1');
I get
Error: Invalid first data argument.
farzad
on 9 May 2020
should I do something like this , to add the population slide.mlx file path to my code ?
properties (Access = private)
oldpath = addpath('./icons')
end
Ameer Hamza
on 9 May 2020
Which line gives this error?
Error: Functionality not supported with figures created with the uifigure function. For more information, see Graphics Support in App Designer.
farzad
on 9 May 2020
I attached you the mfile. do you have this file in your matlab documentation directory. you can find printPlot in it. I don't know how it works. if you run pptpop() in workspace, it works. but if you run the printPlot alone, matlab does not know it
Ameer Hamza
on 9 May 2020
I don't have this file installed with my MATLAB. But if I run your file. It works without error.
farzad
on 9 May 2020
Edited: farzad
on 9 May 2020
Yes, but did you nest the function into an app and run it ?
and what do you mean by working ? does it create the powerpoint file ? Because if it runs it means you don't need MATLAB report generator to create that. you should also have this file I belive. cause it calls an .mlx file that if it did not exist in your documentation directory, it would have buged with error
Ameer Hamza
on 9 May 2020
Yes, I can run this in the app, and it generates a PowerPoint file (attached). However, It needs to open separate figures to run the function. It does not draw the graphs on the uifigure of the app designer.
farzad
on 9 May 2020
I don't want it draw the graphs on th uifigure, I just wanted the powerpoint file be created. so : how come it's working from the app for you and not for mine ? how do you do that ?
Ameer Hamza
on 9 May 2020
I just put the line
pptpop()
in the startupFcn of the uifigure. Whenever I open the app, it runs the function and creates a ppt file in the same folder.
Note: I am using R2020a on macOS and haven't compiled the app.
farzad
on 10 May 2020
I don't think that this is a version issue. I hope not, so you get the completed powerpoint file, not just the file. I mean, the images are printed inside the ppt file ?
It will be very disappointing why on mine it's not working
farzad
on 10 May 2020
so why is it giving me this error. I think it'salso irrelevant to matlab report generator toolbox
farzad
on 10 May 2020
I moved the pptpop to a new button, this time the figure pops up and the empty powerpoint is created but still I havethe error
Error using print (line 80)
Functionality not supported with figures created with the uifigure function. For more information, see Graphics Support in App Designer.
Error in pptpop>printPlot (line 183)
print(imgtype, imgname);
Error in pptpop (line 67)
img = printPlot('plot1');
Ameer Hamza
on 10 May 2020
farzad, See the attached file. If these seem like the PowerPoint file, you want?
Accepted Answer
Walter Roberson
on 10 May 2020
R2020a and later:
change line 183,
print(imgtype, imgname);
to
exportgraphics(gcf, imgname)
7 Comments
Walter Roberson
on 10 May 2020
I believe it will work after compiling.
Leave line 67 as-is. You are modifying what printPlot() does.
exportgraphics is a replacement for print() and saveas()
Walter Roberson
on 10 May 2020
No, in R2019b there is no known way to get a copy of uifigure() as an image -- other than possibly invoking a system-level screen capture function some-how, such as an ActiveX control.
farzad
on 11 May 2020
Dear Walter, this question of mine is suffering from lack of views, I got a problem :
Walter Roberson
on 12 May 2020
I do not have Report Generator; also I am executing on Mac, which cannot talk to PowerPoint .
farzad
on 12 May 2020
The Mac news are very sad. at least I had put the .m file script so someone could have tried that on their PC
More Answers (0)
See Also
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!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)