-
custom function
im trying to create a custom function that subclasses AbstractFunction
i want to add an additional field that will print some string. but the problem is the string is in the session (HttpSession), is there any way to fetch it from there? nyway, the obvious way is to print the string first into the file and then read the file from the function class. im looking for more elegant ways.
-
Re: custom function
and btw, how do i turn off the debug statements? 
im working with servlets and i dont want jfreereport messing up the console (i miss the exceptions when debugging).
-
Re: custom function
Hi,
to your first question: Put the HttpSession-Object into the ReportProperties of the JFreeReport object, you can query them from within the function.
To turn off the debug-statements, set the SystemProperty "com.jrefinery.report.NoDefaultDebug" to "true" and everything vanishes. In case you use Log4J for logging, you may use
the Log4JLogTarget for logging instead. This one can found at http://cvs.sourceforge.net/cgi-bin/v...ype=text/plain
Have more fun,
said Thomas
-
Re: custom function
thank you!
-
Re: custom function
hi again.. i still have problem.. all worked except for this part :
> you can query them from within the function.
heres my custom function :
public class ReportQueryFunction extends AbstractFunction {
....
public void pageStarted(ReportEvent event) {
this.reportQuery = getProperty("reportQuery");
}
i tried this.reportQuery = this.getProperty("reportQuery");
also super.getProperty("reportQuery");
which is jfreereport-object's properties?
---------------
i set the "reportQuery" from the servlet that instantiated the JFreeReport object :
JFreeReport report = new JFreeReport();
report = gen.parseReport("\myxmlfilehere.xml");
report.setProperty("reportQuery", "someStringValue");
--------------------
-
Re: custom function
Hi,
A almost correct.
JFreeReport's functions use their own set of properties to get configured. This is what Function.getProperty() queries. To query a reportproperty you'll have to call:
public void pageStarted(ReportEvent event) {
this.reportQuery = event.getReport().getProperty("reportQuery");
}
(Hint: Have a look at com.jrefinery.report.functions.ReportPropertyFunction, it does what you want. But writing an own implementation is at least a perfect exercise ;-) )
Have more fun,
said Thomas
-
Re: custom function
Taqua, hey thanks again
i checked out the demo function, i should have read all the sources
i wasnt expecting its all there already ;P
thanks and have a nice day!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules