HJ
Hello !

I'm working on a report to ouptut an XLS file. I would like to merge the cells in the first row to do as in the following picture :

 

I did some research and I found this function : addRegion ( int p_nFromColumn, int p_nToColumn, int p_nFromRow, int p_nToRow )

However, ARIS doesn't recognize this function and I get this error when I try to execute my script :
TypeError: Cannot find function addRegion in object...

Here is my code :

var oOutput = Context.createOutputObject()
var selectedModel = ArisData.getSelectedModels()[0].ObjDefList();
createSection2(oOutput, selectedModel,selectedModel)

function createSection2(p_output, p_Models,array)
{
//Columns creation (p_output.BeginTable...)
//Rows & cells creation
p_output.addRegion(1, 5, 1, 1)

}

If I remove the function AddRegion, the script works and I get the same sheet as shown in the picture, but with multiple cells in the first row.

Can anyone help me please ?

Regards,
Helmy

by Nikita Martyanov
Posted on Wed, 02/17/2021 - 11:39

Hello Helmy, try to use this code. addRegion is the method of the sheet object, not the output object. And sheet belongs to workbook.

var oOutput = Context.createExcelWorkbook(Context.getSelectedFile());
var sht = oOutput.createSheet("SheetName");
sht.addRegion(1,5,1,1);
oOutput.write();

BR, Nikita

0
by Helmy Jeddi Author
Posted on Wed, 02/17/2021 - 14:28

In reply to by billie1989

Oh I see, so I need to create my cells with the ExcelWorkBook method as well

Ok thank you Nikita

Regards,
Helmy

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