The Formula Editor now allows you to pass the Security Context to a user-defined formula (UDF) function.
You can call getSecurityContext () in your formula, which will pass the returning object to your UDF function. The method getSecurityContext() returns a DbSecurityContext type object, which provides the method get () to get the Security Context instance transfer from Server or Designer.
DbSecurityContext is a new data type for the SecurityContext object, since the data type of all the variables used in UDF functions should be DbValue.
The following is an example.
Import userClass from "UserFunction";
userClass.getData(getSecurityContext(), @country, …);
JReport provides you with two API methods which allow you to bring out your own publishing tool.
DeploymentWizard
DeploymentWizardFactory
In JReport Designer, there is a config.xml file in <
install_root>\bin
. This file corresponds with the Options dialog. You can make it configurable by modifying the XML file. Designer loads information from the XML file and configures the Options dialog when it starts up.
When you click File > Publish and Download > Publish to Server in JReport Designer, it will first check if there is deployWizardFactory in the ReportOption, and will then try to create new instance by the class name. If the class of the customized deployWizard has been successfully loaded, its wizard will be shown. Otherwise, the default publish wizard will be shown.
When you click on the View tab to view a report that requires the security context to run, JReport Designer will use the implemented JRSecurityContextFactory to instantiate the SecurityContext instance which will be used to execute the report.