Making PrintFormat better than JasperReports

What Trunk or Branches to use and mix? Which is the Official version? How to survive growth?
Forum rules
This forum is personally pruned to avoid redundant posts. Related topics are moved to the same sub-forum. Language will be corrected for readability.

Making PrintFormat better than JasperReports

Postby red1 » Fri Aug 10, 2018 5:33 am

Even though we are integrated to JasperReports it is still cumbersome to design a report and ensuring it is attached or placed in storage properly. The aliases control of dataset and building the SQL view is tedious. Not many people can learn it instantly and be productive for long as it is a boring job.

I have thought of making instant nice output and have done so in my Ninja's InfoReport feature. I was thinking wouldn't it be nice to make the landscape style report without header, to be with a header format? Below you can see an instant headless landscape report example.

LandscapePrint.png (236.67 KiB) Viewed 968 times
I then experimented to inject into another PrintFormat of potrait setting as a subdetail, and it works.

Injected2PotraitFormat.png (138.25 KiB) Viewed 968 times
However the header will tie the content of the detail via its parent link column. Whereas I want to allow the detail landscape to remain as it is populated by its InfoWindow selection. Thus I have to then create a special header holder to play parent to these landscapes and able to manipulate the potrait header to display anything programmatically.

It is extremely exciting for me, to solve something new and abstract. Meanwhile I made a simple workaround only for the HTML UI output that is kinda smart and easily made. You need to go into core though to make the HTML <head> fetches its PrintFormat.Description value, thus i submitted a patch - This can bring about the following landscape output.

ProgrammedDescription.png (120.61 KiB) Viewed 968 times
This is programmatically injected in my InfoWindow process code into the PrintFormat.Description field:

Code: Select all
      MUser user = (MUser) lines.get(0).getC_Order().getSalesRep();
      Calendar c1 = Calendar.getInstance();
      SimpleDateFormat today = new SimpleDateFormat("yyyy-MM-dd");
      String date = today.format(c1.getTime());
      MPrintFormat printformat = new Query(Env.getCtx(),MPrintFormat.Table_Name,MPrintFormat.COLUMNNAME_Name+"=?",get_TrxName())
      if (printformat!=null) {   
         printformat.setDescription(getName()+" : "+date+"<br>Printed By : "
         +" lines total value: $"+grandtotal);
Site Admin
Posts: 2751
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Return to Building ADempiere

Who is online

Users browsing this forum: No registered users and 1 guest