Jump to content

Recommended Posts

I have a report data page that lists all customers and purchase orders through a left outer join view that shows ALL Customers and Purchase Orders, regardless of the whether the PONum field is blank or contains a PO Number. How can I label the blank fields to show something like "No Orders " instead of a blank field. 

All suggestions are greatly appreciated.

Link to comment
Share on other sites

Thanks for your suggestion Christopher.

Edit: well I did have some luck, I found the text string wasn't closed with a ' within the script.

In a tabular report, all elements are already displayed on the same line. 

Now with the HTML Block just below the PO element, the String displays but in the next field (the html block itself, of course) next to the PO. 
Now that the script works, its a matter of figuring out how to insert the text string into the PO element.


Link to comment
Share on other sites

Hello JEllington,


If I understand correctly, you could just modify Christopher's script slightly to instead be the following and then remove your original field/column. You would then only use the HTML block. 

 if('[@field:FIELDNAME]' == '') {
document.write('No Orders');
} else {document.write('[@field:FIELDNAME]');}

Alternatively you could use a Calculated field instead of the HTML Block which would allow you to sort by this new value too. In that case, you can use the following.

WHEN [@field:FIELDNAME]=''
THEN 'No Orders'


Link to comment
Share on other sites

COdell, Thank you for your solutions.
The modified script works great. (Thanks to Christopher and Yourself)

I do like your solution of using a calculated field, for the sorting. Although the coding for the WHEN - THEN statement does not display any text and returns a blank field. the ELSE statement does insert the PO number correctly though.

The other Calculated Field option is to insert a IsNull function..
IsNull([@field:Order_Num], '0')


Now I am faced with the dreaded designers question of aesthetics... do I show the numeric value of 0 for blank fields with sorting (calculated field) or text describing why the field is blank (JS) without the sorting option.

Ohh Bother


EDIT Solution: I used both a calculated field and a HTML block w/JS.  With the HTML Block labeled P/O Number and..

 if('[@field:Order_Num]' == '') {
document.write('Not Recorded');
} else {document.write('Completed');}



Then a Calculated Field with a label of Progress and using..


IsNull([@field:Order_Num], '0')


showing only numerical values in this column.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...