AL

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.

by Nikita Martyanov
Posted on Wed, 10/23/2019 - 12:03

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

0
by Antonio Labarta Author
Posted on Wed, 10/23/2019 - 12:18

In reply to by billie1989

It worked in Excel, so I tried to do the same in Word. Thank you!

0

Featured achievement

Question Solver
Share your expertise and have your answer accepted as best reply.
Recent Unlocks
  • CR
  • BH
  • Profile picture for user Ivan.Ivanov.softwareag.com
  • Profile picture for user mscheid
  • MS
  • PacMan

Leaderboard

|
icon-arrow-down icon-arrow-cerulean-left icon-arrow-cerulean-right icon-arrow-down icon-arrow-left icon-arrow-right icon-arrow icon-back icon-close icon-comments icon-correct-answer icon-tick icon-download icon-facebook icon-flag icon-google-plus icon-hamburger icon-in icon-info icon-instagram icon-login-true icon-login icon-mail-notification icon-mail icon-mortarboard icon-newsletter icon-notification icon-pinterest icon-plus icon-rss icon-search icon-share icon-shield icon-snapchat icon-star icon-tutorials icon-twitter icon-universities icon-videos icon-views icon-whatsapp icon-xing icon-youtube icon-jobs icon-heart icon-heart2 aris-express bpm-glossary help-intro help-design Process_Mining_Icon help-publishing help-administration help-dashboarding help-archive help-risk icon-knowledge icon-question icon-events icon-message icon-more icon-pencil forum-icon icon-lock