Dear community,
I spent a lot of time today, but I could not achieve a result. How do I create a table like this? More precisely - how to make cell number 5 correctly?
Below is my code, but it only works until I add the 5th column and the 5th cell to it (it forms a table like in Picture 2). I have experienced many options, but I don't understand how to do it correctly :(
They only get this result.
I ask for your advice.
var oO = Context.createOutputObject(); var colWidthList = new java.util.ArrayList(); colWidthList.add(12); colWidthList.add(12); colWidthList.add(12); colWidthList.add(12); colWidthList.add(12); oO.BeginTable(100,colWidthList,Constants.C_BLACK,Constants.C_TRANSPARENT,Constants.FMT_CENTER | Constants.FMT_BOLD,0); oO.TableRow(); oO.TableCell("Col 1",1,1,"Times New Roman",12,Constants.C_BLACK,Constants.C_GREY_80_PERCENT,0,Constants.FMT_CENTER | Constants.FMT_BOLD,0); oO.TableCell("Col 2",1,1,"Times New Roman",12,Constants.C_BLACK,Constants.C_GREY_80_PERCENT,0,Constants.FMT_CENTER | Constants.FMT_BOLD,0); oO.TableCell("Col 3",1,1,"Times New Roman",12,Constants.C_BLACK,Constants.C_GREY_80_PERCENT,0,Constants.FMT_CENTER | Constants.FMT_BOLD,0); oO.TableCell("Col 4",1,1,"Times New Roman",12,Constants.C_BLACK,Constants.C_GREY_80_PERCENT,0,Constants.FMT_CENTER | Constants.FMT_BOLD,0); oO.TableCell("Входящие 5",1,1,"Times New Roman",12,Constants.C_BLACK,Constants.C_GREY_80_PERCENT,0,Constants.FMT_CENTER | Constants.FMT_BOLD,0); oO.TableRow(); oO.TableCell("Cell 1",4,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0); oO.TableCell("Cell 2",4,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0); oO.TableCell("Cell 31",1,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0); oO.TableCell("Cell 41",1,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0); oO.TableCell("Cell 32",1,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0); oO.TableCell("Cell 42",1,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0); oO.TableCell("Cell 33",1,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0); oO.TableCell("Cell 43 ",1,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0); oO.TableCell("Cell 34",1,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0); oO.TableCell("Cell 44",1,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0); oO.TableCell("Cell 5",4,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0); oO.WriteReport();
Hi,
you have to add multiple rows.
Row1: Header row
Row 2: Row for cell 1 (size 4,1), cell 2 (size 4,1), cell 3 (size 1,1), cell 4 (size 1,1), cell 5 (size 4,1)
Row3: Row for cell 3 (size 1,1), cell 4 (size 1,1),
Row4: Row for cell 3 (size 1,1), cell 4 (size 1,1),
Row5: Row for cell 3 (size 1,1), cell 4 (size 1,1),
BR Robert
Dear Robert,
thank you so much for your reply! I finally started to understand the logic of combining cells in ARIS. I tried to reproduce your version. And I almost got it right! But - "almost" :(
The cell in the fifth column stretches only three rows. Maybe I wrote something wrong in the code again?
var oO = Context.createOutputObject(); var colWidthList = new java.util.ArrayList(); colWidthList.add(12); colWidthList.add(12); colWidthList.add(12); colWidthList.add(12); colWidthList.add(12); oO.BeginTable(100,colWidthList,Constants.C_BLACK,Constants.C_TRANSPARENT,Constants.FMT_CENTER | Constants.FMT_BOLD,0); oO.TableRow(); //row 1 oO.TableCell("Header 1",1,1,"Times New Roman",12,Constants.C_BLACK,Constants.C_GREY_80_PERCENT,0,Constants.FMT_CENTER | Constants.FMT_BOLD,0); oO.TableCell("Header 2",1,1,"Times New Roman",12,Constants.C_BLACK,Constants.C_GREY_80_PERCENT,0,Constants.FMT_CENTER | Constants.FMT_BOLD,0); oO.TableCell("Header 3",1,1,"Times New Roman",12,Constants.C_BLACK,Constants.C_GREY_80_PERCENT,0,Constants.FMT_CENTER | Constants.FMT_BOLD,0); oO.TableCell("Header 4",1,1,"Times New Roman",12,Constants.C_BLACK,Constants.C_GREY_80_PERCENT,0,Constants.FMT_CENTER | Constants.FMT_BOLD,0); oO.TableCell("Header 5",1,1,"Times New Roman",12,Constants.C_BLACK,Constants.C_GREY_80_PERCENT,0,Constants.FMT_CENTER | Constants.FMT_BOLD,0); oO.TableRow(); //row 2 oO.TableCell("Cell 1-1 size 4,1",4,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0); oO.TableCell("Cell 1-2 size 4,1",4,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0); oO.TableCell("Cell 1-3 size 1,1",1,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0); oO.TableCell("Cell 1-4 size 1,1",1,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0); oO.TableCell("Cell 1-5 size 4,1",4,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0); oO.TableRow(); //row 3 oO.TableCell("Cell 2-3 size 1,1",1,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0); oO.TableCell("Cell 2-4 size 1,1",1,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0); oO.TableRow(); //row 4 oO.TableCell("Cell 3-3 size 1,1",1,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0); oO.TableCell("Cell 3-4 size 1,1",1,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0); oO.TableRow(); //row 5 oO.TableCell("Cell 4-3 size 1,1",1,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0); oO.TableCell("Cell 4-4 size 1,1",1,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0); oO.WriteReport();
Hm yes, this could be a bug... if you add another row with a single column in it (or multiple as well), it looks good. Try this:
var oO = Context.createOutputObject();
var colWidthList = new java.util.ArrayList();
colWidthList.add(12);
colWidthList.add(12);
colWidthList.add(12);
colWidthList.add(12);
colWidthList.add(12);
oO.BeginTable(100,colWidthList,Constants.C_BLACK,Constants.C_TRANSPARENT,Constants.FMT_CENTER | Constants.FMT_BOLD,0);
oO.TableRow(); //row 1
oO.TableCell("Header 1",1,1,"Times New Roman",12,Constants.C_BLACK,Constants.C_GREY_80_PERCENT,0,Constants.FMT_CENTER | Constants.FMT_BOLD,0);
oO.TableCell("Header 2",1,1,"Times New Roman",12,Constants.C_BLACK,Constants.C_GREY_80_PERCENT,0,Constants.FMT_CENTER | Constants.FMT_BOLD,0);
oO.TableCell("Header 3",1,1,"Times New Roman",12,Constants.C_BLACK,Constants.C_GREY_80_PERCENT,0,Constants.FMT_CENTER | Constants.FMT_BOLD,0);
oO.TableCell("Header 4",1,1,"Times New Roman",12,Constants.C_BLACK,Constants.C_GREY_80_PERCENT,0,Constants.FMT_CENTER | Constants.FMT_BOLD,0);
oO.TableCell("Header 5",1,1,"Times New Roman",12,Constants.C_BLACK,Constants.C_GREY_80_PERCENT,0,Constants.FMT_CENTER | Constants.FMT_BOLD,0);
oO.TableRow(); //row 2
oO.TableCell("Cell 1-1 size 4,1",4,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0);
oO.TableCell("Cell 1-2 size 4,1",4,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0);
oO.TableCell("Cell 1-3 size 1,1",1,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0);
oO.TableCell("Cell 1-4 size 1,1",1,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0);
oO.TableCell("Cell 1-5 size 4,1",4,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0);
oO.TableRow(); //row 3
oO.TableCell("Cell 2-3 size 1,1",1,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0);
oO.TableCell("Cell 2-4 size 1,1",1,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0);
oO.TableRow(); //row 4
oO.TableCell("Cell 3-3 size 1,1",1,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0);
oO.TableCell("Cell 3-4 size 1,1",1,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0);
oO.TableRow(); //row 5
oO.TableCell("Cell 4-3 size 1,1",1,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0);
oO.TableCell("Cell 4-4 size 1,1",1,1,"Times New Roman",10,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0);
oO.TableRow(); //row 5
oO.TableCell("",1,5,"Times New Roman",0,Constants.C_BLACK,Constants.C_TRANSPARENT,0,Constants.FMT_LEFT,0);
oO.WriteReport();