Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1] 2 3 ... 10
 1 
 on: April 15, 2021, 04:36:30 pm 
Started by Christine R. - Last post by Christine R.

 Genero 3.20 Maintenance Release


Four Js is pleased to announce a Maintenance Release of
  • Genero Mobile for Android 1.40.13.
  • Genero Report Engine 3.20.15

This version includes the following fixes :

These versions are now downloadable from the website : https://4js.com/download/products/.

Note : All Four Js Genero customers under maintenance have free access to the new release.


Best regards,

Four Js Development Tools

 2 
 on: April 14, 2021, 10:47:55 am 
Started by Reuben B. - Last post by Tony E.
Great stuff Reuben. Thanks.

 3 
 on: April 13, 2021, 04:35:13 am 
Started by Reuben B. - Last post by Reuben B.
Hi Tony,

Quote
I'm not a java programmer at all,

I am not a natural Java programmer either, so I'll probably use a term incorrectly somewhere :-)

Quote
I'm not sure if this is the correct place to ask

Unless it related directly to something in this article, I would suggest in the future creating a dedicated thread in the Genero BDL board https://forum.4js.com/fjs_forum/index.php?board=2.0

I hadn't used CellUtil https://poi.apache.org/apidocs/dev/org/apache/poi/ss/util/CellUtil.html but I was reading it it thinking I perhaps should have used it in places.

Re: your question on Java.Util.Map

Quote
I can get setCellStyleProperty() to work fine, but I want to make multiple style changes on a cell - e.g. borders all round + colours, bold, etc. - so it is recommended to use setCellStyleProperties(), which I can't get to work. I am struggling with the 'Map' java type, which I understand is an Interface type (https://docs.oracle.com/javase/8/docs/api/java/util/Map.html).

The definition for this function is:-
public static void setCellStyleProperties(Cell cell, java.util.Map<java.lang.String,java.lang.Object> properties)

Have you come across this before ? Would you be able to please explain how to declare the 'Map'


I wonder if the pieces of the puzzle you are missing is point 1 in the limitations http://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_JavaBridge_001.html, and secondly with Map being an Interface type it is not a case of creating something of Map type but of something that implements the Map type.   You can use java.util.hashMap to implement something that matches that Interface.

After some trial and error I found that adding to fgl_excel.4gl

Code
  1. IMPORT JAVA  org.apache.poi.ss.util.CellUtil
  2. IMPORT JAVA org.apache.poi.ss.usermodel.IndexedColors
  3. IMPORT JAVA org.apache.poi.ss.usermodel.BorderStyle
  4. IMPORT JAVA java.util.HashMap
  5. IMPORT JAVA java.lang.Integer
  6. ...
  7.  
  8. FUNCTION cellutil_set_cell_property_experiment(c cellType)
  9.  
  10. DEFINE h  java.util.HashMap
  11.  
  12.    LET h = java.util.HashMap.create()
  13.  
  14.    CALL h.put(CellUtil.BORDER_TOP, BorderStyle.MEDIUM)
  15.    CALL h.put(CellUtil.BORDER_BOTTOM, BorderStyle.MEDIUM)
  16.    CALL h.put(CellUtil.BORDER_LEFT, BorderStyle.MEDIUM)
  17.    CALL h.put(CellUtil.BORDER_RIGHT, BorderStyle.MEDIUM)
  18.    CALL h.put(CellUtil.TOP_BORDER_COLOR, java.lang.Integer.create(IndexedColors.RED.getIndex()))
  19.    CALL h.put(CellUtil.BOTTOM_BORDER_COLOR, java.lang.Integer.create(IndexedColors.BLUE.getIndex()))
  20.    CALL h.put(CellUtil.LEFT_BORDER_COLOR, java.lang.Integer.create(IndexedColors.YELLOW.getIndex()))
  21.    CALL h.put(CellUtil.RIGHT_BORDER_COLOR, java.lang.Integer.create(IndexedColors.GREEN.getIndex()))
  22.  
  23.    CALL CellUtil.setCellStyleProperties(c, h)
  24. END FUNCTION
  25.  

I then had a function I could call that utllised CellUtil.setCellStyleProperties passing in the appropriate cell

Code
  1. CALL fgl_excel.cellutil_set_cell_property_experiment(cell)

and it added a border around the appropriate spreadsheet cell.

The java.lang.Integer.create was required to turn the integer into an object.

One thought in general is for any complex Java that the Genero Java interface does not cater for is to create a Java class that simplifies it that you can then call with IMPORT JAVA.   That is not necessary in this case but I thought I was heading in that direction if I had needed a complex equivalent of   "  HashMap<String, XXX> h = new HashMap<String, XXX>();   "when I couldn't figure out what XXX was required to be.    As it was java.util.HashMap.create() created a suitable hashmap.

Hope that helps,

Reuben

 4 
 on: April 09, 2021, 05:14:46 pm 
Started by Reuben B. - Last post by Tony E.
Hi Reuben,

I read this article with great interest, thanks, and decided to try to take on using JAVA POI to generate excel. I'm not a java programmer at all, but your sample project and code helped and I have something working.

I'm not sure if this is the correct place to ask, but ...

