IReport on a Mac

From MTHWiki

(Difference between revisions)
Jump to: navigation, search
Line 93: Line 93:
-
To categorize and summarize report on a new criteria one needs to create a new Report group, in this case we will be creating a group where all checks sharing the same number are grouped together and their combined amount is calculated and displayed on the report.
+
To categorize and summarize report on a new criteria you will need to create a new Report group, in this case we will be creating a group where all checks sharing the same number are grouped together and their combined amount is calculated and displayed on the report.
Line 101: Line 101:
[[Image:Addreportgroup.png|thumb|center|600px]]
[[Image:Addreportgroup.png|thumb|center|600px]]
 +
 +
 +
Please specify that the new group needs to operate on CHECKNUM field and give it a name, for example CHECKNUM. You probably will want to have group headers and footers if you want to show relevant group information, so you can leave rest of the settings as it is.
 +
 +
 +
[[Image:Checkgroup.png|thumb|center|600px]]

Revision as of 03:35, 25 January 2011

Contents

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:



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:



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:



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:


Changing reports

Lets try to change the report somewhat, for the purposes of this article lets assume that we want to:

  1. Sort Transactions by their check number first and,
  2. Categorize Transactions by their check number, i.e. transactions sharing the same check number should be grouped together


Resorting Report

To apply different sorting you will need to change the default SQL query a bit, please open SQL Query Editor in iReport, ckecl in Report Query, and locate "Order By Section".

Please add new sorting order by adding MMY_SPLIT.CHECKNUM to the list of the sorting conditions. This tells the SQL Processor to order the results first by the field CHECKNUM which contains check numbers, then by other conditions, such as categories, transaction dates, etc.



You can always test the editing by running reports in place -- if you switch into the "Preview" mode and your database connection is defined to open your Money file you will see the results right away



Adding a new Report Group

To categorize and summarize report on a new criteria you will need to create a new Report group, in this case we will be creating a group where all checks sharing the same number are grouped together and their combined amount is calculated and displayed on the report.


To get started please right click somewhere on the report and select "Add New Group" menu



Please specify that the new group needs to operate on CHECKNUM field and give it a name, for example CHECKNUM. You probably will want to have group headers and footers if you want to show relevant group information, so you can leave rest of the settings as it is.


Personal tools