Hi!
I am trying to create a report that exports a diagram image to a Word. I have done it previously in Excel without problem, but when trying to do it in Word all I get is an image with a large X like this:
Thats my code:
var pic = oModel.Graphic(false,false,g_nLoc);
var sfileName = oModel.GUID() + ".png";
pic.setZoom(150);
pic.Save(oOutput, sfileName);
var data = Context.getFile(sfileName, Constants.LOCATION_OUTPUT);
var image = Context.createPicture(data);
outputObj.OutGraphic(image, -1, 156, 43 );
Context.deleteFile(sfileName);
I have run out of ideas, please help.
Hi Antonio,
here is some code lines that can help you.
I don't understand why you need temp file, you can output graphic directly to Word.
var oOutput = Context.createOutputObject() var loc = Context.getSelectedLanguage() var oModel = ArisData.getSelectedModels()[0] var pic = oModel.Graphic(false,false,loc); oOutput.OutGraphic(pic, 150, 2000, 2000); oOutput.WriteReport()
You can zoom in and zoom out with the second parameter and set size of picture in document with two last parameters.
---
BR, Nikita