What I am now looking at is the formatting of cells using the CellUtil java libraries. The reason is, using CellUtil functions you can apply additional formatting to cells that have already been created with a certain style without affecting other cells with that same style.

I can get setCellStyleProperty() to work fine, but I want to make multiple style changes on a cell - e.g. borders all round + colours, bold, etc. - so it is recommended to use setCellStyleProperties(), which I can't get to work. I am struggling with the 'Map' java type, which I understand is an Interface type (https://docs.oracle.com/javase/8/docs/api/java/util/Map.html).

The definition for this function is:-
public static void setCellStyleProperties(Cell cell, java.util.Map<java.lang.String,java.lang.Object> properties)

Have you come across this before ? Would you be able to please explain how to declare the 'Map' and use this setCellStyleProperties function in 4GL code.

Much appreciated,
Tony.

 5 
 on: March 31, 2021, 07:25:11 am 
Started by Reuben B. - Last post by Reuben B.
At time of writing the Early Access Program (or EAP) has just started for our next release 4.00. https://4js.com/download/eap/

I have put this article together to answer some of the frequently asked questions that surround the Early Access Program.

I would always encourage you to participate in an Early Access Program.  This is your opportunity to ensure that your application can upgrade to newer releases with minimal effort and cost to your business, and that you can use new features and provide benefits to your business straight away. 

Read more at https://4js.com/ask-reuben/ig-72/

 6 
 on: March 30, 2021, 05:22:04 pm 
Started by Christine R. - Last post by Christine R.

   Genero Enterprise 4.00 EAP program



Four Js is pleased to announce that the Early Access Program (EAP) for Genero Enterprise 4.00 is now open.

This release comprises important new features that will improve your productivity and the user experience of your applications. You now can have access to the product packages in the Early Access Programs section of our web site.
If this is your first time participating in a Four Js EAP, please read the section “What is an EAP?” in the sidebar where you will learn how to subscribe to this service.

The list of features highlighted in this announcement here are not exhaustive. To find the complete list, read the “What’s New” and “Upgrade” sections provided in the appropriate User Guide.

The “What’s New” section provides the full list of new features in the release. The “Upgrade” section tells you how to migrate from a previous version of Genero.

Additional features may be added during the EAP, so we recommend frequent visits to the forum.

We appreciate your interest in pre-release access to our products, and value your feedback. Thank you for your participation in this important phase of our product development.

Best Regards,

The Four Js Development Team


 7 
 on: March 30, 2021, 05:08:10 am 
Started by Reuben B. - Last post by Reuben B.
The use of DATETIME and INTERVAL has evolved over the lifetime of Genero.  In this article Reuben answers some of the questions we get around the use of DATETIME and INTERVAL datatypes, and discusses the new classes and widgets that have been introduced to Genero in recent versions to help you work with DATETIME and INTERVAL datatypes.

Read more at https://4js.com/ask-reuben/ig-71/

 8 
 on: March 30, 2021, 05:05:16 am 
Started by Reuben B. - Last post by Reuben B.
n the previous article, I went over some key points when starting out with Genero Report Writer.  I want to finish the article and cover a few introductory points when it comes to using the Genero Report Designer.

In my opinion the best way to learn is to have something basic you can experiment and play with.   In this article you will find a program and report you can use as a starting point with which to experiment and learn.

The key to designing good reports is to understand and use the Report Structure view, and to understand relative and absolute positioning and to use relative positioning where possible.

Read more at https://4js.com/ask-reuben/ig-70/

 9 
 on: March 30, 2021, 05:02:41 am 
Started by Reuben B. - Last post by Reuben B.
When people start using our newer products I often see them jumping in the deep end, trying to run before they can walk, biting off more they can chew etc.  and their first experiences are not as positive as they can be.  Over time I am going to do a series of articles entitled “Starting …” where I will explain what I think are the key concepts points you should understand with our products and try and make your initial experience a positive one.  In this article and the next  I look at Genero Report Writer (or GRW).

To start, did you know you can use GRW to output an existing 4gl report to PDF by the addition of a few lines of code.

Read more at https://4js.com/ask-reuben/ig-69/

 10 
 on: March 30, 2021, 04:57:21 am 
Started by Reuben B. - Last post by Reuben B.
This question came from a developer who was trying to use a spacer to force a gap between two adjacent widgets.

For those who have not come across a spacer before, it is something you can use with HBox-tags and is an invisible element that automatically expands. It can be used to align elements left, right or center in the hbox.

So despite the name, a spacer does not necessarily add a space, its purpose is alignment.   I like to think of it as a spring that is forcing apart adjacent widgets so that they align without being resized.  That spring can be compressed so that it does not take up any space and that is where the confusion may arise.

If you want to force a space between adjacent fields, then you need to do something to ensure that the width of the grid columns between the two fields is greater than zero.  That can be achieved by adding a LABEL between the two adjacent widgets that has a non-empty TEXT attribute, the simplest case being a single space.  This has the desired effect of making the grid column between the adjacent widgets have the minimum width necessary to display a space in the current font.

Read more at https://4js.com/ask-reuben/ig-68/

Pages: [1] 2 3 ... 10
Powered by SMF 1.1.21 | SMF © 2015, Simple Machines