Java Script in Narrative View


I have written a simple conditional Javascript in a Narrative view so that it fetch columns from database and represent the data .

I have used the sample EMP table and the intension is to represent the row for Managers in Green and others in Orange like below :

Javascript in Narratives

The narrative code to drive this as below :

<script type=”text/javascript”>
if(‘@3’==’MANAGER’)
{
document.write(“<font color=green><b> @1 is Manager having salary @4 <br> </b></font>”)
}
else
{
document.write(“<font color=orange><b> @1 is Not Manager having salary @4 <br> </b></font>”)
}
</script>

Javascript in Narratives2

4 thoughts on “Java Script in Narrative View

  1. Hi debasish,

    I have sales growth in a field, if its positive i need to display up arrow sign and if its negative i need to display down arrow sign. I tried with the if else structure u gave here, but its not working. can you please help

    Regards:
    Niladri

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s