1 / 15

iReport An Introduction TEC01

iReport An Introduction TEC01. Patty White. Agenda. Anatomy of an Aspen Report Formatting Report Fields Adding a New F ield to the Report A Taste of Java: String Methods. Anatomy of an Aspen Report . Input Definition gathers information from user.

lucita
Download Presentation

iReport An Introduction TEC01

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. iReportAn IntroductionTEC01 Patty White

  2. Agenda • Anatomy of an Aspen Report • Formatting Report Fields • Adding a New Field to the Report • A Taste of Java: String Methods

  3. Anatomy of an Aspen Report Input Definitiongathers information from user Java Source gathers data based on user’s input Format Definitiondisplays the data gathered in Java source

  4. iReport – visual reporting tool for JasperReports JasperReports – embeddable Java report library – the report engine Download and install iReport 2.0.4 to your computer.http://sourceforge.net/projects/ireport/files/iReport (classic)/iReport-2.0.4 Install Java Runtime Environment (JRE) if you are unable to open iReport.http://java.sun.com Launch iReport from your Desktop (outside of Aspen). You can now edit report formats!

  5. District View: Tools > Reports * Windows only (no Mac or Linux). Not recommended for customizations.

  6. Modify a Report Format Definition District View: Tools > Reports SYS-STD-010 A system-delivered report. When you make a copy of the report, replace with a 3-character district/school code. ADM – Admin ATT – Attendance CND – Conduct • GRD – Grades • HTH – Health • SCH – Schedule • STD – Student • STF – Staff

  7. Options > Copy • Name does not have to be unique, but the Report ID does. • Keep the original Report ID, replacing SYS with 3-character district/school code. • Weight = priority • Changing the version of the report engine (JasperReports) can have adverse effects. • Leave the Custom checkboxes unchecked since we are copying the report, not modifying it. Birthday List XXX-STD-010

  8. Make a copy. Download Format Definition . Edit using iReport. Upload Format Definition . Use Options > Compile Format. If you get compile time errors, return to step 3. Save the report. To test, use Options > Run.Or navigate to screen where report exists in Reports menu. Hide original SYS- version by un-checking all views on report’s Navigation sub-tab.

  9. Customizing a report: adding a field • Determine the following: • Is new field on report’s base table? Yes > go to step 2. • Is new field on related table? Yes > go to step 3. • Add field to report’s base table. • Specify field with Java name from Data Dictionary. • Right-click in Document structure, and select Add. • Enter Java name of field. • Use this field in your report with the syntax $F{fieldName} • Sample screens show syntax $F{gradeLevel}

  10. Add field to related table. • Right-click in Document structure, and select Add. • Specify related table, then field. Examples: • person.genderCode person.dob • person.lastNameperson.firstName • Attendance, conduct or grades report require specifying Student table since report is based on something else (attendance, conduct or grades). • student.gradeLevel • student.person.dob • Use these fields in your report with the syntax $F{fieldName} • $F{person.genderCode} or $F{student.fieldB023}

  11. Reports with get() function • Another way of referencing fields on related tables (not Base table of report) • Advantage of the get() function: only need to define table (student, person, school, etc.) in field list • $F{student.gradeLevel} = $F{student}.getGradeLevel() • $F{student.fieldB023} = $F{student}.getFieldB023() • $F{person.dob} = $F{person}.getDob()

  12. Taste of Java • String Methods • toUpperCase() • string.toUpperCase() • $F{nameView}.toUpperCase() • trim() – removes white space from both ends of string • string.trim() • $F{nameView}.trim() • substring() - returns selected block of characters. • string.substring(intbeginIndex, intendIndex) • $F{person.firstName}.substring(0,1) For a complete list of the Java string class methods: http://java.sun.com/javase/7/docs/api/

  13. String Comparisons • equals() and not equal • string.equals(anObject) !string.equals(anObject) • $F{yog}.equals(“2010”) !$F{yog}.equals(“2010”) • length() • string.length() • $F{homeroom}.length() • IF/Then/Else statement • Comparison ? result_if_true : result_if_false • $F{homeroom}.length()==0 ? “N/A” : $F{homeroom} • If length of homeroom field = 0, print “N/A”, otherwise print homeroom.

  14. Thank you. pwhite@x2dev.com

More Related