a programmer’s discussion of skycoder and crystal reports presented by daniel hornsby and michael...

29
A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

Upload: janiya-quick

Post on 02-Apr-2015

217 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

A Programmer’s Discussion of SkyCoder and Crystal Reports

Presented by Daniel Hornsby and Michael PreslarNorth East Florida Educational Consortium

Page 2: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

Using SkyCoder

Learn how to use SkyCoder to embed local, state, and federal validation edits, resulting in fewer data entry errors and cleaner state and federal reporting. JavaScript experience is recommended. Following the SkyCoder presentation, stick around to talk about the use of Crystal Reports to create complex, customized report cards and other reports.

Page 3: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

What is SkyCoder?

SkyCoder is a tool in Skyward that allows for the customization of fields and screens by embedding JavaScript code on the page. It allows you to customize how Skyward behaves, to a degree, by adding locally-defined logic in addition to Skyward’s logic.

Because of the advanced capabilities of this tool, it should only be utilized by a select few in your district; preferably those with programming experience.

Page 4: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

Enabling SkyCoder for a User

In order for a user to begin using SkyCoder, they first must be given rights to it. To enable SkyCoder, edit a Secured User’s account, set “Allow User to Access SkyCoder” to ‘Yes’, and then save the changes.

That user will then be able to access SkyCoder for any page by clicking the computer monitor icon in the quick access toolbar.

Page 5: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

How does SkyCoder work?

SkyCoder utilizes JavaScript coding in order to directly manipulate fields in a single window. You are not currently able to code across different pages in Skyward, nor are you able to access the underlying database fields that are used on the page.

You can, however, validate fields before committing them to the database, maintaining the integrity of the data.

Page 6: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

What can you use SkyCoder for?

• Built-in SkyCoder abilities:– Hiding or displaying individual fields.– Changing field labels.– Flagging fields as required fields.– Date validation.

Using these provided tools, you can slightly change how Skyward behaves by modifying the page’s normal logic.

Page 7: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

What can you use SkyCoder for? (cont)

In order to do any advanced programming, you will need to create JavaScript functions and attach them to field events.

A function is a series of programming logic that executes whenever it is called. A function can do anything from changing how fields and data are displayed to directly manipulating data.

Page 8: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

What can you use SkyCoder for? (cont)

Field events are actions taken on objects on the page. Common events include: • onload – A page has loaded.• onclick – Clicking on an object.• onmouseover – Hovering over an object.• onchange – An object’s value has changed.• onfocus – An object has focus (you are now working with the object).• onblur – An object no longer has focus.

Skyward provides the ability to auto-generate code to attach on the onchange and onblur events. All other events need to be coded specifically.

Page 9: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

Example #1 – Hiding a Field

Using Skyward’s built-in functions, you can hide a field that your district does not use. The field could be a field intended for another state, or just items that your district does not keep track of.

In this example, we will look at hiding some Minnesota fields on the Mass Assign Transportation Category utility template screen.

Page 10: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

Example #1 – Hiding a Field

In this window, in the Processing Options group at the bottom, there are three Minnesota-specific fields that Florida does not use. Instead of instructing your users not to use these fields, you can use SkyCoder to remove them from the page. Once the code is in place, your users never have to know these options were once available.

Page 11: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

Example #1 – Hiding a Field

To launch SkyCoder, click the SkyCoder icon and look in the bottom left corner for the Add Field Function group. This group contains five premade SkyCoder functions: Hide Fields, Show Fields, Change Labels, Flag Fields as Required, and Validate Date on Save.

Select Hide Fields from the list of functions. In the Labels drop-down list, select the first MN label: MN Transportation Category. Finally, in the Field drop-down list, select the matching MN field: MN Transportation Category. When the options are correct, click Insert Field Function and the JavaScript will be automatically generated.

Repeat for the other two Minnesota fields, Update MN Transportation Category and Use Transportation Code’s MN Category if Valid. When you are complete, click Save.

Page 12: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

Example #1 – Hiding a Field

Close the Mass Assign Transportation Category window and then reopen it. When the window reloads, the three Minnesota fields will be gone.

Note that the title on the page is now green and italicized. This indicates that there is an active SkyCoder modification on the page, which is useful when trying to remember which pages have been coded.

Page 13: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

Example #2 – Adding Hovertext to an Object

You can also use custom JavaScript code to customize an object in Skyward. One of the things that you could add to an object is a tooltip.

A tooltip is a small box that appears next to an object that you are hovering over with the mouse that will display a message (seen to the right). You can configure a message that will inform the user about how the object is intended to be used by the district, or any other information you may want to convey to the user.

Some objects in Skyward already have tooltips linked to them. For the rest that do not, there is a simple and effective single-line of code that can add a tooltip to an object. However, this is code that you must type manually. Skyward does not yet have a way to automatically generate code that will add a tooltip.

Page 14: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

Example #2 – Adding Tooltips to an Object

To add tooltips to an object, you will need to add an attribute to an object using SkyCoder. We’re going to add tooltips to some Grade and General Information fields, found under Student Profile > General > Profile.

