JN

Hi,

I want to publish a excel report with merged cells. I am unable to merge the cells.

output = Context.createExcelWorkbook("Book");

sheet = output.createSheet("Sheet1");  
row1= sheet .createRow(0);

row2= sheet.createRow(1);
//I want to merge first coumn and second column of second row 
//So I tried this
sheet .addRegion(0,1,1,1);
//But it always throws me an error!!

When I use above code I am getting Error Index:1 Size=0

Can anyone guide me on this please?

 

by Eva Klein
Badge for 'Community Team' achievement
Posted on Wed, 12/10/2014 - 10:33

I hope this will help you. If you have further questions please feel free to ask me.

var workbook = Context.createExcelWorkbook(Context.getSelectedFile());
var sheet = workbook.createSheet("Sheet1");   
sheet.addRegion(0,1,1,1); 
workbook.write();

Regards

Eva

0
by JeyaKarthik N R Author
Posted on Wed, 12/10/2014 - 11:20

In reply to by JeyaKarthik

Hi Eva,

Thanks a lot.!

Your code works!!. I got it after replacing filename in createExcelWorkbook with Context.getSelectedFile

But I want to know what's difference between

var workbook = Context.createExcelWorkbook(Context.getSelectedFile());

And

var workbook = Context.createExcelWorkbook("FileName");

?

0
by Eva Klein
Badge for 'Community Team' achievement
Posted on Wed, 12/10/2014 - 15:04

You're welcome.

With this version, the name for the report output is hard-coded and every output has this name ("FileName.xls").

var workbook = Context.createExcelWorkbook("FileName.xls");

With the following version, the report output is assigned the name that you had defined when you started the report and set the output settings ("Save output as").

var workbook = Context.createExcelWorkbook(Context.getSelectedFile());
0
by Sch J
Posted on Wed, 01/14/2015 - 10:29

Hi, 

is there any way to do this, when using createOutputObject for creation of the object. 

Like:     outfile = Context.createOutputObject(Constants.OUTEXCEL, Context.getSelectedFile());

Thanks  Sica
0
by Rahil Razac
Posted on Thu, 08/13/2015 - 18:55

Hello, I'm having a similar problem. But instead of creating a new excel i'm creating it from a template. the error gives me the following info:

index:11 size: 10

 

my code is:

    var xlsTemplateData = Context.getFile("Template.xlsx", Constants.LOCATION_SCRIPT)
    return Context.createExcelWorkbook(Context.getSelectedFile(), xlsTemplateData);

Thank you

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