2001 JI Open Discussion Posted August 17, 2006 Share Posted August 17, 2006 By: Peter Kelley - yellekau Request For Enhancement 2002-08-05 20:36Recently the webwork open source project (now part of opensymphony) added Jasper Reports as a view technlogy to their MVC framework. The way this was done was to create a custom data source that read the results of webwork action execution. This allowed reports to be generated from the same data as web pages or XML documents with no change to the command logic. In order to do this webwork uses the field name as a means to define what data to retrieve. Unfortunately this creates problems when field names contain characters invalid in Java identifiers such as the '.' character as the reports do not compile. Would it be possible for Jasper Reports to add an optional attribute to the field tag called query which would then be included in field objects passed to data sources ? This would allow the data source to get the data without overloading the name attribute. Peter Kelley By: Teodor Danciu - teodord RE: Request For Enhancement 2002-08-06 05:18 Hi, The initial versions of the library allowed the use of any name for fields, variables, groups, etc. Then, in order to enhance speed when filling the reports, I chose to give up using the name of the fields to retrieve the field objects from the map when evaluating expressions. Instead, I declare normal Java variables using the supplied field name, which I can use directly in the report-generated class. This is why the field names have to respect the Java naming conventions. In other words, it's very easy to get back to the older version that allowed the use of any name for the report fields, the only problem would be that this will slightly affect performance in report filling process. If you can organize a lobby for this, I could accept it. :)) Lets hear what the others have to say about this. Thank you, Teodor By: Peter Kelley - yellekau RE: Request For Enhancement 2002-08-06 16:45I think you misunderstand me. I'm not proposing any change in the way that names are handled. The problem is that the name attribute is being used for two things: the name of the field and the query used to retrieve it from the data source. With SQL result sets this isn't a problem as the name of the field is the name of the column and so it can be returned. With other data sources, however, the name of the field and the query used to retrieve it from the data source can be quite different. By changing things back to the way they were before and allowing special characters in the name there is still no seperation between the name and the query. What I am requesting is that an extra attribute query be added to both the XML report definition and the JRField interface. In this way the behavior and processing of the name field would remain unchanged for all data sources that only need the name. This would mean that the java variables could continue to use the name as before. Data sources that needed to have extra information on how to retrieve the value of a field with a given name could then use the query attribute to retrieve the value. My guess is that this would be a small change to make to the Jasper Reports code but it would mean a big increase in functionality for webwork. Peter Kelley By: Teodor Danciu - teodord RE: Request For Enhancement 2002-08-08 01:33 Hi, I think I got it now. Then I suppose that adding a new optional element called "fieldDescription" for the "field" element, just like we already added "parameterDescription" for the "parameter" element (check the DTD file to see it, because I forgot to mention it in the docs), would be exactly what you need. In the parameters case, this description is used for prompting purposes, but for fields you could use the text there as the extra information you need for extracting the field value in your special data sources. Thank you, Teodor By: Peter Kelley - yellekau RE: Request For Enhancement 2002-08-08 02:42Exactly, this would be perfect. Thanks for your prompt response. By: Peter Kelley - yellek RE: Request For Enhancement 2002-10-01 20:56I had a look at CVS recently to see if this feature (an optional fieldDescription element for the field tag) had been added bu the JRField interface did not seem to have been modified. Is this feature currently scheduled for a release any time soon ? Peter Kelley By: Teodor Danciu - teodord RE: Request For Enhancement 2002-10-02 03:21 Hi, This feature is in place for sometime now. Have you checked the JRField.getDescription() method? Thank you, Teodor Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now