How do I add a picture to report generator?
    11 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Mikkel Ibsen
 el 20 de Oct. de 2017
  
    
    
    
    
    Respondida: Corey Silva
    
 el 23 de Oct. de 2017
            Hi
I've been trying to get to know this report generator but I can't quite figure it out.
I've managed to add a table and change the orientation to "landscape", but I can't choose where to place the different objects onto the page, and I can't add a image. What do I do?
import mlreportgen.dom.* %import the DOM API
% Specify the type of docuemnt ot create, Word, PDF or HTML
rpt_type = 'pdf';
%%Simple report
[file, path] = uiputfile('*.pdf');
doc = Document([path file],rpt_type); % Create an empty PDF document
open(doc);
sect = doc.CurrentPageLayout;
pageSize = sect.PageSize;
pageSize.Orientation = 'landscape';
saveHeight = pageSize.Height;
pageSize.Height = pageSize.Width;
pageSize.Width = saveHeight;
table = append(doc,magic(22));
table.Border = 'solid';
table.ColSep = 'solid';
table.RowSep = 'solid';
close(doc);
open(Image)
Image.append(image)
close(Image)
rptview(doc.OutputPath);
If I want to add the picture in the top right corner what do I do?
Should I use the report explorer instead of trying to write it myself? Because the explorer is just as difficult to understand.
0 comentarios
Respuesta aceptada
  Corey Silva
    
 el 23 de Oct. de 2017
        You should be able to create an image to include in your report with the mlreportgen.dom.Image class.
This should get you started:  https://www.mathworks.com/help/rptgen/ug/mlreportgen.dom.image-class.html
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Templates en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!