When I google on the matter the "solutions" always point to missing fonts. I installed the so called missing fonts but without success. The weirdest thing is if I set an unexisting path to the jrxml file I still get the same error. So, it is not complaining not finding the file.
I attach herewith the different custom code (mostly based on OX code). But as I stated, it worked before.
In addition: I have no clue where to put the custom reports. I'm quite lost in the Maven structure...
Kind regards,
Bart.
Hello,
Right now I don't have a lot of time to go through your code, but with the migration to v7 and maven, I locate my jrxmls in src\main\resources\reports and when I reference them I do so as "reports/myFilename.jrxml". In the deployment file, they are in target\eell\WEB-INF\classes\reports
I think that the famous problem of the fonts shows otrer lines in the log.
Regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you Juan, I'll try that.
Indeed the log doesn't mention any fontproblem, but when I google the outputline there is mostly a reference to a missing font or image. Although in my case the font isn't missing and there are no images.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Debugging my code learned me that the problem is not the report generation but the non-functioning of getTab().getSelectedKeys(). In other parts of my code that works, but for some reason it doesn't work in the action GeneratePackListsAction.java. I have a suspicion that the reason somehow is tied to the fact that the TabBaseAction is extended in an action "2 levels above". In the actions that work with getTab().getSelectedKeys(), TabBaseAction is extended directly in the functioning action. I'm not sure if that is the reason (it shouldn't, it compiles) but that's the main difference with the working routines.
I'll explain:
The calling method (the one defined in controllers.xml) is:
I can confirm now for sure that, if I extend GeneratePackListsAction.java with TabBaseAction directly (commenting out any Jasperreport references), the result of getSelectedKeys() stays empty. Routines with the same call on the same model (Bestellingen) work correctly.
This drives me crazy...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok, I found a workaround to fix this, but I feel suspicious why this worked in previous OXPro 6.x versions and not in OXPro7.0.5.
The previous situation:
I have a mechanism that I use thru-out my code to be able to evaluate if the user selected records or not and give a dialog accordingly. I achieve that by:
<controllername="ApplyToSelectedBestellingenSub"><!-- This is part of the menu the user can select -->...
<actionname="CreatePacklistDialog"class="org.openxava.zokola.actions.ShowConfirmationDialog"mode="list"><!-- The user is supposed to select at least one 'Bestellijn', if not there is a warning, if so confirmation is asked--><setvalue="createpacklist"property="qcontext"/><!-- Parameter to make ShowConfirmationDialog generic, so it can be used in other contexts. 'qcontext' stands for 'questioncontext' --></action>...
</controller>
The answer given in the dialog is evaluated due to following mechanism:
<controllername="ConfDialog"><actionname="affirmatief"class="org.openxava.zokola.actions.TrueAction"/><!-- In this case only 1 possible outcome is this--><actionname="negatief"class="org.openxava.zokola.actions.FalseAction"/>...
<actionname="GeneratePackListsAction"class="org.openxava.zokola.actions.GeneratePackListsAction"></action></controller>
TrueAction.java executes the requested action by evaluating the 'qcontext' value stored as a hidden property in the dialog.
publicclassTrueActionextendsTabBaseActionimplementsIChainActionWithArgv{
Loggerlog = Logger.getLogger(this.getClass());
privateStringargNextAction = null;
privateStringnextAction = null;
@Overridepublicvoidexecute() throwsException {
Stringqcontext = (String)getView().getValue("qcontext"); //qcontextisthecontextthisdialogisabout
//itallowstofiltertheactionbehaviourswitch (qcontext) {
case"NoBestellijnenSelected": log.info("ACTION FOR NoBestellijnenSelected"); <!-- Some other possible qactions, not relevant for this case-->cloneBestellijnen();
closeDialog();
break;
case"SomeBestellijnenSelected": log.info("ACTION FOR SomeBestellijnenSelected"); <!-- Some other possible qactions, not relevant for this case-->cloneBestellijnen();
closeDialog();
break;
...
case"NoBestellingenSelectedPacklist": log.info("ACTION FOR NoBestellingenSelectedPacklist"); <!-- Exit when no Bestellijnen are selected-->closeDialog();
break;
case"SomeBestellingenSelectedPacklist": log.info("ACTION FOR SomeBestellingenSelectedPacklist");
generatePacklists(); <!-- This is the method we are looking for if at least 1 bestellijn is selected -->closeDialog();
break;
...
default:closeDialog();
break;
}
}
privatevoidgeneratePacklists() {
log.debug("generatePacklists");
nextAction = "GeneratePackListsAction";
}
...
@OverridepublicStringgetNextAction() throwsException {
//HierdevolgendeactiesturenreturnnextAction;
}
@OverridepublicStringgetNextActionArgv() throwsException {
// HierdeargumentenvoordevolgendeactiesturenreturnargNextAction;
}
This workaround works but getting the selected keys of a given module is so elementary that I'm afraid that on a lot of places in my code I'll have unexpected results. I'm afraid I'm missing something basic.
Thanks in advance for any input!
Kind regards,
Bart.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The workaround I made is setting the selected keys in a sessionobject
Yes, that's the way. getSelectedKeys() is always refreshed from the marked checkbox in the list, in this moment a dialog is shown with no list, so the selected keys are reseted. Maybe we could improve it in some way. However, it should work in the same way in 6 and 7, perhaps some bug fixed for dialogs or lists has changed the behavior. This one, maybe?:
Fix: Original list condition lost when a dialog from list mode shows another list
Help others in this forum as I help you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
A custom Jasperreport to generate a pdf doesn't work anymore in OXPro 7. It logs (full log in attachment):
When I google on the matter the "solutions" always point to missing fonts. I installed the so called missing fonts but without success. The weirdest thing is if I set an unexisting path to the jrxml file I still get the same error. So, it is not complaining not finding the file.
I attach herewith the different custom code (mostly based on OX code). But as I stated, it worked before.
In addition: I have no clue where to put the custom reports. I'm quite lost in the Maven structure...
Kind regards,
Bart.
Hello,
Right now I don't have a lot of time to go through your code, but with the migration to v7 and maven, I locate my jrxmls in src\main\resources\reports and when I reference them I do so as "reports/myFilename.jrxml". In the deployment file, they are in target\eell\WEB-INF\classes\reports
I think that the famous problem of the fonts shows otrer lines in the log.
Regards
Thank you Juan, I'll try that.
Indeed the log doesn't mention any fontproblem, but when I google the outputline there is mostly a reference to a missing font or image. Although in my case the font isn't missing and there are no images.
Debugging my code learned me that the problem is not the report generation but the non-functioning of
getTab().getSelectedKeys(). In other parts of my code that works, but for some reason it doesn't work in the actionGeneratePackListsAction.java. I have a suspicion that the reason somehow is tied to the fact that theTabBaseActionis extended in an action "2 levels above". In the actions that work withgetTab().getSelectedKeys(),TabBaseActionis extended directly in the functioning action. I'm not sure if that is the reason (it shouldn't, it compiles) but that's the main difference with the working routines.I'll explain:
The calling method (the one defined in controllers.xml) is:
then:
and then:
The length of the result is always
getTab().getSelectedKeys()= 0, hence the jrmx file array is not filled.I included the source files.
Note that this code worked before in OXPro 6.x.
Thanks in advance for any input!
Bart.
Last edit: Bart Devos 2023-02-11
I can confirm now for sure that, if I extend GeneratePackListsAction.java with TabBaseAction directly (commenting out any Jasperreport references), the result of getSelectedKeys() stays empty. Routines with the same call on the same model (Bestellingen) work correctly.
This drives me crazy...
Ok, I found a workaround to fix this, but I feel suspicious why this worked in previous OXPro 6.x versions and not in OXPro7.0.5.
The previous situation:
I have a mechanism that I use thru-out my code to be able to evaluate if the user selected records or not and give a dialog accordingly. I achieve that by:
ShowConfirmationDialog.java
The answer given in the dialog is evaluated due to following mechanism:
TrueAction.java executes the requested action by evaluating the 'qcontext' value stored as a hidden property in the dialog.
In the controller the action is redirected:
And finally GeneratePackListsAction.java (just the relevant code):
The workaround I made is setting the selected keys in a sessionobject:
In "ConfirmationDialog > createPacklist()" I added:
And in "GeneratePackListsAction > execute()" I added:
This workaround works but getting the selected keys of a given module is so elementary that I'm afraid that on a lot of places in my code I'll have unexpected results. I'm afraid I'm missing something basic.
Thanks in advance for any input!
Kind regards,
Bart.
Hi Bart:
Yes, that's the way. getSelectedKeys() is always refreshed from the marked checkbox in the list, in this moment a dialog is shown with no list, so the selected keys are reseted. Maybe we could improve it in some way. However, it should work in the same way in 6 and 7, perhaps some bug fixed for dialogs or lists has changed the behavior. This one, maybe?:
Help others in this forum as I help you.
Ok, thank you Javier. You could be right that in the passed a bug served my purpose... ;-)