Jump to content

mledda

Members
  • Posts

    4
  • Joined

  • Last visited

mledda's Achievements

Newbie

Newbie (1/14)

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

Recent Badges

0

Reputation

  1. Great Post but this one didnt quite work for me. Here is my work around - http://jasperforge.org/plugins/espforum/view.php?group_id=112&forumid=102&topicid=86690
  2. See - http://jasperforge.org/plugins/espforum/view.php?group_id=112&forumid=102&topicid=86690
  3. Im Not sure if i understand you correctly - but i assume you are trying to get a parameter a user input from the jasper server interface into your query? After you have told jasper server you will be entering a parameter (Edit your report and see "Controls & Resources" - add input control) get the parameter name you specified in the add inport control wizard and add it to your report (.jrxml file) as a parameter type - i.e ==================================================== <parameter name="p_auditDate" class="java.lang.String"/> ====================================================== Then in the query you upload to the server (or define on the spot) in "Query" under the same report edit option as mentioned above, simply add $P{p_auditDate} in your query to obtain the parameter the use has input. i.e - ====================================================== DECLARE @auditDate date DECLARE @format varchar(30) DECLARE @charDate varchar(30) SET @charDate = CONVERT(varchar(30), $P{p_auditDate}) SET @format = substring(@charDate,9,2) + ' ' + substring(@charDate,5,3) + ' ' + substring(@charDate,25,4) SET @auditDate = CONVERT(date, @format) Select date from database where date = @charDate ====================================================== FYI - The above conversion is what needs to be done when comparing date input by users (when using a date parameter) with a datetime parameter in sybase. Also ensuring you have uploaded the latest .jrxml to your jasperserver instance.
  4. Hi Guys, I have spent the last week or so getting JasperServer 4.0.0 CE running on jboss 5.1.0 GA with a sybase (12.5.*) backend so i thought i might share - Sorry its not too neat, attachment may be easier to read (also included the sybase jdbc driver - note that jconn will not work as it could not handle the null exceptions - you can always rewrite some java code if you desperately need it) NOTE: The scheduler (quartz) within JasperServer will not work with these changes due to the Sybase backend. Specifically there is no "delegateClass" that works with the version of quartz released in JasperServer 4.0 CE and sybase 12.*. Other DB can be utilized - Class Summary AttributeRestoringConnectionInvocationHandler Protects a Connection's attributes from being permanently modfied. CloudscapeDelegate Deprecated. Use the StdJDBCDelegate for latest versions of Derby DB2v6Delegate Quartz JDBC delegate for DB2 v6 databases. DB2v7Delegate Quartz JDBC delegate for DB2 v7 databases. DB2v8Delegate Quartz JDBC delegate for DB2 v8 databases. DBSemaphore Base class for database based lock handlers for providing thread/resource locking in order to protect resources from being altered by multiple threads at the same time. FiredTriggerRecord Conveys the state of a fired-trigger record. HSQLDBDelegate This is a driver delegate for the HSQLDB database. JobStoreCMT JobStoreCMT is meant to be used in an application-server environment that provides container-managed-transactions. JobStoreSupport Contains base functionality for JDBC-based JobStore implementations. JobStoreSupport.RecoverMisfiredJobsResult Helper class for returning the composite result of trying to recover misfired jobs. JobStoreTX JobStoreTX is meant to be used in a standalone environment. JTANonClusteredSemaphore Provides in memory thread/resource locking that is JTA Transaction aware. MSSQLDelegate This is a driver delegate for the MSSQL JDBC driver. PointbaseDelegate This is a driver delegate for the Pointbase JDBC driver. PostgreSQLDelegate This is a driver delegate for the PostgreSQL JDBC driver. SchedulerStateRecord Conveys a scheduler-instance state record. SimpleSemaphore Internal in-memory lock handler for providing thread/resource locking in order to protect resources from being altered by multiple threads at the same time. StdJDBCDelegate This is meant to be an abstract base class for most, if not all, DriverDelegate implementations. StdRowLockSemaphore Internal database based lock handler for providing thread/resource locking in order to protect resources from being altered by multiple threads at the same time. UpdateLockRowSemaphore Provide thread/resource locking in order to protect resources from being altered by multiple threads at the same time using a db row update. Util This class contains utility functions for use in all delegate classes. WebLogicDelegate This is a driver delegate for the WebLogic JDBC driver. NOTE: Same logic below applies to creating any new data source. ---------------------------------------------------------- ---------------------------------------------------------- Installing "Jasperserver 4.0.0" on "Jboss 5.1.0 GA" ---------------------------------------------------------- ---------------------------------------------------------- NOTE: For Jboss and tomcat the application servers - The servers must be stoped during installation 1) Download the Jasper server Bin Release (http://sourceforge.net/projects/jasperserver/files/JasperServer/JasperServer%204.0.0/jasperreports-server-cp-4.0.0-bin.zip/download) * Extract the js.bin.zip file (NOTE: reccomend high level area such as C: or C:"Program Files") * Location now Refered to as <js.bin> 2) Goto the folder <js.bin>buildomaticsample_conf * copy the mysql_master.properties file to: <js.bin>buildomatic * rename the file to default_master.properties 3) Modify the default_master.properties file to suit your specifications (should just be commenting in/out options/ changing dir's) * Choose your app server type (tomcat 5/6, jboss, glassfish, weblogic, websphere) - Ensure you only have one selected (comment out default) * Choose the server root directory for your selected app server (e.g - "appServerDir = c:jboss-5.1.0.GA") - Ensure the default path is commented out * Modify the DB details accordingly (dbHost, dbUsername, dbPassword) * Uncomment the dbPort field and set the port number - e.g - "dbPort=99999" * Ensure any other uncommented lines are correct to your configuration (NOTE: If you are modifying the jasperserver database skip the next 6 steps - start at step one of "JasperReports Server 4.0 with Sybase 12.5.*") 4) Goto <js.bin>buildomaticinstall_resourcessqlmysql (Assuming your using mysql - else choose appropriately) * Modify the js-create.ddl, quartz.ddl, js-pro-create.ddl files according to your mysql version. * NOTE: All "type=InnoDB;" had to be changed to "engine=InnoDB;" * NOTE: The queries are only supported in mySQL 5.1. Newer versions have Reserved word issues (maxValue field in js-create). 5) If you are using a local mysql server Login to your mysql instance as root in the <js.bin>buildomaticinstall_resourcessqlmysql Directory and complete the following: * create database jasperserver character set utf8; * grant all on *.* to jasperdb@localhost identified by 'password'; ("Change Password at will - remember to modify default_master.properties file accordingly") * flush privileges; (reload privilege tables) * use jasperserver; * source js-create.ddl * source quartz.ddl * exit 6) Goto the <js.bin>buildomatic Directory and run the "js-install-ce.bat" batch file. * Options may appear to load new data into the DB (y/n options) 7) Goto <js.bin>buildomaticlogs and open the most recent log file * Scroll threw and look for any errors * For Troubleshooting please refer to - "http://transact.dl.sourceforge.net/project/jasperserver/JasperServer/JasperServer%204.0.0/JasperReports-Server-CP-Install-Guide.pdf" * (NOTE: If errors occoured it is reccomended that you remove all data concerning jasperserver from your app server and start this process again) 8) Goto you application Server Directoty and start the server * For Jboss - <Jboss dir>bin * Then run the "run.bat" Batch File 9) Open up an internet browser and goto http://<host>:<port>/jasperserver/ (e.g "http://localhost:8080/jasperserver/") * Default admin login details for jasperserver is Username:"jasperadmin" Password:"jasperadmin" ------------------------------------------------ ------------------------------------------------ JasperReports Server 4.0 with Sybase 12.5.* ------------------------------------------------ ------------------------------------------------ 1) Goto <js.bin>buildomatic and open the "default_master.properties" file you created in step 2 of "Jasperserver 4.0.0" on "Jboss 5.1.0 GA" * change the dbType to equal "sybase" (dbType=sybase). * Modify any other DB settings you need to - i.e port, host, username, password. * Now that you have told jasper what database it will be using we have to create it and tell jasper how to use it. 2) To add Sybase as a known DB type in jasper * Goto <js.bin>buildomaticbin and open the "setup.xml" * Find the comment - "Checking database type" (Underneath should be 6 lines of code such as - "<equals arg1="${dbType}" arg2="db2" />") * Add a new line within the <or> tags allowing sybase as a new type - "<equals arg1="${dbType}" arg2="sybase" />" * In the same <js.bin>buildomaticbin directory open the "validation.xml" * Find the tag - <target name="check-dbtype-ce" (Underneath should be two database declarations - mysql and postgresql) * Add a new line within the <or> tags allowing sybase as a valid Database type - "<equals arg1="${dbType}" arg2="sybase" />" * Repeat the last step under the tag - <target name="check-dbtype-pro" 3) Goto <js.bin>buildomaticinstall_resourcessql and create a folder called "sybase" * From the "mysql" folder within this directory copy the "js-create.ddl", "quartz.ddl" and the "supermart-update.sql" into your new syabase folder. * Open the "js-create.ddl" in your sybase directory and modify it in accordance to sybase syntax. * Remove all "engine=InnoDB;" - Remember to keep the semi-colons * bigint to numeric(19,0) * all blobs (longblob, tinyblob, blob) to image * If any field does not specify "not null" make sure to specify "null" * Note: There may be some more syntax issues, you will have to view the logs after the install to identify * Open the "quartz.ddl" in your sybase directory and modify it in accordance to sybase syntax. * Change - "DROP TABLE IF EXISTS QRTZ_JOB_LISTENERS;" - To - "IF object_id('database.QRTZ_JOB_LISTENERS') IS NOT NULL DROP TABLE QRTZ_JOB_LISTENERS;" * Remove all "engine=InnoDB;" - Remember to keep the semi-colons * Change all the Field types as per the last step. 4) Goto <js.bin>buildomaticconf_sourcedb * Copy the "sqlserver" folder and paste it into the same directory - renaming it "sybase" * Download the jtds sybase driver from - http://jtds.sourceforge.net/ - and place the jar file into <js.bin>buildomaticconf_sourcedbsybasejdbc * In the <js.bin>buildomaticconf_sourcedbsybase open the "db.properties" file * Set your port number - (e.g dbPort=9999) * Set your Driver class - jdbcDriverClass=net.sourceforge.jtds.jdbc.Driver * Set your Datasource class - jdbcDataSourceClass=net.sourceforge.jtds.jdbcx.JtdsDataSource * Set your maven infomation - maven.jdbc.groupId=sybase maven.jdbc.artifactId=jtds maven.jdbc.version=1.2.5 (NOTE: The version is the number that appears on the sybase driver you downloaded) * Set your hibernate Dialect - hibernateDialect=org.hibernate.dialect.SybaseDialect * In the <js.bin>buildomaticconf_sourcedbsybase open the "db.template.properties" file * Set your default database names - (The databases within the service you will define) - (Note: The user you specified in the db settings must be able to create a DB unless you specify an existing Db for these names) * Set the "admin.jdbcUrl", "js.jdbcUrl", "sugarcrm.jdbcUrl" and "foodmart.jdbcUrl" urls * The syntax for a jtds url connection is - jdbc:jtds:sybase://server:portnumber/databasename * In the <js.bin>buildomaticconf_sourcedbsybase open the "scripts.properties" file * Depending on your privilages you may need to modify this * For example change all statements for the six fields to simply equal ";" * Or simply leave as is (Changing syntax for sybase where required) 5) Goto <js.bin>buildomaticjdbc-dep and open the "pom.xml" file * Change the groupId data to "sybase" * Change the artifactId data to "jtds" * Change the version data to the version of the jtds driver you downloaded - e.g "1.2.5" 6) Goto <js.bin>buildomaticconf_sourceieCe and open the "applicationContext-report-scheduling.xml" file * Find the tag - <property name="quartzProperties"> * Replace the entire value sub tag with - <value> org.quartz.jobStore.driverDelegateClass = ${quartz.delegateClass} org.quartz.jobStore.tablePrefix = ${quartz.tablePrefix} org.quartz.jobStore.selectWithLockSQL=SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ? </value> 7) Goto <js.bin>buildomaticconf_sourcetemplates and open the "js.jdbc.properties" file * Change all the .jdbc.url fields to equal the relevant url's - e.g "jdbc:jtds:sybase://server:9999/database" 8) Goto <js.bin>buildomaticinstall_resourcesexport * Copy the "js-catalog-mysql.zip", "js-catalog-mysql-ce.zip" and "js-catalog-mysql-pro.zip" files and paste them into the current directory. * Rename the files "js-catalog-sybase.zip", "js-catalog-sybase-ce.zip" and "js-catalog-sybase-pro.zip" accordingly. 9) Goto the <js.bin>buildomatic Directory and run the "js-install-ce.bat" batch file. * Options may appear to load new data into the DB (y/n options) 10) Goto <js.bin>buildomaticlogs and open the most recent log file * Scroll threw and look for any errors * For Troubleshooting please refer to - "http://transact.dl.sourceforge.net/project/jasperserver/JasperServer/JasperServer%204.0.0/JasperReports-Server-CP-Install-Guide.pdf" * (NOTE: If errors occoured it is reccomended that you remove all data concerning jasperserver from your app server and start this process again) 11) Goto you application Server Directoty and start the server * For Jboss - <Jboss dir>bin * Then run the "run.bat" Batch File * Wait a minute or so untill jboss says it has started 12) Goto the host in which your jboss is installed/jasperserver * e.g - http://localhost:8080/jasperserver/ * Note: The Default admin login details for jasperserver is Username:"jasperadmin" Password:"jasperadmin" ============================================================ Attached are the "js-create.dll", "quartz.dll" from the buildomaticinstall_resourcessqlsybase directory Saves you re-writing the same code.... Post Edited by mledda at 04/21/2011 03:53 Post Edited by mledda at 04/21/2011 04:12 Post Edited by mledda at 05/03/2011 00:34
×
×
  • Create New...