I am new to report scripting and have a beginner's question: 

I created an ARIS report using the WYSIWYG editor, and it creates a table which lists attributes of a requirements object. 

Some attributes may be empty, and I want to show the table ros (for AT_EXT_PAGE_LINK_2 and  AT_EXT_PAGE_TITL2) only if the LINK2 is not empty. I found no way to define this in WYSIWYG, so I am trying to edit the code (see below).

While it runs, it does not produce the correct result. In debug mode, I can see that it does not recognise p_aObjOcc1[i2].ObjDef().Attribute(Constants.AT_EXT_PAGE_LINK_2, nLocale as an empty string, and getString(p_aObjOcc1[i2].ObjDef().Attribute(Constants.AT_EXT_PAGE_LINK_2, nLocale) also doesn't work as expected. 

What would be the correct "if" statement to use here? 


/* show table row only if link is not empty */
if (p_aObjOcc1[i2].ObjDef().Attribute(Constants.AT_EXT_PAGE_LINK_2, nLocale) !=""){    
	p_output.TableRow()
    p_output.ResetFrameStyle()
    p_output.TableCell("", 15.35, getString("ID_DEFAULT_FONT"), 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0,  Constants.FMT_VTOP |  Constants.FMT_LEFT, 0)
    p_output.BeginParagraphF(getString("ID_STYLE_RD_DEFAULT"))
    writeData39(p_output, p_aObjOcc1[i2].ObjDef().Attribute(Constants.AT_EXT_PAGE_TITL2, nLocale))
    p_output.EndParagraph()
    p_output.TableCell("", 84.65, getString("ID_DEFAULT_FONT"), 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0,  Constants.FMT_VTOP |  Constants.FMT_LEFT, 0)
    p_output.BeginParagraphF(getString("ID_STYLE_RD_DEFAULT"))
    writeData40(p_output, p_aObjOcc1[i2].ObjDef().Attribute(Constants.AT_EXT_PAGE_LINK_2, nLocale))
    p_output.EndParagraph()
}

 or register to reply.

Notify Moderator