ReportEditor WYSIWYG Editor for creating reports

390 views
Skip to first unread message

Martin V

unread,
Jun 13, 2014, 6:04:05 AM6/13/14
to idem...@googlegroups.com

Hello,

after few months of fighting with iDempiere, I've finished first part of ReportEditor mentioned here:

https://groups.google.com/forum/#!searchin/idempiere/print$20editor/idempiere/pFV0qeH70PI/sGCh0xUiQ_kJ


It's still in developement mode, so to be able to run this plugin you have to have eclipse installed and run iDempiere from it.

It's created with aid of NetBeans Visual Library and Swing. So it's available in Swing client only. Logging is (for the present) done by Log4J (because of colouring possibility which I love :) )


What it can:

  • you can easily choose table (or view) to create report to.

  • you can easily choose paper settings loaded from iDempiere (creation of new paper was intended, so its prepared but not implemented yet, there are some issues to think of first)

  • You can load picture, freely to change size. The image is then saved as attachment to printformattitem.

  • Add static text, change text, colour, font (all of this properties are automatically saved in iDempiere system). There can be modified more text elements at the same time.

  • Insert subreport, which can be easily found with the aid of dialog. It can be relative or absolute positioned.

  • change header and footer of report by dragging line represented it. (its prepared to allow of dragging of margins too, but not implemented yet)

  • select multiple elements (for changing positions or properties)

Notes:

All elements are absolutely positioned (except of subreport) and this cant be changed. Relative positioning is complicated, ugly and buggy think. It should be refactored as mentioned below in note about “Field element”)