Specifically, the Retained, Graduated, and Expelled fields.

Page 15: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

Example #2 – Adding Tooltips to an Object

To reference an object using JavaScript, use document.getElementById(‘objectName’). To add tooltips to that object, you will need to use the setAttribute function to attach a tooltip to it. setAttribute takes two parameters, the name of the attribute (“tooltip”) and the value of the attribute (what you want the tooltip to display). Using the tooltip attribute, Skyward can generate the tooltip on the page based on what’s coded. The completed line of code for adding tooltips is:document.getElementById(‘objectName’).setAttribute(“tooltip”, “Tooltip text”);

Enter this code for each field you want to add a tooltip to, replacing objectName for the name of the field you want to add a tooltip to and the tooltip text with what you would like the tooltip to say. When you are done coding, click Save.

Page 16: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

Example #2 – Adding Tooltips to an Object

Close the window again and reopen it. Now when you hover over the Retained, Graduated, and Expelled fields, you will see the tooltip display with the text that you entered.

Page 17: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

Using SkyCoder for DOE edits.

Using SkyCoder, it is possible to code select Florida DOE state reporting rules into Skyward. This results in MIS spending less time correcting data entry errors prior to state reporting.

One example of a DOE rule that can be coded into Skyward is rule #26 of the Prior School Status/Student Attendance rules, which states:If the Entry Code is E01, then the Prior School/Location: District must be the same as the District Number, Current Enrollment, the Prior School/Location: State/Territory or Commonwealth must be FL, and the Prior School/Location: Country must be US.

Using SkyCoder, it is possible to code this logic into the Entry/Withdrawal Maintenance page.

Page 18: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

Example #3Cross-field Validation (Entry Code and Prior District)

The fields mentioned in the DOE rule can be found on the Entry/Withdrawal Maintenance page under Student Profile > Entry/With.

The fields that will be involved in this SkyCoder script will be:• Entry Code• Prior School’s Distr• Prior School State/Terr• Prior School Country

Page 19: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

Example #3Cross-field Validation (Entry Code and Prior District)

To trigger any functions from SkyCoder, you first have to add an event to an object. The object that you will want to attach this code onto is the Entry Code field.Fortunately, SkyCoder also features a way to easily attach events to objects using the Add Event group. Attaching an event to the ‘onblur’ event guarantees that the programming logic will occur every time the field is visited.

Page 20: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

Example #3Cross-field Validation (Entry Code and Prior District)

Your SkyCoder code should now have a generated function called addEvent, using the values you gave the generator. It’s only a function call, however, so the function’s coding is called from elsewhere.

To code the remaining logic in the DOE edit rule, you will need to programmatically obtain the following data:• Entry code • Prior State• Prior District • Prior Country

To do that, you will need the values stored within the fields that contain them.

Page 21: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

Example #3Cross-field Validation (Entry Code and Prior District)

The resulting code below is a rough draft of the SkyCoder logic that will enforce the DOE rule.

Page 22: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

Example #3Cross-field Validation (Entry Code and Prior District)

Page 23: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

Example #3Cross-field Validation (Entry Code and Prior District)

Once the SkyCoder changes are saved, whenever E01 is entered into the Entry Code field of a new student entry record, the prior district, state, and country fields are automatically updated after exiting the field.

Before:

Page 24: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

Example #3Cross-field Validation (Entry Code and Prior District)

Note the prior district, state, and country fields have been updated. Also note that the description fields to the side of the fields are not populated with the description of the code.

After:

Page 25: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

Example #3Cross-field Validation (Entry Code and Prior District)

Possible improvements to the code could be:• An alert message informing the user of the DOE rule.• Merging other Entry/Withdrawal rules with this one.• Coaxing the description of the prior codes into updating.• Reformatting the code to avoid some programming bad practices.• Instead of a hardcoded (a fixed value), static (does not change)

district number, find a way to possibly make the district number validated against dynamic (value can change programmatically).

There are many ways to code this one DOE edit. Experiment with different functions and programming styles and find one that suits you best.

Page 26: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

Other Possible DOE Edits

Some other possible DOE edits that are, theoretically, programmable include:• Validate Social Security numbers so that they are valid numbers as

defined by the Social Security Administration.• If a course number equals 2222222, then current instruction/service

school number must be a private school.• In Transportation, Days in Term must be greater than zero and less

than one hundred.• Grade Promotion Status must be A, D, P, R, N, or Z.• Cumulative, State Grade Point Averages must be greater than or

equal to zero, and no higher than 40000, unless it is 99999 (with four decimal places).

• If Entry Code is E05, then grade must be either KG or PK.

Page 27: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

Advanced Crystal Reports Development

• Report Cards, Secondary– Elementary– Middle– High

• Student Class History• Test Scores• EOC Grade Verification

• Using Command Tables• Dynamic Sorting

Page 28: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

Contact Information

Michael Preslar, [email protected](386) 329-3888

Daniel Hornsby, Applications [email protected](386) 329-2574

Page 29: A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium

THANK YOU FOR ATTENDING!