Hi Subham, Are you sure this is related to JETT? JETT only works with HSSF (xls) and XSSF (xslx) workbooks as far as I can tell, it doesn't support streamed generation of XSLX workbooks as it needs the whole document in memory for manipulation when filling the template. This looks like a pure SXSSF question, so you may not be on the right forum, you should ask on POI forums - or on StackOverflow. If this is JETT related, please share you code so that we can give it a try and better understand what's...
Hi, I am using SXSSF workbook for excel exports, in a particular case I have to use hyperlink in a cell along with cellStyle. However, in exported files if I set both the properties (i.e hyperlink and cellStyle) then cellStyle property is ignored and hyperlink text is displayed with default styling. Is this a known issue?
Hi, i made an github repo containing the last version with updated dependencies (poi5 + commons-jexl3). Almost all tests pass, still not used in production so further work may be needed. https://github.com/plan-vision/jett
This project really need an active github fork or we will have to consider migrating to jXLS...
This project really need an active github fork.
As mentioned in another post I have made a pull request on github to update the version of poi. I'm going to see if I can get the maintainer to allow me to merge it into the main repo.
I ran into the same issue so have made a pull request on the github repository with a version that seems to work with POI version 5.0 if that is of use to anyone. I'm going to see if I can get it merged into the main repo otherwise I might just publish it as a separate artifact.
I made a mistake, please close the tiket
Hi Sad to see that JETT is almost dead. We really need an active community fork on github.
Support variable in pathname of jt:image
Hi, I have a question on the apache poi version supported by jett. Right now I would like to be able to use jett as well as apache poi latest version in the same dependency management system. The latest version of apache poi is 5.x.x, and jett uses 3.1.4. Is there any plan to upgrade the apache poi version to the latest in jett? Thanks, Souvik
Thanks Etienne for the response. I have tried out the sxssf API and the merging capabilities works great for my use case.
Hi, JETT will read all the data to fill it in the template, so you will need to "wrap" your paginated data in a Collection first before passing it to JETT to generate the Excel file. This could be as simple as retrieving all your data (page after page) and put it in a single List, but you might also wrap it in a custom class that will iterate over the pages without having to load everything in memory at once. That being said, since JETT is based on "Standard" POI API, it means that even if your data...
Hi, I was exploring jett as an option for our requirement, which involves generating excel out of paginated data. I want to append data to an excel generated by jett. Is such a feature supported by jett currently? Thanks, Souvik
Hi, I cannot set the style of a cell containing a replaced value (${myObj.offerValue} a float). The cell has its own dataFormat, that is maintained and the bg color too, but the style of the font is changed and I don't find a way to override it. I tried : <jt:style style.... <jt:style class.... ${{ sheet.getRow(11).getCell(2).setCellStyle(sheet.getRow(11).getCell(1).getCellStyle()); }} Same thing with a Date value, I solved changing the type from Date to LocalDate. Suggestions?
Hi Anjana, I really hope that we could get Randy Gettman's answer on this but unfortunately he's been really quiet since the last JETT version was released 3 years ago (0.11). You can still find JETT'ers to answer your questions though, either on this forum or on Stackoverflow. There's no sign that this project will get a new release any time soon, but that shouldn't be completely blocking you from considering it for your project. The source code is well written and there's good unit testing if you're...
Hi , We too are interested to know when new version of Jett be available . We are actively looking at jett to use in our project wanted to understand how active is this community or is there any enterprise version available. Thanks Anjana,
I had not yet discovered this feature but I think that it can just improve maintainability of what I've done, as you said, so thank you, I really appreciate it :) have a great week, bye
I'm not too familiar with how JETT can keep track of $[] formulas and update the references within as template get filled, so I don't know whether there's a better way to generate the list of cells that you use in the D10 formula. However, you can skip the step where you edit with POI at the end by adding similar code at the bottom of your sheet #2 enclosed in a ${{ ...your code here... ; return ''; }} block. Just make sure to use JEXL syntax, which may be a bit different from the Java one. Keep...
Hi, I think I solved, don't know if is a workaround or the better approach, but solved. If you want to take a look this is the template. D10 in sheet #2 should be the sum of all generated Q21. At the moment what I've done is: - tagged Q21 cell with a css class using <jt: style=""> tag - implemented a CellListener that update a beanMap item with the addresses ot the tagged cells (in a string like "Q21,Q31,Q41 etc...") - </jt:> class MyCellListener implements CellListener { @Override public boolean...
Hi Giu, I can't find any attachment in your posts - did you already address all your requirements or do you need further help?
I resolved using : - a style tag to mark a cell with a class name, - then implement a custom cell listener that keep updated a list in beans map adding the rowCol indexes of the cell i want to keep track - set cellFormula in the workbook using the list values
Sorry the thread name was deleted after a refresh and it seems I cannot edit it.
Goal: put in D10 of 2nd sheet the sum of Q21 and all other generated cell
result xls
template file
Hi, I need an hand to find the better approach to solve my requirement: Attached you find the template i'm working on, the result and a video to explain my problem: How to use a formula in a section of the xls that reference to cells populated by a foreach of another section. I hope you can give me some tips. Thanks
Thanks for replying. Yes you are correct .Finally myself identified the issue which is with the the data set ,I have used .
Thanks for replying. Yes you are correct .Finally myself identified the issue which the data set I have used .
Maybe the expression on which you call .size() evaluates to null. Can you share the expressions you're using in your jexl tags?
<jt:if test="${header.accountExecutives.size() != 0}" elseaction="clear"> <jt:foreach items="${header.accountExecutives}" var="ae">${ae.name}</jt:foreach> </jt:if> When I try as above approach , it gives me java.lang.NullPointerException: null at org.apache.commons.jexl2.Interpreter.sizeOf(Interpreter.java:1474) ~[commons-jexl-2.1.1.jar:2.1.1] at org.apache.commons.jexl2.Interpreter.visit(Interpreter.java:1398) ~[commons-jexl-2.1.1.jar:2.1.1] at org.apache.commons.jexl2.parser.ASTSizeMethod.jjtAccept(ASTSizeMethod.java:18)...
When I try as above approach , it gives me java.lang.NullPointerException: null at org.apache.commons.jexl2.Interpreter.sizeOf(Interpreter.java:1474) ~[commons-jexl-2.1.1.jar:2.1.1] at org.apache.commons.jexl2.Interpreter.visit(Interpreter.java:1398) ~[commons-jexl-2.1.1.jar:2.1.1] at org.apache.commons.jexl2.parser.ASTSizeMethod.jjtAccept(ASTSizeMethod.java:18) ~[commons-jexl-2.1.1.jar:2.1.1] at org.apache.commons.jexl2.Interpreter.visit(Interpreter.java:1317) ~[commons-jexl-2.1.1.jar:2.1.1] at...
<jt:foreach var="csItem" items="${csList.subData}" copyright="true"> <jt:if test="${csItem.data02 == 'IMAGE'}"> <jt:image rows="1" pathname="${csItem.data01}" cols="1"> </jt:image></jt:if> <jt:if test="${csItem.data02 != 'IMAGE'}"> ${csItem.data01} </jt:if> </jt:foreach> It is not work.!
Work Looping Tags and ForEach
Hello, I found a solution. Maybe it will help someone : Basic java code inside the else attribute <jt:if test="${condition1}" then="${expression1}" else="${if(condition2)){expression2} else {expression3} }"></jt:if> So we could do like: condition1 = !b ; expression1 = z condition2 = a ; expression2 = x expression 3 = y (in case !!b, !a) Edit : my if tag is a bodiless one. It ends with " /> but here it shows with an end tag, I dont know how to change it.
Hello, I found a solution. Maybe it will help someone : Basic java code inside the else attribute <jt:if test="${condition1}" then="${expression1}" else="${if(condition2)){expression2} else {expression3} }"></jt:if> So we could do like: condition1 = !b ; expression1 = z condition2 = a ; expression2 = x expression 3 = y (in case !!b, !a)
Hello, Is it possible to implement multiple condition check ? for example : if (a && b) -> x if (!a && b) -> y if (!a && !b) -> z
HI, Randy Gettman! When will the new version of JETT be released taking into account the new versions of the Apache POI, XML Beans, Apache Commons JEXL, Apache Commons Logging, SourceForge's jAgg, JUnit, HSQLDB, Log4J 2 libraries? Thanks!
I tried to find a way in Jett code to disable debug of JEXL, but looks like JEXL 2.x will always call debugInfo() when parsing an expression even when debug is set to false on JexlEngine object (like JETT is correctly doing): https://github.com/apache/commons-jexl/blob/2.0/src/main/java/org/apache/commons/jexl2/JexlEngine.java I assume only upgrading to JEXL 3.0 could fix that, let's wait and see if Jett author has any plan to do so.
Hi All, We are facing performance issues using excel generation using JEXL , Below is the snippet which we are using for excel generation final Workbook workbook = transformer.transform(inputTemplateStream, beans); After analysing using DT session we found that in our api majorly around 90% of time is taken in excel generation using JEXL , i guess it will by default enable jexl in debug which is taking time for each request below are the DT session snippet attached. Is there a way to disable the...
This code works for me: <jt:forEach items="${items}" var="item" indexVar="index"> <jt:style style="font-color: ${index % 2 == 0 ? 'red' : 'blue'}"> ${item} / ${index} </jt:style> </jt:forEach> You should ensure that your JEXL code should return a string; in your second piece of code, "medium" and "thin" don't have any quotes, so unless you've defined some variables with these names they will be undefined. So it should be <jt:style style="border-left:${(index == 0) ? 'medium' : 'thin'}">${item}</jt:style>...
Thanks for reply, first off, I am familiar with that post you linked above, this example seems not to be valid : < jt:style style="bottom-border-color:${(index == 0) ? color : color2}"/ > As I understand jt:style tags cant be bodyless. Based on that post, I have tried this: <jt:style style="border-left:${(index == 0) ? medium : thin}">${item}</jt:style> but nothing got formatted according that JEXL condition block. Could you provide some specific example that you are sure it works? For example what...
Thanks for reply, first off, I am familiar with that post you linked above, this example seems not to be valid : < jt:style style="bottom-border-color:${(index == 0) ? color : color2}"/ > As I understand jt:style tags cant be bodyless. Based on that post, I have tried this: <jt:style style="border-left:${(index == 0) ? medium : thin}">${item}</jt:style> but nothing got formatted according that JEXL condition block. Could you provide some specific example that you are sure it works? For example what...
Thanks for reply, first off, I am familiar with that post you linked above, this example seems not to be valid : <jt:style style="bottom-border-color:${(index == 0) ? color : color2}"> As I understand jt:style tags cant be bodyless. Based on that post, I have tried this: <jt:style style="border-left:${(index == 0) ? medium : thin}">${item}</jt:style> but nothing got formatted according that JEXL condition block. Could you provide some specific example that you are sure it works? For example what...
Hi Miroslav, This is likely the issue already described here: https://sourceforge.net/p/jett/tickets/10/ I assume this issue is not fixed. Maybe you can write more details in the above issue to help Randy reproduce the problem. He also provided a workaround in the ticket, where you can write your code in a JEXL block in the style="${your code goes here}" . I this this should work for you, let me know if you meet any problem getting something that works.
Hi Miroslav, This is likely the issue already described here: https://sourceforge.net/p/jett/tickets/10/ I assume this issue is not fixed, so the workaround is to write everything (test & styling) in a JEXL code block. Maybe you can write more details in the above issue to help Randy reproduce the problem.
Hello, wanted to ask if there's any way to apply multiple jt:if tags for cell. What I am trying to do is that i have forEach loop to insert list of values into row. When inserting I need to check indexVar and based on it's value then set formatting. for example 1st cell will have color1, 2nd will have color2, 3rd color3 and so on.
Hello, wanted to ask if there's any way to apply multiple <jt:if> tags for cell. What I am trying to do is that i have forEach loop to insert list of values into row. When inserting I need to check indexVar and based on it's value then set formatting. for example 1st cell will have color1, 2nd will have color2, 3rd color3 and so on.</jt:if>
I turned off the debugger. http://jett.sourceforge.net/misc/jexl_settings.html
Hello everyone!! I'd like to know the answer/solution for this issue too. I am doing a workaround here setting non-null values on the list before the transformation call, but if there is other solution I'd like to know.
Issue in Column OG
JETT if tag doesnot works properly
inaccessible or unknown property data
Thanks for the implementation hints, Etienne. I share your concerns about the inactive state of the JETT project... :-/
Hi Aron, Any info on JETT project current status that wouldn't come from Randy Gettman would just be pure speculation. That being said I'm fine with speculation, as just like you I haven't seen any significant JETT update for about a year, and we had to patch it internally to support latest POI versions - so, indeed it becomes a bit of an issue. I'm not quite comfortable using a fork of JETT if Randy has plans to keep maintaining JETT in the future - it may just be a temporary work/family situation...
Etienne, Your project sounds interesting (congrats for this!), but I'd need some streaming solution within JETT. I can accept limitations and I could even have manpower dedicated to this, but before we invested it'd be important to understand the status of the JETT project. Some people forked it to GitHub, made some fairly minor changes, so there is a fork there. Here, the "official" version hosted at Sourceforge is kind of silent... So, I am a bit confused about the project status and also about...
Well, if you're not afraid of having drastically limited templating capabilities and very beta-ish code, following up on my previous reply I ended up writing my own lib, here: https://github.com/etiennec/jebt Big warning: There is NONE of the nice templating features of JETT: No scripting language, no support for Excel Formulas, no fancy tags, no nothing. Just simple placeholder in the Excel Template for your data, and loops to iterate over source data when filling the template. It takes input data...
Is there any way to get this streaming approach to move forward? I think this is a big problem for enterprise users and woudl be a great asset for JETT to support a lower memory footprint approach for better scaling on larger datasets.
Tracy I dont think there is any easy way, remember we are using Excel as our editor. If possible try to put tags in their own cell, but I know in many cases you must combine things so they format properly. Its the nature of the tags and preserving formatting. On 2019-04-18 1:03 p.m., Tracy Minsterman wrote: I have some Excel report templates with Jett code in them and I want to make some modifications. However, it appears the tags within are nested and I'm having trouble matching the beginning and...
I have some Excel report templates with Jett code in them and I want to make some modifications. However, it appears the tags within are nested and I'm having trouble matching the beginning and ending tags. Does anyone know of a way to more easily identify the matching pairs?
Sorry. There is no plan forsupporting it, there will be no official release etc. You can build the jar on your own and put it in your application. I made the initial migration , simplified the vertical align , border style etc enums, because they are already enums in POI4. But this is only a basic requirement and a fast approach, its not really a new version. We tested it in our enterprise environment,.All mvn test cases pass but there are some comments in the styletest case. The first results are...
Sorry. There is no plan forsupporting it, there will be no official release etc. You can build the jar on your on and put it in your application. I made the initial migration , simplified the vertical align , border style etc enums, because they are already enums in POI4. But this is only a basic requirement and a fast approach, its not really a new version. We tested it in our enterprise environment,.All mvn test cases pass but there are some comments in the styletest case. The first results are...
Hi Tran, I know I am following this on regular basis :-), but actually this is little bit critical to our application. I hope you don't mind with this. What is the normal release cycle that you are following for this, and what will be the tentative release date. Regards Kushagra
Thanks for this. When we are planning to release this version.
Done
Thanks Tran for this. Just a quick suggestion, can you please upgrade the log4j version in ur pom.xml to latest one. Currently it is supporting 2.11.2 . https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-jcl It will help for greater maintainibility. Already asked in another post though, if possible please provide details about the release date of this latest binary. Regards Kushagra
Thanks Tran for this. Just a quick suggestion, can you please upgrade the log4j version in ur pom.xml to latest one. Currently it is supporting 2.11.2 . https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-jcl It will help for greater maintainibility. Regards Kushagra
Thanks Tran. Highly appreciating your efforts. Please let me know when you will be able to publish the updated binarries. One suggestion, we have latest version of log4j avaiable, so can you please use that for greater maintainability. Regards Kushagra
https://github.com/plan-vision/jett-poi4 just a preview, used for internal migration to POI 4
Coincidence we did it just today, there is an initial commit in github https://github.com/plan-vision/jett-poi4
Hi Randy, Is there any update on this? Can we do this on our own and publish the new version of jar with the latest change, and will share PR for your review. Regards Kushagra
Hi Randy, Is there any update on this? Can we do this on our own and publish the new version of jar with the latest change. Regards Kushagra
+1
@Randy : Please let me know if we can work on this ticket collaboratively to resolve this quickly.
Please move this to github.
Latest version of JETT-CORE required with Apache POI-4.0.1
I am trying to find a way to embed image files that are saved to our Amazon S3 repository. The idea is to grab the file stream from Amazon S3's api and then put it into the excel file. The current image tag for Jett seems to only work for local files on the server machine where the template is. Is there a way to just provide the byte array/file stream of the image to JETT and have it add the image there? I tried looking into doing a custom tag, but it seems that SheetUtil doesn't really support this...
<jt:group> should offer an attribute to specify if I want the direction of the group (e.g, total should be in top or the bottom of a vertical group)
I Have two spreadsheet both with diferrent data. In one of the spreadsheet i want a specific colum from the other. This is the original code for the spreadsheet (acrruals)i want to add the colum: ${accruals.employee.name} This is the other spreadsheet (PersonDetail) i want to extract the data for accruals spreadsheet: ${employee.fullName} Im looking to add the colum ${baseWage.amountAsString} from PersonDetail to Accruals. Is my first time using JETT i trying to edit the code : ${accruals.employee.name};productLicense;interactiveLicense;status;skill;certification;approver;purpose;apn;fte;uas;additionalInformation;personDate;isr;primaryLaborAccount;percentageAllocationRule;adjustmentRule;payRule;baseWage;badgeNumber;employmentTerm;groupAssignment;scheduleRuleSet;timeEntryMethod;organizationalGroup;jobPreferences;jobTransferSet">${employee.fullName};...
Anjana, Both JETT 0.10.0 and the current version 0.11.0 use Apache POI 3.14. It looks like the method names were changed around between 3.14 and 3.17. At some point I'll upgrade JETT to use Apache POI 3.17, but for now, use Apache POI 3.14. Randy
Cell references as formula parameters are not consistently incremented
In implicit iterations, can I skip the evaluation of an expression?
Invalid Error "Matching tag not found"
Border Issue
JETT crashes meeting ${var} in Excel
New method: AttributeUtil.evaluateNonNegativeDouble()
This was included in JETT 0.11.0, which was released on May 14, 2018.
When a cell is shifted to make space for an iteration, its hyperlink stays in the original cell
This was included in JETT 0.11.0, which was released on May 14, 2018.
JETT logging should rely on Log4j (or some other modern logging library) instead of writing to System.err
This was included in JETT 0.11.0, which was released on May 14, 2018.
This was included in JETT 0.11.0, which was released on May 14, 2018.
Excel formula doesn't work after I updated the version to 0.10.0
FeatureRequest jt:pageBreak
This was included in JETT 0.11.0, which was released on May 14, 2018.
Implicit Sheet Cloning fails if collection contains 1 element
This was included in JETT 0.11.0, which was released on May 14, 2018.