What it can't:

  • load old reports (even created by ReportEditor)

  • set header and footer by inserting values (but it can be easily implemented)

  • set cling mode where elements are aligned by position of other elements to get better positioning (all elements are totally independent)

  • set position manually by inserting value

  • change ordering of elements

  • insert line and rectangle elements

  • use relative positioning

  • automatically control position of elements in report parts (i.e. you can still add absolutely positioned text to report body, this leads to strange behaviour when there is subreport or Field element)

  • change between form and non form mode

  • add “Field” element [there is huge need of deep study of PrintEngine (but it's really confusing so for me. Its about weeks or months of study) and the imho the best would be total reinvention of it. (or better to create new one, and let the reports created by Editor to be processed by this new engine)]

  • use shortcuts and undo functionality (except ctrl + S for saving and Del for deletion)

  • Automatically prefill values in table chooser based on window from which the editor was run

  • set relative positioning of element


Known issues:

  • when saving report without subreports, there is iDempiere error complaining about no column specified. So you have to load report created in idempiere first and then switch to report created by ReportEditor.

  • When clicked to list of table colums (left bottom side) you cannot delete elements (not know reason and solution yet).


Some screenshots:



You can download sources here:

https://github.com/martin-vavrusak/ReportEditor.git


To be able to run editor there are 3 options:


  1. Programatically

  • Use MainFrame.runProgram() method.

  1. Inserting button to window panel

  • apply included patch pridani_tlacitka_do_klienta_(org.adempiere.ui.swing).patch to org.adempiere.ui.swing package (right click on it and choose Team → Apply Patch).

  • Recompile (clean) this package

  • After this you can run editor by opening some window with tool panel (eg Purchase Order, Invoice, ...) and clicking on ReportEditor text.

  • If you don't like the text and want icon, copy “ReportEditor16.png” and “ReportEditor24.png” to “...\org.adempiere.ui.swing\build\org\compiere\images”. (you have to copy it after each cleaning of org.adempiere.ui.swing package)

  1. creating item in menu

  • Create new process (Application Dictionary -> Report & Process): as a class insert “cz.muni.fi.vavmar.printeditor.IdempiereLauncherProcess

  • Create new menu item using this process (System Admin -> General Rules -> Menu)


Note:

when importing project import it as binary project and as “Plugin developement”. Name it “cz.muni.fi.vavmar.reporteditor” otherwise there could be problems with patch.

Message has been deleted

Martin V

unread,
Aug 1, 2014, 12:26:51 PM8/1/14
to idem...@googlegroups.com
Hello I'm back and the video si comming soon (hopefully next week).

eugenh

unread,
Sep 24, 2014, 6:32:14 AM9/24/14
to idem...@googlegroups.com


Am Freitag, 13. Juni 2014 12:04:05 UTC+2 schrieb Martin V:
  1. creating item in menu

  • Create new process (Application Dictionary -> Report & Process): as a class insert “cz.muni.fi.vavmar.printeditor.IdempiereLauncherProcess

  • Create new menu item using this process (System Admin -> General Rules -> Menu)

Hi Martin,
thanks for your work. I look forward to the video.
Yesterday I tried to test your plugin. But with less succes. Maybe you can help me. First let me explain.
  • I've cloned your git-project to my idempiere-workspace (kepler on win 7)
  • I start a swingclient - this is a configuration to launch the OSGi framework and so get an idempiere-client with no server(!)
  • my decision was your option 3
    • NB: the class name ist now “cz.muni.fi.vavmar.reporteditor.IdempiereLauncherProcess
    • Create new process (see reporteditor-1.PNG)
    • Create new menu item (see reporteditor-2.PNG)
    • ? Is the checked Report-Option OK?
  • now I have a Menu-Item and can test (see reporteditor-3.PNG)
But my first attempt leads to

12:18:00.571-----------> DefaultProcessFactory.newProcessInstance: cz.muni.fi.vavmar.reporteditor.IdempiereLauncherProcess [17]
java.lang.ClassNotFoundException: cz.muni.fi.vavmar.reporteditor.IdempiereLauncherProcess
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at org.adempiere.base.DefaultProcessFactory.newProcessInstance(DefaultProcessFactory.java:64)
at org.adempiere.base.Core.getProcess(Core.java:104)
at org.adempiere.util.ProcessUtil.startJavaProcess(ProcessUtil.java:159)
at org.compiere.apps.AbstractProcessCtl.startProcess(AbstractProcessCtl.java:466)
at org.compiere.apps.AbstractProcessCtl.run(AbstractProcessCtl.java:234)
at java.lang.Thread.run(Thread.java:662)

I'll investigate.
reporteditor-1.PNG
reporteditor-2.PNG
reporteditor-3.PNG

eugenh

unread,
Sep 24, 2014, 7:47:33 AM9/24/14
to idem...@googlegroups.com


Am Mittwoch, 24. September 2014 12:32:14 UTC+2 schrieb eugenh:
I'll investigate ...

Uuups. I forgot to add org.adempiere.plugin.utils to the swingclient-launcher. But now I get:

Exception in thread "ReportEditor-1000039" java.lang.IllegalStateException: org.eclipse.core.runtime.CoreException: Plug-in cz.muni.fi.vavmar.reporteditor was unable to load class cz.muni.fi.vavmar.reporteditor.IdempiereLauncherProcess.
    at org.adempiere.base.equinox.ExtensionList$ExtensionIterator.next(ExtensionList.java:94)
    at org.adempiere.base.equinox.ExtensionList.first(ExtensionList.java:184)
    at org.adempiere.base.equinox.EquinoxExtensionHolder.getExtension(EquinoxExtensionHolder.java:37)
    at org.adempiere.base.DefaultProcessFactory.newProcessInstance(DefaultProcessFactory.java:42)

    at org.adempiere.base.Core.getProcess(Core.java:104)
    at org.adempiere.util.ProcessUtil.startJavaProcess(ProcessUtil.java:159)
    at org.compiere.apps.AbstractProcessCtl.startProcess(AbstractProcessCtl.java:466)
    at org.compiere.apps.AbstractProcessCtl.run(AbstractProcessCtl.java:234)
    at java.lang.Thread.run(Thread.java:662)
Caused by: org.eclipse.core.runtime.CoreException: Plug-in cz.muni.fi.vavmar.reporteditor was unable to load class cz.muni.fi.vavmar.reporteditor.IdempiereLauncherProcess.
    at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
    at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:178)
    at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
    at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
    at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
    at org.adempiere.base.equinox.ExtensionList$ExtensionIterator.next(ExtensionList.java:92)
    ... 8 more
Caused by: java.lang.UnsupportedClassVersionError: cz/muni/fi/vavmar/reporteditor/IdempiereLauncherProcess : Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:616)

eugenh

unread,
Sep 24, 2014, 11:16:06 AM9/24/14
to idem...@googlegroups.com

Am Mittwoch, 24. September 2014 13:47:33 UTC+2 schrieb eugenh:

Unsupported major.minor version 51.0

The reason for this is discussed in
http://stackoverflow.com/questions/18878045/unsupported-major-minor-version-51-0-error-with-eclipse-when-trying-to-reference

Shortly: there is a compiler mismatch - all iDempiere is compiled with Java 1.6  but the new plugin with 1.7

Compiling with 1.6 leads to:

17:00:19.850 IdempiereLauncherProcess.<init>: ctor [23]
Exception in thread "AWT-EventQueue-0" java.lang.Error: Unresolved compilation problems:
The type ListModel is not generic; it cannot be parameterized with arguments <TableChooserInitDialog.PrintFormat>
The type AbstractListModel is not generic; it cannot be parameterized with arguments <TableChooserInitDialog.PrintFormat>
The method createListModel(Map<Integer,String>) is undefined for the type TableChooserInitDialog.PrintFormat
'<>' operator is not allowed for source level below 1.7
'<>' operator is not allowed for source level below 1.7
The method createListModel(Map<Integer,String>) is undefined for the type TableChooserInitDialog.PrintFormat
The method createListModel(Map<Integer,String>) is undefined for the type TableChooserInitDialog.PrintFormat
The method createListModel(Map<Integer,String>) is undefined for the type TableChooserInitDialog.PrintFormat
The method createListModel(Map<Integer,String>) is undefined for the type TableChooserInitDialog.PrintFormat

