Jump to content

damonf

Members
  • Posts

    11
  • Joined

  • Last visited

damonf's Achievements

Apprentice

Apprentice (3/14)

  • First Post Rare
  • Collaborator Rare
  • Conversation Starter Rare
  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. Thanks, Guilio, great news! I've dug into it a bit already so we may be able to do a first cut at the implementation, especially if you have some guidance about the best approach. In particular, how do you obtain the FieldsProvider for the query from the Wizard dialog code? hope to help, d.
  2. Tim Cloonan suggested I ask in this forum for input on a new feature I'd like to write and submit. We have customized iReport to use a custom data source (based on HQL-like syntax being sent to our J2EE server) in the wizard. Without our mods, the Wizard does not allow or accept query text for custom data sources the way it does for SQL, and our change addresses this. To implement this I've added code to the wizard to check for a new "Queryable" interface on the selected JRDataSourceProvider, and if this interface is implemented the query pane is enabled and the user can enter the report query in the wizard. The Queryable interface supports getting all the fields for the submitted query via getFields(String queryTxt). Note that the existing getFields(JReport) is not useful from the Wizard as there is no report to send in, and/or the report does not have a query. I'm not thrilled with this approach, and would rather access a custom QueryExecutor with a JRFieldsProvider, but I was unable to figure out how to access the configured QueryExecutor(s) and FieldsProviders from the Wizard code. This is already a bit rambling, but how would people suggest I configure a FieldsProvider in such a way that the Wizard works in the most intuitive manner - which is to say that the available fields are auto-populated for custom queries, just like they are for SQL queries? many thanks...
  3. The error output goes into a cmd window that is usually behind the iReports main window.
  4. Many thanks to Guilio for adding the dynamic field loading support in 1.3! Here's my tips on how to get the Fields to automatically populate based on a custom query/custom data source. The docs are more geared for programmatically calling custom data sources, I think, rather than using iReport, so this may be useful to people: I upgraded to iReport 1.3.0 (which has a FieldsProvider interface) and implemented a QueryExecutor, QueryExecutorFactory and FieldsProvider. The QueryExecutorFactory and FieldsProvider are registered with iReport under the Options > QueryExecutors menu option. The FieldsProvider has a method that takes a JRDataset as a parameter, and that has the Query (with queryText) in it. The query can be used to determine the fields. (I just manually instantiated an instance of my own custom JRDatasource using the query text and asked it for its fields, but your method of determining the field list from the query text may vary). Also I have a trivial JRField class that extends JRBaseField and adds a constructor that takes field name, description, class, etc. This is what is returned by my FieldsProvider. I also added a JRDatasourceProvider along the way, but I don't think that's critical to the solution. I then went to Data>Report query menu option, and manually typed in my query type (as named when I registerd the QueryExecutor) and clicked the "Read Fields" button on that screen. This seemed to set my fiels automatically from my (custom) query.
  5. I finally figured it out, so, for those of you reading this because you have a similar problem here's what I did: I upgraded to iReport 1.3.0 (which has a FieldsProvider interface) and implemented a QueryExecutor, QueryExecutorFactory and FieldsProvider. The QueryExecutorFactory and FieldsProvider are registered with iReport under the Options > QueryExecutors menu option. The FieldsProvider has a method that takes a JRDataset as a parameter, and that has the Query (with queryText) in it. The query can be used to determine the fields. (I just manually instantiated an instance of my own custom JRDatasource using the query text and asked it for its fields, but your method of determining the field list from the query text may vary). Also I have a trivial JRField class that extends JRBaseField and adds a constructor that takes field name, description, class, etc. This is what is returned by my FieldsProvider. I also added a JRDatasourceProvider along the way, but I don't think that's critical to the solution. I then went to Data>Report query menu option, and manually typed in my query type (as named when I registerd the QueryExecutor) and clicked the "Read Fields" button on that screen. This seemed to set my fiels automatically from my (custom) query.
  6. I am also having this issue. Any guidance or pointers to sample code or docs would be appreciated. The JRDataSourceProvider I've coded pulls the query from the report in the create() method (where else would I get the query?) and sets the fields by executing that query. Unfortunately, iReport does not call create() using the query until it runs a report. Is there some other way to get iReport to use the query (entered in the menu: Data > Report query) to drive the avaialble fields. I need this to happen for both report compilation and also wizard-driven report generation. many thanks in advance, d.
  7. I'm using a JRDataSourceProvider class to get my JRDataSource and fields list, but I cannot seem to get the "query" configured under the Data > Report Query menu item to drive the Fields list. (the create() method passes in the JRReport with the associated query string, but create() is not called until I run the report, and I need the fields list earlier to compile properly). What I'd like is to enter a query (a custom HQL/hibernate query) with say, 5 fields, and then have those 5 fields be valid for compiling my report. The SQL setup seems to do this. Even better would be to have the Wizard for building reports use my query to format the entire report. thanks for any help!
  8. I have made some progress by using a JRDataSourceProvider rather than a JRDataSource. The data sources menu option and dialog allow *either* of these configurations, and the JRDataSourceProvider returns the allowable Fields via a getFields() method. Still not fully working, however, and any pointers to examples of how to set up custom sources is appreciated.
  9. I'm registering a custom JRDataSource that I built with iReports, but don't see any method that accepts query text. How do I get the query in iReport to be executed to create the JRDataSource? thanks for any help!
  10. I am able to register a custom data source with iReports, but am having trouble with the validation of the fields returned. Can someone help with a breif description of what interface to implement and how to register it with iReports so that the Jasper compile process does not fail with an error like this: 1.ÂFieldÂnotÂfoundÂ:Âhazardname ÂÂÂÂ atÂnet.sf.jasperreports.engine.design.JRAbstractCompiler.verifyDesign(JRAbstractCompiler.java:267) ÂÂÂÂ atÂnet.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:144) ÂÂÂÂ atÂnet.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:105) ÂÂÂÂ atÂnet.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:127) ÂÂÂÂ atÂnet.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:109) ÂÂÂÂ atÂit.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:507) ÂÂÂÂ atÂjava.lang.Thread.run(Thread.java:595) I added a QueryExectutor entry (registering a class that implements: JRDataSourceProvider) but that did not work. I am using Jasper 1.2.6 right now. Any help would be greatly appreciated.
  11. I'm building a custom data source for iReports, but having some trouble because I can't find where my errors (System.err, printStackTrace() etc.) are going. Any help would be great. thanks, d.
×
×
  • Create New...