FS

Hallo, i am scripting an Word-Report for my ARIS Models (ARIS Business Architect 7.1). I have problem with  align table of contents to right (Arabic Language).

by Fadi Sahioun Author
Posted on Wed, 06/01/2011 - 13:40

Thank you

0
by Eva Klein
Badge for 'Community Team' achievement
Posted on Wed, 06/01/2011 - 13:59

Hi,

you just have to set the constant that defines the alignment of the table cell to the value "right". For example:

oOutputFile.TableCell("test", 20, "Arial", 10, Constants.C_BLACK, Constants.C_BLUE, 0, Constants.FMT_BOLD | Constants.FMT_RIGHT | Constants.FMT_VTOP, 0);

I hope that this will help you.

Regards

Eva

0
by Fadi Sahioun Author
Posted on Wed, 06/01/2011 - 14:43

Thank you Eva

 This is true but does not work i dont know why ?

Picture Location :  /system/files/editor/image/arisalign/code.jpg

0
by Eva Klein
Badge for 'Community Team' achievement
Posted on Mon, 06/06/2011 - 15:12

Can you please paste the source code into the comment so that I can test it.

0
by Fadi Sahioun Author
Posted on Tue, 06/07/2011 - 06:15
var g_nLoc = Context.getSelectedLanguage();
var bOutputSAP = false;
var bOutputNonSAP = true;

var bOutputDescription = false;

    if(g_nLoc==1025){
        var oDirection=Constants.FMT_RIGHT;
        var g_sLine = getString("ID_REPORTDEF_26_AR");  
        var g_sHeader_add = getString("ID_REPORTDEF_31_AR");
        }
    else
        {
         var oDirection=Constants.FMT_LEFT;
         var g_sLine = getString("ID_REPORTDEF_26");
         var g_sHeader_add = getString("ID_REPORTDEF_31");
        }