at cz.muni.fi.vavmar.reporteditor.dialogs.TableChooserInitDialog$TableChooserJPanel.<init>(TableChooserInitDialog.java:117)
at cz.muni.fi.vavmar.reporteditor.dialogs.TableChooserInitDialog.<init>(TableChooserInitDialog.java:40)
at cz.muni.fi.vavmar.reporteditor.MainFrame$6.run(MainFrame.java:377)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Martin V

unread,
Sep 24, 2014, 3:30:00 PM9/24/14
to idem...@googlegroups.com
Hello eugen,
thanks for your interest. The project is developed, build and tested with Java 1.7. But the rest of iDempiere is set for compilation at Java 1.6. But the enviroment I'm using is the same for both and it's set to JDK 1.7.

I've tried to reproduce the problem and found some compilation error (interesting is that theprogram run despite of compilation fail). I've fixed the problem and pushed project on git. Could you please check if it's working?
As you asked (reporteditor-1.PNG). It doesn't matter if its checked or not.

Martin



Dne středa, 24. září 2014 17:16:06 UTC+2 eugenh napsal(a):

eugenh

unread,
Sep 25, 2014, 8:08:31 AM9/25/14
to idem...@googlegroups.com
Hi Martin,
thanks for the answer.
In the ReportEditor\META-INF\MANIFEST.MF I defined
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
and then there are some minor run-time errors to correct, eg in class WidgetRectangularSelectionProvider:

public static final Border selectedBorder = BorderFactory.createDashedBorder(Color.BLACK, 3, 2, 1, true);

because there is no DashedBorder in 1.6

I simple defined another Bordertype: MatteBorder

Regards
EUGen

eugenh

unread,
Sep 25, 2014, 9:31:58 AM9/25/14
to idem...@googlegroups.com
Am Mittwoch, 24. September 2014 21:30:00 UTC+2 schrieb Martin V.
... Could you please check if it's working?

Yes, Martin - it works.
We have some reports in development and wanted to checkout your feature and speedup the report design..
But whatever we do, we see an empty layout!?

Now I've noticed in the trace:
 TRACE vavmar.reporteditor.MainFrame [<init>] - Now we should load print format. Not implemented yet.

So we can use the tool yet to impement new reports - not to work with existing reports. Right?
Do you plan to implement report-loading at init-time?

Regards EUGen
 

Martin V

unread,
Sep 25, 2014, 7:28:23 PM9/25/14
to idem...@googlegroups.com
Hi Eugen,
it's good to hear that you managed to run ReportEditor.

There is one known issue that when you create report without subreport and you try to directly see it (selectiong from

Yes exactly. ReportEditor supports only creating new reports so far. Yes I'd like to add support for loading previously created reports. Unfortunately there has to be a lot of investigation in iDempiere print engine. So I can't promise you any date. In my case when I've tried to create reports, relative positioning was really unpredictable. That is the reason why it isn't implemented yet. I could try to make some pseudo loader which would load just absoutely positioned items. But I think that compared with old solution, defining reports in tables, creating equal report is question of few minutes, despite of lack of some functionality (which I'd prefere to focuse).
I also thought about total redefining print engine and let the RE (ReportEditor) use only new one and in the same time allow to export (one way only) to the old report engine.

Could you please send me some examples of reports you wloud like to create (or allready created)? I'm curious of users requirements. To be able to create better desing.

Thank you and have a nice day,
Martin


Dne čtvrtek, 25. září 2014 15:31:58 UTC+2 eugenh napsal(a):

Martin V

unread,
Sep 25, 2014, 8:11:25 PM9/25/14
to idem...@googlegroups.com
There is also an issue when you create new report without subreport. It cannot be wieved directly from window, but you have to view "valid" report (eg old report created in iDempiere) and after that when the preview window shows you can from drop down menu choose desired report. It also log an error: "No Colums - Delete Report Format color test and start again [30]" but I haven't been able to investigate it yet why it's happening and why it isn't in case of report containing subreport.




Dne čtvrtek, 25. září 2014 15:31:58 UTC+2 eugenh napsal(a):
Am Mittwoch, 24. September 2014 21:30:00 UTC+2 schrieb Martin V.

Leonard Walletzký

unread,
Oct 1, 2014, 10:55:27 AM10/1/14
to idem...@googlegroups.com
Hallo,

I am wondering if you are still planing to put the video here. Thanks.

Dne pátek, 1. srpna 2014 18:26:51 UTC+2 Martin V napsal(a):

Martin V

unread,
Oct 1, 2014, 11:14:50 AM10/1/14
to idem...@googlegroups.com
Hello Leonard,
yes it's still on my TODO list. But based on previous experience I'll not put any promises when.

Martin

--
You received this message because you are subscribed to a topic in the Google Groups "iDempiere" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/idempiere/0nQruQ7hilk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/12a17d47-a68f-4dee-857c-a6ee8e76fc8f%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages