IReport on a Mac

From MTHWiki

(Difference between revisions)
Jump to: navigation, search
Line 62: Line 62:
Once the datasource is setup you can open categorized_p100.jrxml through File-Open menu in iReport, your screen should look like the following:
Once the datasource is setup you can open categorized_p100.jrxml through File-Open menu in iReport, your screen should look like the following:
-
[[Image:Ireportmac.png]]
+
[[Image:Ireportmac.png|thumb|center|600px]]

Revision as of 04:58, 22 January 2011

Introduction

My Money is using JasperReports as its Reporting engine. Jasper is open sourced, actively developed, has a large community of users and is generally generally well understood (wikipedia) piece of software code. We at MTH Software like it and trust it enough to embed it into our own software.

To actually design a report for My Money you need a front-end software for Jasper reports, there is a bunch of 3rd party tools we prefer iReport, it is free, relatively fast and seems to be bug free.


iReport on Mac

Please download iReport for Mac, you can get it from JasperForge, please get the latest version.

Before starting to use iReport please create a folder on your system where you will be keeping your custom reports, for the purposes of this article lets call it CustomReports .

Please locate MyMoney on your system (it will most likely reside in Applications folder) and right click on it to see "Show Package Contents" menu. Please navigate inside of the package and copy a system report that you would like to edit, for example to edit report that categorizes transactions please locate categorized_p100.jrxml under Contents/Resources/system/reports/built-in

Please also copy report syles file called styles.jrtx

To connect to MyMoney database you will need to get a special database driver, you can get it from MTH Website at mth_derby Please save this file to the CustomReports folder as well.


At this point your CustomReports folder should look like the following:


Image:Customreport.png


To start using iReport with MyMoney you will need to setup the datasource in iReport first. Please start iReport and select preferences, then iReport then Classpath (2nd tab after the General). Please add mth_derby.jar to your classpath by clicking on add JAR then navigating to CustomReports folder and then selecting mth_derby.jar

You classpath screen should look like the following:


Image:Classpath.png


To setup new Datasource please click on "Report Datasources" button, it is usually located next to the "Empty Datasource/Sample Datasource" choice list.


When prompted please make the following choices:

DataSource Type: Database JDBC Connection

Name: MoneyDB

JDBC Driver: org.apache.derby.jdbc.EmbeddedDriver

JDBC URL: this should be location to your database, for example jdbc:derby:/Users/username/Desktop/Test/Test/moneyDB


Your Datasource should look like the following:


Image:Derbyconnect.png


Press Test, leave User Name and Password blank, your connection should be successful.

If you can't connect to the database please see this list of common iReport problems and resolutions

How_to_create_a_custom_Tax_report_in_My_Money#Some_common_problems_that_you_may_encounter_while_connecting_to_database_from_iReport


Once the datasource is setup you can open categorized_p100.jrxml through File-Open menu in iReport, your screen should look like the following:

Personal tools