How to customize reports width and height

From MTHWiki

(Difference between revisions)
Jump to: navigation, search
Current revision (03:05, 10 January 2014) (edit) (undo)
 
Line 43: Line 43:
=== Changing Reports Print Width and Length on a Mac ===
=== Changing Reports Print Width and Length on a Mac ===
 +
 +
Changing report parameters on a Mac is similar to Windows procedure:
Changing report parameters on a Mac is similar to Windows procedure:
 +
You need to find out where your application data is stored, the easiest way of doing it is to start MyMoney, use View-Show console menu and type the following command in the console - <pre>print(SwingMoneyView.singleInstance.environment.getUserApplicationHome());</pre>
You need to find out where your application data is stored, the easiest way of doing it is to start MyMoney, use View-Show console menu and type the following command in the console - <pre>print(SwingMoneyView.singleInstance.environment.getUserApplicationHome());</pre>
Line 62: Line 65:
Please start MyMoney.app, switch to Reports folder - if you did everything correctly you will see User Reports section that will contain your newly copied report. If you update MyMoney in the future your User defined report will survive
Please start MyMoney.app, switch to Reports folder - if you did everything correctly you will see User Reports section that will contain your newly copied report. If you update MyMoney in the future your User defined report will survive
- 
Line 74: Line 76:
By default, in JasperReports pages are visualized as Portrait. The orientation being an attribute at report level, its value applies to all pages in the generated document.
By default, in JasperReports pages are visualized as Portrait. The orientation being an attribute at report level, its value applies to all pages in the generated document.
 +
Below is a code snippet showing how to set in a report the Landscape orientation:
Below is a code snippet showing how to set in a report the Landscape orientation:
Line 86: Line 89:
</pre>
</pre>
-
Please open /Containers/com.mth.money/Data/Library/.mymoney/system/reports/user/all_transactions_p100.jrxml in any text editor (TextEdit.app for example) and orientation="Landscape" to it
+
Please open /Containers/com.mth.money/Data/Library/.mymoney/system/reports/user/all_transactions_p100.jrxml in any text editor (TextEdit.app for example) and add orientation="Landscape" to it
Please start MyMoney and run your report - it should be in a Landscape mode
Please start MyMoney and run your report - it should be in a Landscape mode

Current revision

Changing Reports Print Width and Length

By default all reports have print sizes of A4 ISO 216 standard - 210 × 297 mm or 595 x 842 pixels

Currently there is no easy way to change the report size other than by manually editing report templates.

To do so please open open My Moneys reports directory under system/reports/built-in

For example on windows this would be in C:\Program Files\MTH\My Money\system\reports\built-in. Please locate report template you want to modify, report templates will have extension jrxml

For example, to modify Customizable Networth Chart you would need to edit \system\reports\built-in\charts\networth_p200.jrxml

Be sure to make a backup before editing any file.

Please open networth_p200.jrxml in any text editor, you will see the following report definition at the top


<jasperReport
		 name="networth_p200"
                 orientation="Landscape"
		 pageWidth="842"
		 pageHeight="595"

To change the Width and Height simply edit the corresponding values, for example US Letter format is 8½ by 11 inches or 612 x 792 pixels

As this particular report is in Landscape mode the width and height values need to be interchanged,

<jasperReport
		 name="networth_p200"
                 orientation="Landscape"
		 pageWidth="792"
		 pageHeight="612"


Please restart My Money, your report will be recompiled the first time you use it


Changing Reports Print Width and Length on a Mac

Changing report parameters on a Mac is similar to Windows procedure:


You need to find out where your application data is stored, the easiest way of doing it is to start MyMoney, use View-Show console menu and type the following command in the console -
print(SwingMoneyView.singleInstance.environment.getUserApplicationHome());
Please note the output, this is where your user data is written to, for example it could be
/Users/xxx/Library/Containers/com.mth.money/Data/Library/.mymoney


  • Please locate MyMoney app, it is usually installed into /Applications folder
  • Please Control-Click (or right click) on MyMoney.app, select Show package contents
  • Navigate to Contents/Resources/System/Reports/built-in
  • Please pick a report you would like to change, for example all_transactions_p100.jrxml
  • From Finder menu please select Edit-Copy (or Command-C)
  • Please open a second Finder window and use Go-Go to folder to navigate to the user data (/Users/xxx/Library/Containers/com.mth.money/Data/Library/.mymoney)
  • While in user data folder please change to system, if you don't have a 'reports' folder please create it, and then please create 'user'folder so your structure looks like /Users/xxx/Library/Containers/com.mth.money/Data/Library/.mymoney/system/reports/user
  • Please copy /Applications/MyMoney.app/Contents/Resources/System/Reports/built-in/all_transactions_p100.jrxml into /Users/xxx/Library/Containers/com.mth.money/Data/Library/.mymoney/system/reports/user/all_transactions_p100.jrxml


Please start MyMoney.app, switch to Reports folder - if you did everything correctly you will see User Reports section that will contain your newly copied report. If you update MyMoney in the future your User defined report will survive


A page is considered to be in a Landscape orientation when its width and height appear as interchanged. In order to manage its pages layout, the <jasperReport /> element contains the orientation attribute. Values allowed for this attribute are:

   Portrait
   Landscape

By default, in JasperReports pages are visualized as Portrait. The orientation being an attribute at report level, its value applies to all pages in the generated document.

Below is a code snippet showing how to set in a report the Landscape orientation:


<jasperReport
		xmlns="http://jasperreports.sourceforge.net/jasperreports"
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd"
		name="LandscapeReport" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="842" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">

Please open /Containers/com.mth.money/Data/Library/.mymoney/system/reports/user/all_transactions_p100.jrxml in any text editor (TextEdit.app for example) and add orientation="Landscape" to it


Please start MyMoney and run your report - it should be in a Landscape mode

Personal tools