AS

Hello, I am having some trouble making an excel with this output (matrix-like)  => image will be below.

The yellow part is the part that I am trying to write automatically. 

I can write if I use with a single tablecell function, but If i try to to write and create all the cells automatically (with for cycles) it gives me this error:

 

  1. My code until now:
    
    var activeDB;
    var selectedLanguage = Context.getSelectedLanguage();
    var dummyOutput = Context.createOutputObject();
    var foldersList = new java.util.Vector();
    
    main();
    dummyOutput.WriteReport();
    
    function main() {
    
        activeDB = ArisData.getActiveDatabase();
    
        foldersList = ArisData.getActiveDatabase().GroupList(ArisData.getSelectedGroups()[0]);
        dummyOutput.BeginTable(100, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_LEFT | Constants.FMT_REPEAT_HEADER, 0);
        dummyOutput.TableRow();
        dummyOutput.TableRow();
        dummyOutput.TableCell("PROJECTO JUMP", 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
        dummyOutput.TableCell("NOTA: Os subprocessos na coluna D são inputs e outputs dos subprocessos na linha 3", 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
        dummyOutput.TableRow();
        dummyOutput.TableCell("imagens", 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
        dummyOutput.TableCell("imagens", 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
        dummyOutput.TableCell("imagens", 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
        dummyOutput.TableCell("imagens", 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
    
        for (var i = 0; i < foldersList.length; i++) {
            var currentFolder = foldersList[i];
            var currentFolderName = currentFolder.Name(selectedLanguage);
            var folderParent = currentFolder.Parent();
            var folderParentName = folderParent.Name(selectedLanguage)
            var folderParentChildList = folderParent.Childs(false);
            for (var j = 0; j < folderParentChildList.length; j++) {
                var currentChild = folderParentChildList[j];
                var folderParentGrandChild = currentChild.Childs(false);
                for (var h = 0; h < folderParentGrandChild.length; h++) {
                    var currentGrandChild = folderParentGrandChild[h];
                    var grandGrandChildList = currentGrandChild.Childs(false);
    
                    if (folderParentName == "5. Gestão de ativos") {
                        dummyOutput.TableCell(currentGrandChild.Name(selectedLanguage), 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
                        if (folderParentName == "6. Gestão de Energia") {
                            dummyOutput.TableCell(currentGrandChild.Name(selectedLanguage), 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
                            if (folderParentName == "7. Gestão Comercial") {
                                dummyOutput.TableCell(currentGrandChild.Name(selectedLanguage), 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
                                if (folderParentName == "8. Gestão e Operação de Rede de Distribuição") {
                                    dummyOutput.TableCell(currentGrandChild.Name(selectedLanguage), 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
                                    if (folderParentName == "10. Service Provider") {
                                        dummyOutput.TableCell(currentGrandChild.Name(selectedLanguage), 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
                                    }
                                }
                            }
                        }
                    }
                }
            }
    
        }
    
        dummyOutput.TableRow();
        dummyOutput.TableCell("Capacidade", 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
        dummyOutput.TableCell("Grupo de Processo", 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
        dummyOutput.TableCell("Processo", 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
        dummyOutput.TableCell("Sub-Processo", 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
    
        dummyOutput.TableCell("TO WRITE HERE ", 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
    
        writeColumns(foldersList);
    
        //antes de fechar a funcao main
        dummyOutput.EndTable("FIM", 100, "Arial", 10, Constants.C_BLACK, Constants.C_BLACK, 0, Constants.FMT_LEFT | Constants.FMT_ITALIC, 0);
    
    }
    
    /*
     * Writes in the columns "Capacidade, Grupo de Processo, Processo e Sub-Processo"
     */
    function writeColumns(foldersList) {
    
        for (var i = 0; i < foldersList.length; i++) {
            var currentFolder = foldersList[i];
            var currentFolderName = currentFolder.Name(selectedLanguage);
            var folderParent = currentFolder.Parent();
            var folderParentName = folderParent.Name(selectedLanguage);
            var folderParentChildList = folderParent.Childs(false); //false é sem recursividade, ou seja, apenas os childs do nivel abaixo
            for (var j = 0; j < folderParentChildList.length; j++) {
                var currentChild = folderParentChildList[j];
                var folderParentGrandChild = currentChild.Childs(false);
                for (var h = 0; h < folderParentGrandChild.length; h++) {
                    var currentGrandChild = folderParentGrandChild[h];
                    var grandGrandChildList = currentGrandChild.Childs(false);
                    for (var k = 0; k < grandGrandChildList.length; k++) {
                        var currentGrandGrandChild = grandGrandChildList[k];
                        if (folderParentName == "5. Gestão de ativos") {
                            dummyOutput.TableRow();
                            dummyOutput.TableCell(folderParentName, 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
                            dummyOutput.TableCell(currentChild.Name(selectedLanguage), 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
                            dummyOutput.TableCell(currentGrandChild.Name(selectedLanguage), 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
                            dummyOutput.TableCell(currentGrandGrandChild.Name(selectedLanguage), 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
    
                            if (folderParentName == "6. Gestão de Energia") {
                                dummyOutput.TableRow();
                                dummyOutput.TableCell(folderParentName, 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
                                dummyOutput.TableCell(currentChild.Name(selectedLanguage), 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
                                dummyOutput.TableCell(currentGrandChild.Name(selectedLanguage), 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
    
                                if (folderParentName == "7. Gestão Comercial") {
                                    dummyOutput.TableRow();
                                    dummyOutput.TableCell(folderParentName, 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
                                    dummyOutput.TableCell(currentChild.Name(selectedLanguage), 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
                                    dummyOutput.TableCell(currentGrandChild.Name(selectedLanguage), 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
    
                                    if (folderParentName == "8. Gestão e Operação de Rede de Distribuição") {
                                        dummyOutput.TableRow();
                                        dummyOutput.TableCell(folderParentName, 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
                                        dummyOutput.TableCell(currentChild.Name(selectedLanguage), 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
                                        dummyOutput.TableCell(currentGrandChild.Name(selectedLanguage), 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
    
                                        if (folderParentName == "10. Service Provider") {
                                            dummyOutput.TableRow();
                                            dummyOutput.TableCell(folderParentName, 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
                                            dummyOutput.TableCell(currentChild.Name(selectedLanguage), 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
                                            dummyOutput.TableCell(currentGrandChild.Name(selectedLanguage), 20, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, 0, Constants.FMT_CENTER, 0);
    
                                        }
                                    }
                                }
                            }
                        }
                    }
    
                }
            }
        }
    }
by Martin Schröder
Badge for 'Contributor' achievement
Posted on Thu, 02/02/2017 - 19:18

Hola Ana,

looks like your for loop exceeds the maximum no. of columns in XLS format. Here you can find an overview of Excel versions and limits.

Can you change your output to XSLX ? Cf. this post for more info

Regards, Martin

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