kmn Posted November 24, 2016 Share Posted November 24, 2016 Hi All,How to implement the following array to a field in jasperDim list As String List = TRIM(UCASE(TranStat))Dim array() As String Dim numberOfElements As Integer numberOfElements = ListToArray( list, array, "," )Dim text2 As String 'Dim temp As StringDim i As Integer If Trim(LANG) = "" OR Trim(LANG) = "ENG" ThenFor i = 1 To numberOfElements If array(i)= "CANCELED" Then text2 = text2 & "Canceled,"ElseIf array(i)= "EXECUTED" Then text2 = text2 & "Executed Orders,"ElseIf array(i)= "FAILING" Then text2 = text2 & "Failing,"ElseIf array(i)= "OPEN" Then text2 = text2 & "Open Orders,"ElseIf array(i)= "PENDFAIL" Then text2 = text2 & "Pending and Failing,"ElseIf array(i)= "PENDING" Then text2 = text2 & "Pending,"ElseIf array(i)= "UNVERIFIED" Then text2 = text2 & "Unverified,"ElseIf array(i)= "PENDCANC" Then text2 = text2 & "Pending Cancellation,"Else text2 = text2 & array(i)End If Next i text2 = Left(text2 ,(Len(text2 )-1)) Else For i = 1 To numberOfElements If array(i)= "CANCELED" Then text2 = text2 & "," & BtreeHelper.getTranslationNew("Canceled")ElseIf array(i)= "EXECUTED" Then text2 = text2 & "," & BtreeHelper.getTranslationNew("Executed Orders")ElseIf array(i)= "FAILING" Then text2 = text2 & "," & BtreeHelper.getTranslationNew("Failing")ElseIf array(i)= "OPEN" Then text2 = text2 & "," & BtreeHelper.getTranslationNew("Open Orders")ElseIf array(i)= "PENDFAIL" Then text2 = text2 & "," & BtreeHelper.getTranslationNew("Pending and Failing")ElseIf array(i)= "PENDING" Then text2 = text2 & "," & BtreeHelper.getTranslationNew("Pending")ElseIf array(i)= "UNVERIFIED" Then text2 = text2 & "," & BtreeHelper.getTranslationNew("Unverified") ElseIf array(i)= "PENDCANC" Then text2 = text2 & "," & BtreeHelper.getTranslationNew("Pending Cancellation") Else text2 = text2 & array(i)End If Next i text2 = Right(text2 ,(Len(text2)-1))End if Link to comment Share on other sites More sharing options...
markus.deindl Posted November 28, 2016 Share Posted November 28, 2016 Having this amount of code in a Text Field is not really useful.Better just create a small Scriptlet. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now