function docMain(){
    if(bInitOk){
        var oOutput = Context.createOutputObject()
        //var xlTableActive=false
    
            oOutput.DefineF(getString("ID_STYLE_RD_INFO"), getString("ID_DEFAULT_FONT"), 14, RGB(0,0,0), Constants.C_TRANSPARENT,  Constants.FMT_BOLD | Constants.FMT_CENTER| Constants.FMT_VTOP, 0, 0, 1.76, 8.82, 0, 1)
            oOutput.DefineF(getString("ID_STYLE_RD_TITLE"), getString("ID_DEFAULT_FONT"), 21, RGB(0,0,0), Constants.C_TRANSPARENT,  Constants.FMT_BOLD | Constants.FMT_CENTER| Constants.FMT_VTOP, 0, 0, 1.76, 8.82, 0, 1)
            oOutput.DefineF(getString("ID_STYLE_RD_DEFAULT"), getString("ID_DEFAULT_FONT"), 11, RGB(0,0,0), Constants.C_TRANSPARENT,  oDirection | Constants.FMT_VTOP, 0, 0, 0, 0, 0, 1)
            oOutput.DefineF(getString("ID_STYLE_RD_HEADING_4"), getString("ID_DEFAULT_FONT"), 12, RGB(0,0,0), Constants.C_TRANSPARENT,  Constants.FMT_ITALIC | Constants.FMT_BOLD | oDirection | Constants.FMT_VTOP| Constants.FMT_TOCENTRY3 , 0, 0, 0, 0, 0, 1)
            oOutput.DefineF(getString("ID_STYLE_RD_TABLE_CONTENT"), getString("ID_DEFAULT_FONT"), 8, RGB(0,0,0), Constants.C_TRANSPARENT,  oDirection| Constants.FMT_VTOP, 0, 0, 0, 0, 0, 1)
            oOutput.DefineF(getString("ID_STYLE_RD_HEADING_3"), getString("ID_DEFAULT_FONT"), 12, RGB(0,0,0), Constants.C_TRANSPARENT,  Constants.FMT_ITALIC | Constants.FMT_BOLD | oDirection | Constants.FMT_VTOP| Constants.FMT_TOCENTRY2 , 0, 0, 1, 1, 0, 1)
            oOutput.DefineF(getString("ID_STYLE_RD_HEADER_FOOTER"), getString("ID_DEFAULT_FONT"), 10, RGB(0,0,0), Constants.C_TRANSPARENT,  oDirection| Constants.FMT_VTOP, 0, 0, 0, 0, 0, 1)
            oOutput.DefineF(getString("ID_STYLE_RD_HEADING_2"), getString("ID_DEFAULT_FONT"), 14, RGB(0,0,0), Constants.C_TRANSPARENT,  Constants.FMT_ITALIC | Constants.FMT_BOLD | oDirection | Constants.FMT_VTOP| Constants.FMT_TOCENTRY1 , 0, 0, 2, 2, 0, 1)
            oOutput.DefineF(getString("ID_STYLE_RD_HEADING_1"), getString("ID_DEFAULT_FONT"), 18, RGB(0,0,0), Constants.C_TRANSPARENT,  Constants.FMT_BOLD | oDirection| Constants.FMT_VTOP| Constants.FMT_TOCENTRY0 , 0, 0, 4, 4, 0, 1)
            oOutput.DefineF(getString("ID_STYLE_RD_TABLE_HEAD"), getString("ID_DEFAULT_FONT"), 8, RGB(0,0,0), Constants.C_TRANSPARENT,  Constants.FMT_BOLD | Constants.FMT_CENTER| Constants.FMT_VTOP, 0, 0, 0, 0, 0, 1)
            oOutput.DefineF(getString("ID_STYLE_RD_HEADING_5"), getString("ID_DEFAULT_FONT"), 11, RGB(0,0,0), Constants.C_TRANSPARENT,  Constants.FMT_ITALIC | Constants.FMT_BOLD | oDirection | Constants.FMT_VTOP| Constants.FMT_TOCENTRY3 , 0, 0, 0, 0, 0, 1) 
            oOutput.DefineF(getString("ID_STYLE_DCS_DEFAULT"), getString("ID_DEFAULT_FONT"), 11, RGB(0,0,0), Constants.C_TRANSPARENT,  oDirection | Constants.FMT_VTOP, 0, 0, 0, 0, 0, 1)  
          
        setupOutputObject( oOutput, g_oSelectedObjDef);
        oOutput.SetTitle(Context.getScriptInfo(Constants.SCRIPT_NAME))
    }
   
    if(bInitOk){
          // IF EVERYTHING WAS OK, THE DOCUMENT CAN BE CREATED
        // THIS IS THE MAIN STRUCTURE OF THE DOCUMENT
        
        //Cover page
        writeFirstPage( oOutput, g_oSelectedObjOcc );
        
        //Document Approvals
        writeDocumentApprovalsPage( oOutput, g_oSelectedObjDef );
        
        //Document Control Sheet
        writeDocumentControlSheet( oOutput, g_oSelectedObjDef );
        
        //Table of contents
        createTableOfContents(oOutput);
        
        // 1. Introduction
        createIntroduction(oOutput);
        
        // Dynamic Content (Processes / model graphics etc)
        createContent(oOutput, g_oSelectedObjOcc);
        
        // ANNEX 1: Process Leveling Conventions
        writeAnnex01(oOutput);
        
        // ANNEX 1_2: Symbol conventions
        writeAnnex0102(oOutput);

        // ANNEX 1_3: How to access the portal
        writeAnnex0103(oOutput);

        // ANNEX 2: Remarks Page
        writeAnnex02(oOutput);
        
        // ANNEX 3: Workshop participants (show only if Non-SAP involved)
        if(bOutputNonSAP){
            writeAnnex03(oOutput);
        }
        
        // ANNEX 4: List of assigned collateral documents
        writeListOfCollateralDocuments(oOutput, g_aDocuments);
        
        
        
        oOutput.WriteReport()
        
    }
    
}



function createTableOfContents(p_output)
{
 //produce one table sheet per section
 if(xlTableActive && Context.getSelectedFormat()==Constants.OUTEXCEL) {
        
            p_output.EndTable("", 100, "", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, oDirection, 0)
  xlTableActive=false
 }
 //p_output.BeginSection(false, Constants.SECTION_INDEX)
     
    
 p_output.BeginSection(nDocPageHeight, nDocPageWidth, nDocDistHeader, nDocDistFooter, nDocLeftMargin, nDocRightMargin, nDocTopMargin, nDocBottomMargin, true, Constants.SECTION_INDEX)
 //setupOutputObject( p_output ) //use defaults
   
 if(Context.getSelectedFormat()==Constants.OUTEXCEL) {
             p_output.BeginTable(100, Constants.C_BLACK, Constants.C_TRANSPARENT,  oDirection | Constants.FMT_REPEAT_HEADER, 0)
  
  
  xlTableActive=true
 }
    
 p_output.BeginParagraphF(getString("ID_STYLE_RD_DEFAULT"))
  //to format the TOC output use output.SetTOCFormat(iLevel, sFont, iFontSize, nFontColor, nBackgroundColor, nFormat, nLeftIndentation, nRightIndentation, nDistTop, nDistBottom)
  //  p_output.OutputLn( Constants.FIELD_TOC, getString("ID_FONT_BOOK_ANTIQUA"), 12, RGB(0,0,0), Constants.C_TRANSPARENT,  Constants.FMT_BOLD  |  Constants.FMT_RIGHT| Constants.FMT_TOCENTRY0 , 0)
    p_output.OutputField( Constants.FIELD_TOC, getString("ID_FONT_BOOK_ANTIQUA"), 11, Constants.C_DARK_RED, Constants.C_TRANSPARENT,oDirection)
   //   p_output.SetTOCFormat(Constants.FIELD_TOC, "Times New Roman (Headings CS)", 11, Constants.C_DARK_RED, Constants.C_GRAY, oDirection, nDocLeftMargin, nDocRightMargin, nDocTopMargin, nDocBottomMargin)
  
 
    p_output.EndParagraph()
 if(Context.getSelectedFormat()==Constants.OUTEXCEL) {
            p_output.EndTable(getString("ID_REPORTDEF_TOC_25"), 100, "", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, oDirection, 0)

  xlTableActive=false
 }
 p_output.EndSection()


}

Thank you for your interest

0
by Torsten Haase
Posted on Thu, 06/09/2011 - 10:13

Hi,

as I understand you want to format the table-of-content the way it has to be for arabic language?

I think this is not possible at the moment but can be realized in a service release. Could you please confirm, if the following format whould be correct (or correct me if it is not)?

{page number}.............{chapter caption} {chapter number}

(and right aligned)

BR,

Torsten

0
by Fadi Sahioun Author
Posted on Sat, 06/11/2011 - 07:07

Hi ,Mr. Torsten Haase

The report appears in this format

then I select the table and click on the key (ctrl+shift) so that it appears as follows.

 

 

0
by Torsten Haase
Posted on Tue, 06/14/2011 - 09:50

Hi Mr. Fadi Sahioun,

is the second example the format that you want it to be?

Or what needs to be changed?

Thanks,

Torsten

0
by Fadi Sahioun Author
Posted on Tue, 06/14/2011 - 11:58

YES, Mr. Torsten  second example  

0
by Torsten Haase
Posted on Wed, 09/21/2011 - 08:07

Hi Mr. Grauer,

it is planned to be released end of October.

BR

0
by Leonardo Grauer
Posted on Tue, 11/15/2011 - 14:07

Hi Mr. Haase,

It is released already?

Thank you

0
by Torsten Haase
Posted on Tue, 11/15/2011 - 16:14

Hi Mr. Grauer,

yes, it is already released. Please make sure that your report uses the extended output object, either by calling

Context.setProperty("use-new-output",true)

before creating the output object or by setting the extended output object as the default in the server configuration file (search for "use-new-output" in the defaultserversettings.cfg).

BR, Torsten

0
by Leonardo Grauer
Posted on Tue, 11/15/2011 - 16:42

Thank you,

when i call Context.setProperty("use-new-output",true) i get the following error:

 

in the line that updates the TOC:

outFile.OutputField(Constants.FIELD_TOC,"Arial",12,Constants.C_BLACK,Constants.C_WHITE,Constants.FMT_LEFT);

Thank you again

0
by Torsten Haase
Posted on Tue, 11/15/2011 - 17:38

Please have a look at your styles and TOC styles in the script. Maybe you use a style name twice?

Or do you maybe use 7.2 SR01? In this version this message appeared repeatedly.

0
by Leonardo Grauer
Posted on Wed, 11/16/2011 - 00:29

oh yes thank you... but how do i change the table of contents direction as in Arabic format:

{page number}.............{chapter caption} {chapter number}

(right aligned)

using the command that you mentioned:

Context.setProperty("use-new-output",true)?

0
by Torsten Haase
Posted on Wed, 11/16/2011 - 09:05

This should be done automatically, if the attribute language (which is the language used for the output document) is a right-to-left language.

 

0
by Leonardo Grauer
Posted on Wed, 11/16/2011 - 11:44

The attribute language is a right-to-left language but still the TOC comes out as for a left-to-right lang.

Is there any way to force the change of direction ?

Thank you

0
by Torsten Haase
Posted on Wed, 11/16/2011 - 12:41

Could you attach a small script + instructions to reproduce this behaviour?

Thank you.

0
by Torsten Haase
Posted on Thu, 11/17/2011 - 09:12

Hm. It once worked... Needs to be fixed again for the next service release.

0
by Gilad Wilk
Posted on Mon, 01/09/2012 - 16:15

Hi,
After I added to my report the Context.setProperty("use-new-output",true) command my table of context disappeared and my internal hyperlink connection got scrambled,
Can anyone please help me?

The code for the TOC goes like this

 g_ooutfile.SetTOCFormat(0, "Arial", 11, Constants.C_BLACK, Constants.C_TRANSPARENT,Constants.FMT_BOLD| Constants.FMT_LEFT, 0, 0, 0, 0);
    g_ooutfile.SetTOCFormat(1, "Arial", 11, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_BOLD| Constants.FMT_LEFT ,1, 1, 0, 0);
    g_ooutfile.SetTOCFormat(2, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT,  Constants.FMT_LEFT ,2, 2, 0, 0);
    g_ooutfile.SetTOCFormat(3, "Arial", 9, Constants.C_BLACK, Constants.C_TRANSPARENT,Constants.FMT_BOLD|  Constants.FMT_LEFT ,3,10, 0, 0);
    
    
    var firstLevel = "HEADING 1"
    var secondLevel = "HEADING 2"
    var thirdLevel = "HEADING 3"
    var fourthLevel = "HEADING 4"
    
    g_ooutfile.DefineF(firstLevel, "Arial", 12, Constants.C_BLACK, Constants.C_TRANSPARENT,  Constants.FMT_BOLD|Constants.FMT_LEFT| Constants.FMT_VTOP | Constants.FMT_TOCENTRY0, 0, 0, 0, 0, 0, 1);
    g_ooutfile.DefineF(secondLevel, "Arial", 11, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_BOLD| Constants.FMT_LEFT| Constants.FMT_VTOP | Constants.FMT_TOCENTRY1 , 4, 0, 0, 0, 0, 1);
    g_ooutfile.DefineF(thirdLevel, "Arial", 11, Constants.C_BLACK, Constants.C_TRANSPARENT,  Constants.FMT_LEFT| Constants.FMT_VTOP | Constants.FMT_TOCENTRY2 , 8, 0, 0, 0, 0, 1);
    g_ooutfile.DefineF(fourthLevel, "Arial", 11, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_BOLD| Constants.FMT_LEFT| Constants.FMT_VTOP | Constants.FMT_TOCENTRY3, 12, 0, 0, 0, 0, 1);
    


function outputTOC(  ){
    g_ooutfile.BeginSection(true, Constants.SECTION_INDEX);
    g_ooutfile.OutputLnF("Table Of Contents", "Ariel18BoldCenter" );
    g_ooutfile.OutputLnF("","Ariel18BoldCenter" );
    g_ooutfile.SetAutoTOCNumbering(true)
  
    g_ooutfile.BeginParagraph(Constants.FMT_LEFT, 5, 5, 5, 5, 0, 2, 10);
    g_ooutfile.OutputField( Constants.FIELD_TOC, "Arial", 10,Constants.C_BLACK, Constants.C_TRANSPARENT,  Constants.FMT_LEFT);    
    g_ooutfile.EndParagraph(); 
    //g_ooutfile.EndParagraph();     
    g_ooutfile.EndSection();
}//END::outputTOC()

g_ooutfile.OutputLnF("Executive Summary", firstLevel);

and the code for the hiper link goes like this

g_ooutfile.DefineF("insteadOfHeading", "Arial", 11, Constants.C_BLACK, Constants.C_TRANSPARENT,  Constants.FMT_BOLD| Constants.FMT_LEFT| Constants.FMT_VTOP  | Constants.FMT_LINKTARGET | Constants.FMT_TOCENTRY1, 4, 0, 0, 0, 0, 1);
g_ooutfile.DefineF("insteadOfHeading2", "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT,  Constants.FMT_BOLD| Constants.FMT_LEFT| Constants.FMT_VTOP  | Constants.FMT_LINKTARGET | Constants.FMT_TOCENTRY2, 8, 0, 0, 0, 0, 1);

g_ooutfile.OutputLinkF(ScreenViewAppName,ScreenViewAppName,"Ariel10LeftLink");


g_ooutfile.OutputLnF(ScreenViewAppName, "insteadOfHeading");

Thank you very much in advance,
Gilad

0
by Gilad Wilk
Posted on Mon, 01/09/2012 - 16:16

Hi,
After I added to my report the Context.setProperty("use-new-output",true) command my table of context disappeared and my internal hyperlink connection got scrambled,
Can anyone please help me?

The code for the TOC goes like this

 g_ooutfile.SetTOCFormat(0, "Arial", 11, Constants.C_BLACK, Constants.C_TRANSPARENT,Constants.FMT_BOLD| Constants.FMT_LEFT, 0, 0, 0, 0);
    g_ooutfile.SetTOCFormat(1, "Arial", 11, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_BOLD| Constants.FMT_LEFT ,1, 1, 0, 0);
    g_ooutfile.SetTOCFormat(2, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT,  Constants.FMT_LEFT ,2, 2, 0, 0);
    g_ooutfile.SetTOCFormat(3, "Arial", 9, Constants.C_BLACK, Constants.C_TRANSPARENT,Constants.FMT_BOLD|  Constants.FMT_LEFT ,3,10, 0, 0);
    
    
    var firstLevel = "HEADING 1"
    var secondLevel = "HEADING 2"
    var thirdLevel = "HEADING 3"
    var fourthLevel = "HEADING 4"
    
    g_ooutfile.DefineF(firstLevel, "Arial", 12, Constants.C_BLACK, Constants.C_TRANSPARENT,  Constants.FMT_BOLD|Constants.FMT_LEFT| Constants.FMT_VTOP | Constants.FMT_TOCENTRY0, 0, 0, 0, 0, 0, 1);
    g_ooutfile.DefineF(secondLevel, "Arial", 11, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_BOLD| Constants.FMT_LEFT| Constants.FMT_VTOP | Constants.FMT_TOCENTRY1 , 4, 0, 0, 0, 0, 1);
    g_ooutfile.DefineF(thirdLevel, "Arial", 11, Constants.C_BLACK, Constants.C_TRANSPARENT,  Constants.FMT_LEFT| Constants.FMT_VTOP | Constants.FMT_TOCENTRY2 , 8, 0, 0, 0, 0, 1);
    g_ooutfile.DefineF(fourthLevel, "Arial", 11, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_BOLD| Constants.FMT_LEFT| Constants.FMT_VTOP | Constants.FMT_TOCENTRY3, 12, 0, 0, 0, 0, 1);
    


function outputTOC(  ){
    g_ooutfile.BeginSection(true, Constants.SECTION_INDEX);
    g_ooutfile.OutputLnF("Table Of Contents", "Ariel18BoldCenter" );
    g_ooutfile.OutputLnF("","Ariel18BoldCenter" );
    g_ooutfile.SetAutoTOCNumbering(true)
  
    g_ooutfile.BeginParagraph(Constants.FMT_LEFT, 5, 5, 5, 5, 0, 2, 10);
    g_ooutfile.OutputField( Constants.FIELD_TOC, "Arial", 10,Constants.C_BLACK, Constants.C_TRANSPARENT,  Constants.FMT_LEFT);    
    g_ooutfile.EndParagraph(); 
    //g_ooutfile.EndParagraph();     
    g_ooutfile.EndSection();
}//END::outputTOC()

g_ooutfile.OutputLnF("Executive Summary", firstLevel);

and the code for the Hyperlink goes like this

g_ooutfile.DefineF("insteadOfHeading", "Arial", 11, Constants.C_BLACK, Constants.C_TRANSPARENT,  Constants.FMT_BOLD| Constants.FMT_LEFT| Constants.FMT_VTOP  | Constants.FMT_LINKTARGET | Constants.FMT_TOCENTRY1, 4, 0, 0, 0, 0, 1);
g_ooutfile.DefineF("insteadOfHeading2", "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT,  Constants.FMT_BOLD| Constants.FMT_LEFT| Constants.FMT_VTOP  | Constants.FMT_LINKTARGET | Constants.FMT_TOCENTRY2, 8, 0, 0, 0, 0, 1);

g_ooutfile.OutputLinkF(ScreenViewAppName,ScreenViewAppName,"Ariel10LeftLink");


g_ooutfile.OutputLnF(ScreenViewAppName, "insteadOfHeading");

Thank you very much in advance,
Gilad

0

Featured achievement

Question Solver
Share your expertise and have your answer accepted as best reply.
Recent Unlocks
  • CR
  • BH
  • Profile picture for user Ivan.Ivanov.softwareag.com
  • Profile picture for user mscheid
  • MS
  • PacMan

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