What's up guys, so I'm busy creating this report that creates a model each time it is run, to create an overview of the business' capabilities etc.
Thing is the higher-ups want all these fancy graphical content, so I've been struggling calculating the x and y co-ordinates
[well not really struggling, but if I wasn't good at maths at school I probably wouldn't have a clue of how to go about doing this]
anyways, basically my problem is, I need the output (a RoundedRectangle) to look something like this:
but what I'm getting is this:
with the textOccurrence "CAPABILITIES" sitting underneath that green RoundedRectangle object
//this code creates the RoundedRectangle: var capabilityHeading = newModel.createRoundedRectangle(0, 50, headingWidth, headingHeight); capabilityHeading.setFillColor(Constants.C_GREEN, Constants.C_GREEN, Constants.FILLTYPE_SOLID); //and this creates the textoccurrence: var capabilityText = newModel.CreateTextOcc(capTextPositionX, capTextPositionY, "CAPABILITIES"); // var def = capabilityText.TextDef(); var sHtmlValue = "\<html\>\<body color=\"#90EE90\" \>\<p style\=\"color:#90EE90;margin-left\:0\;margin-bottom\:0\;margin-top\:0\"\>\<span style\=\"font-size\:16pt\;\"\>\<span style\=\"color\:\#000000\;\"\>\<b\>CAPABILITIES\<\/b\>\<\/p\>\<\/body\>\<\/html\>"; def.Attribute(Constants.AT_NAME, lang).setStyledValue(sHtmlValue);
Hi Abdul,
Try setting Z axis order for the occurrences you create, with method setZOrder()
for e.g. with your code
//this code creates the RoundedRectangle: var capabilityHeading = newModel.createRoundedRectangle(0, 50, headingWidth, headingHeight); capabilityHeading.setFillColor(Constants.C_GREEN, Constants.C_GREEN, Constants.FILLTYPE_SOLID); capabilityHeading.setZOrder(0); //and this creates the textoccurrence: var capabilityText = newModel.CreateTextOcc(capTextPositionX, capTextPositionY, "CAPABILITIES"); // capabilityText.setZOrder(1); var def = capabilityText.TextDef(); var sHtmlValue = "\<html\>\<body color=\"#90EE90\" \>\<p style\=\"color:#90EE90;margin-left\:0\;margin-bottom\:0\;margin-top\:0\"\>\<span style\=\"font-size\:16pt\;\"\>\<span style\=\"color\:\#000000\;\"\>\<b\>CAPABILITIES\<\/b\>\<\/p\>\<\/body\>\<\/html\>"; def.Attribute(Constants.AT_NAME, lang).setStyledValue(sHtmlValue);Regards,
Amol Patil