Edit or Customize PDF output HELP!!!

1,164 views
Skip to first unread message

micheal gizz

unread,
Jan 8, 2014, 10:52:28 PM1/8/14
to idem...@googlegroups.com
hi i am running idempiere in eclipse and editing some codes what i want to know is how to edit or customize the pdf of the existing JasperReport standard format idempiere using java . Like chnage its font or text style or even the background color

Deepak Pansheriya

unread,
Jan 9, 2014, 12:48:48 AM1/9/14
to idem...@googlegroups.com
For Jasper report,
you need to take .jrxml file and change it in iReport designer

micheal gizz

unread,
Jan 9, 2014, 12:50:51 AM1/9/14
to idem...@googlegroups.com
Where is this .jrxml located in the idempiere im using eclipse . or its default .jrxml

Thomas Bayen

unread,
Jan 9, 2014, 3:06:10 AM1/9/14
to idem...@googlegroups.com
Hi Michael,

There is no standard Jasper Report. Idempiere uses an internat report.
To connfigure it you can begin in the window "print format". It open
e.g. if you see a report and press the configure button (the crossed
tools) in the toolbar.

(What I said about the UI is guilty for the Swing client, but zk should
be similar.)

JasperReports is just an option to extend the program. It is much more
flexible but you need to define a *.jrxml file with an external tool
(e.g. iReport).

regards,
Thomas
> --
> You received this message because you are subscribed to the Google
> Groups "iDempiere" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to idempiere+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/idempiere/85fc4d76-bd4c-4986-b16f-f814c5fc27ef%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

mit freundlichen Gr��en,

Thomas Bayen
--
Jakob Bayen KG, Bleichpfad 20-22, 47799 Krefeld
AG Krefeld HRA 416 Tel +49/2151/65 80 9-0

micheal gizz

unread,
Jan 9, 2014, 3:32:31 AM1/9/14
to idem...@googlegroups.com
so how can i extend to jasperreport to the standard report ?

Thomas Bayen

unread,
Jan 9, 2014, 3:44:51 AM1/9/14
to idem...@googlegroups.com
http://wiki.idempiere.org/en/Jasper_Report_Master_Detail

See also the given links to the adempiere wiki.

Thomas
> --
> You received this message because you are subscribed to the Google
> Groups "iDempiere" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to idempiere+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/idempiere/97988601-5fb7-4653-b6a5-d2f8b1d77e8a%40googlegroups.com.

micheal gizz

unread,
Jan 9, 2014, 6:51:25 AM1/9/14
to idem...@googlegroups.com
here is the tutorial i followed http://agentmonroe.wordpress.com/2012/10/05/eclipse-downloads/
and now i am able to edit the idempiere using java now i just want to know how to edit the PDF output when i export the data
like changing the color of the header or editing the pages . is there a .java file there creates the PDF file or a java class 


Thomas Bayen

unread,
Jan 9, 2014, 10:39:21 AM1/9/14
to idem...@googlegroups.com
Hi Micheal,

Displaimer: I am using the german Swing Client and your screenshots
shows you use english zk. So please be careful if you follow my advices
because things can be slightly different. :-)

It seems you pressed the "Report" button and then you choosed to "Export
PDF". If you do not export PDF you will come to the report output
window. AFAIR in zk you can switch between html and pdf output then. In
this window you can open the "print format" window by selecting the
"crossed tools" button in the toolbar.

The "print format" window is the starting point to change the print
output. There is a reference to "print table format" and "print paper".
These three windows influence the output of the pdf. I believe what you
talk of is in "print table format". You can change the settings there
and refresh the pdf output in the other window to see what happens.

The internal report generator is quite good if you want to fast create
tables. I never hacked it's code because most people who want to do
harder things use JasperReports. So I can't tell you where the code is.
try something like "find | grep -i report | grep -iv jasper". :-)



JasperReports is very flexible if you want to influence every single
point. But it is a whole other approach. If you create a Jasper-Process
and set it in the print format the java class ReportStarter is called
and starts the jasper library with your prepared *.jrxml file. There are
some good explanation pages in the adempiere wiki. I gave you a link to
them.

Thomas
> <https://lh5.googleusercontent.com/-aPqijSdYzmY/Us6NA0mzSQI/AAAAAAAAAFY/Uc1H9sFgqJk/s1600/Untitled.png>

micheal gizz

unread,
Jan 10, 2014, 1:13:33 AM1/10/14
to idem...@googlegroups.com

Thx for the reply 
i can now customize it a little and i found the java codes of the output PDF
its LayoutEngine.java  \idempiere\org.adempiere.base\src\org\compiere\print\layout\LayoutEngine.java
my problem now is, the only thing i can edit is the Header and Footter i cant actualy edit the content any help ?

and regarding what you said about the JasperProcess can you show mo how to do it
or where to begin i already seen the codes in the ReportSatrter.java and i cant locate where to begin coding
to change the standard reports of the PDF

micheal gizz

unread,
Jan 10, 2014, 2:59:04 AM1/10/14
to idem...@googlegroups.com
or can yu give me instruction on how to do it

Thomas Bayen

unread,
Jan 10, 2014, 3:10:34 AM1/10/14
to idem...@googlegroups.com

Am 10.01.2014 07:13, schrieb micheal gizz:
>
> Thx for the reply
>
> i can now customize it a little and i found the java codes of the output PDF
> its LayoutEngine.java
> \idempiere\org.adempiere.base\src\org\compiere\print\layout\LayoutEngine.java
> my problem now is, the only thing i can edit is the Header and Footter i
> cant actualy edit the content any help ?

