BW

I am working on a script that will create a standard header to models.  I would also like to add an image to the models, but I am not finding a way to add an image to the model via script.

by Volker Eckardt
Posted on Wed, 05/19/2010 - 00:21

Hello Brandon,

in my tutorial - part 7 you should find everything you need to bring a picture to work in a page header. In terms of a model image the following code should work.

p_output.TableCell("", 33.26, getString("ID_DEFAULT_FONT"), 10, Constants.C_BLACK, RGB(255,255,255), 0,  Constants.FMT_VTOP |  Constants.FMT_LEFT, 0)
p_output.BeginParagraph( Constants.FMT_LEFT, 0.71, 0.71, 0, 0, 0)
writeData1(p_output, p_aModel1[i].Graphic(false, false, nLocale))
p_output.EndParagraph()

function writeData1(p_output, p_IModelPicture) {
   p_output.OutGraphic(p_IModelPicture, -1, p_output.getCurrentMaxWidth(),   p_output.GetPageHeight() - p_output.GetTopMargin() - p_output.GetBottomMargin() -20)
}
function RGB(r, g, b) {
    return (new java.awt.Color(r/255.0,g/255.0,b/255.0,1)).getRGB() & 0xFFFFFF
}

Hope this helps!

Regards, Volker

0
by Brandon Wicklund Author
Posted on Wed, 05/19/2010 - 15:55

Hello Volker,

I have figured out how to add an image to output.  What I am looking for is adding an image, in this case company logo, to the models within ARIS.  We want the logo to be visible on the model if someone decides to print the model.

Thanks in advance,

Brandon

0
by Shankar Ganesh
Posted on Thu, 05/20/2010 - 12:12

Hello Brandon -- Can you elaborate on how you did it?

Thanks & Regards,

Shankar

0
by Brandon Wicklund Author
Posted on Thu, 05/20/2010 - 15:42

Hello Shankar --

To add an image to an output file like a PDF, make sure you have the image imported into the group where your script resides or in the Common files group.  The code listed below will create an output file with the logo.gif image displayed:

 

var output = Context.createOutputObject();

var image = Context.createPicture("logo.gif");

output.BeginSection(false,Constants.SECTION_DEFAULT);

output.OutGraphic(image,100,130,65);

output.EndSection();

output.WriteReport();

0
by Shankar Ganesh
Posted on Thu, 05/20/2010 - 16:02

Thanks Brendon.. Would you know whether this works in Excel output as well? I know in another post, it was stated as not working in Excel.

UPDATED Few mins after posting the above statement:

Little bit of googling threw up this search result -- "Report zum Grafikexport nach Excel | ARIS User Forum " -- ofcourse that is a dated discussion & around ARIS Toolset 6.x... So not sure how much that'll work and what better ways do latest ARIS version have in adding graphics to Excel.

Any expert from IDS listening to this post to clarify on how the graphic could be added to Excel report output? Sebastian, could you help in having some expert review these 2 posts and respond.

Thanks & Regards,

Shankar

0
by Brandon Wicklund Author
Posted on Thu, 05/20/2010 - 16:05

The first code I posted does not work in Excel.  Below is new code that will output an image to an Excel file.  To get this to work you need to add a Paragraph inside a TableCell:

var output = Context.createOutputObject();

var image = Context.createPicture("logo.gif");

output.BeginSection(false,Constants.SECTION_DEFAULT);

output.BeginTable(100,Constants.C_WHITE,Constants.C_WHITE,Constants.FMT_LEFT,0);

output.TableRow();

output.TableCell("",100,"Arial",10,Constants.C_BLACK,Constants.C_WHITE,0,Constants.FMT_LEFT,0);

output.BeginParagraph( Constants.FMT_LEFT, 0.71, 0.71, 0, 0, 0);

output.OutGraphic(image,100,130,65);

output.EndParagraph();

output.EndSection();

output.WriteReport();

0
by Shankar Ganesh
Posted on Thu, 05/20/2010 - 16:07

ooh.. that's good to hear. Thanks Brandon -- appreciate your quick response.

0
by Kirill Tsarkov
Posted on Wed, 05/26/2010 - 07:49

 

Hello Volker,

Could you help please - i'd like to output model picture best fitted to page, thus i need to decide - should portrait or landscape page orientation be selected. Could I find out height and width of the model picture before output? 

Thanks

Kirill

0
by Volker Eckardt
Posted on Sat, 05/29/2010 - 14:04

In reply to by sstein

Hi Kirill,

I need to give this question back to the community. I am not aware of any option right now, any test that I did was not a success.

Hopefully someone else knows that!

Regards, Volker

0
by Leonardo Grauer
Posted on Tue, 05/24/2011 - 01:50

Hi Kirill and Volker,

I am having the same problem right now.

Did you finally manage to solve this issue?

Regards,

Leonardo

0
by Leonardo Grauer
Posted on Tue, 05/24/2011 - 02:10

I found the solution already.

Thank you anyway

0

Featured achievement

Rookie
Say hello to the ARIS Community! Personalize your community experience by following forums or tags, liking a post or uploading a profile picture.
Recent Unlocks

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