Jump to content
We've recently updated our Privacy Statement, available here ×

msn

Members
  • Posts

    8
  • Joined

  • Last visited

msn's Achievements

Rookie

Rookie (2/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. I figured it out myself through trial and error. In order to make JasperServer recognize my custom query language, I had to add it to the following file: ...\jasperserver-3.5.0\apache-tomcat\webapps\jasperserver\WEB-INF\flows\queryBeans.xml As my custom query language is "webscraper", I added <value>webscraper</value> to it so it looks like this: ...<property name="queryLanguages"> <list> <value>sql</value> <value>hql</value> <value>webscraper</value> </list></property>...[/code]Also I figured out, that the DataSource reference to when adding the report to JasperServer no longer matters. It could be any data source. When the <queryString> is supplied, and the custom language recognized, the correct data source will be created by the QueryExecuter class. I believe this connection between query language and QueryExecuter class is made in the applicationContext-webscraperDS.xml.
  2. Hi all First of all, I am working with JasperServer and iReport version 3.5.0. I have made a custom data source which seems to work fine. I have based it on the WebScraper example in order to make sure that all names are correct (as long as I am only trying to get it to work anyway), but I have changed the functionality of it a bit. In iReport, when I add a classpath to the needed .class files, add a query language 'webscraper' (matching that specified in applicationContext-webscraperDS.xml), and set the data source to be Query Executer mode, then everything is working just fine. On the JasperServer, my custom data source is available in the list when I add a new Data Source on the JasperServer. I have uploaded a test report, which I have set to use my custom data source. The report does show, but it is filled with data from the custom data source using the data source's default properties (default parameters), NOT based on the <queryString language="webscraper"> of the report. That is why I guess that the QueryExecuterFactory is never invoked, and as there are no errors it must not even try. Is there a way to add a Query Executer mode to the JasperServer, that forces the use of the QueryExecuterFactory (as pointed to in the applicationContext-webscraperDS.xml)? Or does anyone have another idea to why the query string is not used, even though the report has one defined? Any ideas are appreciated. Thanks
  3. I have only tried this with JasperServer 3.5.0, but the only thing you have to do, is in iReport to add a parameter of type String which is called "LoggedInUsername" (and that's the name reserved by JasperReport). This should correspond to manually adding the jrxml as listed in my last reply. Come to think about it, the LoggedInUsername gives you the login name of the user currently logged in to the JasperServer, and not the attached Full Name field of this Jasper user account. However, if the username (not the full name) would suffice, for me having the LoggedInUsername as String parameter replaced the need for having both the "LoggedInUser" parameter and the second parameter with default value $P{LoggedInUser}.getUsername(). I think perhaps "LoggedInUserFullName" exists as well. Also a String parameter that Jasper provides automatically without any input control. Post Edited by msn at 01/11/2010 16:30
  4. On a side note, I have switched to using: <parameter name="LoggedInUsername" class="java.lang.String" isForPrompting="false"/> This eliminates one parameter in order to get the user name, and I have experienced it to be a more stable solution.
  5. Why not simply print todays date, instead of having an input parameter? A Java.util.Date field filled with new Date() will give you todays date. The other problem might be a timezone difference between your iReport installation and your JasperServer installation. I think it is using the machine settings. Post Edited by msn at 01/07/2010 12:48
  6. You should be able to avoid the input control. So you say that the correct value is passed to the 2nd report, but the value is put in the input control instead of directly into the parameter? It sounds like you are missing one or more parameters then. Are you passing all needed parameters?
  7. Yes, it will still be passed to your report as a Date object. You only change the input format, as the system needs to know how to parse the string to make the date object. Of course the change will apply to all reports using date input controls on the same jasper server, but you do not have to change how your reports use the date objects. It is only how the user types the input. It does not affect converting the Date object back to string either. You still need to do this yourself, e.g. using SimpleDateFormat.
  8. Hey I just figured this out myself recently. Go to your folder corresponding to the following (depending of course of your jasper server version and installation path): C:\Program Files\Jaspersoft\jasperserver-3.5.0\apache-tomcat\webapps\jasperserver\WEB-INF\bundles and open up jasperserver_config.properties in a text editor. Simply swop around the month parts with the day parts, e.g. date.format=dd-MM-yyyy datetime.format=dd-MM-yyyy HH:mm calendar.date.format=%d-%m-%Y calendar.datetime.format=%d-%m-%Y %H:%M After restarting you jasper server, your input control should now expect entries of dd-MM-yyyy when typing in the date manually, and also if you use the calendar control to select a date this will display as dd-MM-yyyy as well.
×
×
  • Create New...