javascript code snippets used in ccpro 2012 conference presentation ...

March 31, 2017 | Author: Anonymous | Category: Javascript
Share Embed


Short Description

Handout for CCPRO 2012 Presentation: Informer Magic How to create a JavaScript field in Informer: Inside Informer Report...

Description

Karen’s Most Used JavaScript Code Snippets Handout for CCPRO 2012 Presentation: Informer Magic

How to create a JavaScript field in Informer: Inside Informer Report, Click Columns, Add Calculations, Script. Then give your Script a Header (name), type the JavaScript inside the Expression box and be sure to click “Add Calculation” at the bottom before hitting Close.

Other important items to know about Informer/JavaScript:  



 

Java 7 (at least) needs to be loaded on your server for JavaScript to render properly in Informer. Field attributes play a role in how the JavaScript is rendered by Informer. If your JavaScript isn’t working properly and you’re fairly certain your code is correct, request that field attributes be checked before giving up on your code. Informer is just a back-end extraction/reporting tool. It does not come loaded with all Ellucian files and fields. Each file and field must be added to Informer. If you have old QB queries that have files/fields that are not showing in Informer, contact your Informer administrator to have them added. Or if you get reports (screenshots) from other colleges that have files/fields that you do not have in Informer at your college, it is possible that those fields can be added, if they are Ellucian delivered fields. Linkages between files are critical to report creation in Informer. If you need one, request it! Resources: http://www.w3schools.com/js/default.asp, http://www.entrinsik.com/forums/

1

Example 1: Calculations and color coded alerts Color Coded Alert (Alert): if(seatsLeft 0) {"PT";} else {"NT";}

6

Example 6: Calculation involving multi -valued fields Summing all elements in the multi-valued field (Sum_All_Creds): var sum = 0; if (studentTerms3_stccred != null) { for (var i = 0; i < studentTerms3_stccred.length; i++) { sum += parseFloat(studentTerms3_stccred[i]); } } Summing some of the elements (Sum_Active_Creds): var sum = 0; if (studentTerms3_stccred != null ) { for (var i = 0; i < studentTerms3_stccred.length; i++) if(studentTerms3_stccurrentstatus[i] != "X" && studentTerms3_stccurrentstatus[i] !="D" && studentTerms3_stccurrentstatus[i] != "W" && studentTerms3_stccurrentstatus[i] != "C") { sum += parseFloat(studentTerms3_stccred[i]); } }

7

Example 7: Other handy tricks…separating fields, concatenating fields, adding zeros to IDs, showing the run date in a report Substrings and Indexing id.substring(0,7); var first=id.substring(8); first.substring(0,first.indexOf("*")); var first=id.substring(8); first.substring(first.indexOf("*")+1); Concatenation just_ID+"*"+just_Term+"*"+just_Level Adding Zeros to IDS var returnText = studentTerms_students1_id; for (i=returnText.toString().length;i
View more...

Comments

Copyright © 2017 DATENPDF Inc.