I do not really understand what you want. Follow the code between header
and footer. :-) Use the eclipse debugger.


> and regarding what you said about the JasperProcess can you show mo how
> to do it
> or where to begin i already seen the codes in the ReportSatrter.java and
> i cant locate where to begin coding
> to change the standard reports of the PDF

When using JasperReports there is not "standard" report. You give you
jasper definition file and the ReportStarter class executes it. This
file is a xml definition that can be handcrafted after reading the
documentation of JasperReports or can be created using a GUI Tool like
iReport (recommended way).

* http://community.jaspersoft.com/wiki/getting-started-ireport-designer
* http://community.jaspersoft.com/wiki/getting-started-jasperreports-library


mit freundlichen Grüßen,

Thomas Bayen

VuongCT

unread,
Jan 10, 2014, 3:30:26 AM1/10/14
to idem...@googlegroups.com
ReportStarter.java handles the Jasper reports designed in iReports(mainly). Reference: http://www.adempiere.com/ADempiere/Compiere_JasperReports_Integration_HowTo
This approach is pretty similar on both Adempiere and Idempiere.
However when you create a Report Process on Idempiere, you don't need to declare org.compiere.report.ReportStarter in Classname field of Process Window. 
Then attach the .jrxml file to the process , and declare "attachment:<reportfilename>.jrxml" (without quote) in Jasper Report field of Process Window. 
With this approach, you can use a compatible version of iReport to design your own Jasper Report and then use it on Idempiere. Currently Idempiere using jaspereport v5.1.2 library.

The standard internal reports of Idempiere use org.compiere.print.ReportEngine.java in org.adempiere.base bundle to handle the standard way of generating, display and export internal reports of Idempiere. 

So basically these are 2 different types of approach to work with reports in Idempiere.

P/S: Jasper Report can be more powerful, more flexible and less time-consuming when it comes to configurations on Idempiere,but it lacks the drill down function to other related reports on Idempiere. 
If there is any way to implement the drill down functions on Idempiere's Jasper Reports, plz give us a hint, Thomas.

Kind regards,
Message has been deleted
Message has been deleted

micheal gizz

unread,
Jan 12, 2014, 10:37:28 PM1/12/14
to idem...@googlegroups.com
hi thx for reply i did the attachment i created a new report process and added a new jasper process to the report but nothing happen to the The standard internal reports of Idempiere its still the same format dont know what went wrong 

and about editing org.compiere.print.ReportEngine.java i did see any code that will change the layout of the PDF file or the possition of any of the content can you send me any .java file that you customized already i will be a big help . thx for reply
Untitled.png

Heng Sin Low

unread,
Jan 12, 2014, 11:07:48 PM1/12/14
to idem...@googlegroups.com
The class that did all the report layout is LayoutEngine. The internal report engine doesn't make any pdf call directly, it uses java2d call and iText do the translation for pdf output.


--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.

micheal gizz

unread,
Jan 13, 2014, 12:09:13 AM1/13/14
to idem...@googlegroups.com
Do you have any tutorial that edit the content of the LayoutEngine.java so that i can change the style of the PDF or do you have any LayoutEngine.java that you already edited

VuongCT

unread,
Jan 13, 2014, 5:34:08 AM1/13/14
to idem...@googlegroups.com
There is an easier way to achieve what you're trying to do though, maybe you can look into it as a temporary solution.

- First Design your jrxml using iReport so that the output will look exactly the way you want it to be. 
- Then define your jasper report process on iDempiere with parameters that you need to parse into Jasper report to filter your output data (Use parameter value to filter data in report Query when you design it on iReport)
- When you configure your report process, the process parameters required to run the .jrxml file attached have to be defined. There, you can parse some value into the Default Logic field. 
- Open Window, Tab & Field, search for the window including Tab you need to change print output, edit the tab, change Process field to the process you created in the previous step. 
- Log in as GardenWorld Admin, open the window, tab you edited, click Print button on toolbar, there, the parameters inputs already got defined with default values, so you just need to execute the process, new Report Window will open and display the result.

For example: 
- My report process is meant to retrieve all data from GL_Journal Table filter by a specific GL_JournalBatch_ID value which is stored in report input parameter, there, i'm gonna use value "@GL_JournalBatch_ID@" in Default Logic field of the process parameter.
- Now I got a Jasper report process named "Journal Report" with Search Key "JournalReport", i just need to use it in GL Journal tab of GL Journal Batch window. So, with System Admin role, i edit Journal Tab in GL Journal Batch window, change Process field to "Journal Report_JournalReport". Well, it's a combo box which refers to Process table so indeed we can choose from it. Save it, and the Print toolbar button on Journal tab in GL Journal Batch window is ready to be used.

niche

unread,
Jan 16, 2014, 7:15:31 PM1/16/14
to idem...@googlegroups.com
I have did the tutorial you gave me i add a report on jasper process and when i try to run it this error shows up 

caused by: java.lang.ClassNotFoundException: org/apache/xerces/jaxp/SAXParserFactoryImpl
Message has been deleted

VuongCT

unread,
Jan 16, 2014, 8:43:24 PM1/16/14
to idem...@googlegroups.com
- Make sure you design your report in a compatible version of iReport for example iReport 5.1.0.
- Start server with all required plugins, through eclipse run configurations, add required pluggins. Then make sure org.adempiere.report.jasper.library plug-in is activated, org/apache/xerces/jaxp/SAXParserFactoryImpl is located inside org.apache.xerces_2.9.0.v......jar in Plug-in Dependencies.
Reply all
Reply to author
Forward
0 new messages