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

marianol

Members
  • Posts

    729
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by marianol

  1. A quick how to with MySQL and other database examples: 1) Ensure Driver is in the Classpath It is important to ensure that the drivers for your database are included in the JasperServer classpath. Normaly that will be either your JasperServer WEB-INF/lib or your Tomcat lib folder For my MySQL the driver .jar file can be downloaded here http://dev.mysql.com/downloads/connector/j/ 2) Ensure that the Driver Class Name is correct The following are some example driver class names for various databases: MySQL: com.mysql.jdbc.Driver Ingres: com.ingres.jdbc.IngresDriver Oracle: oracle.jdbc.OracleDriver SQL Server: com.microsoft.sqlserver.jdbc.SQLServerDriver 3) Database Privileges When creating Database users, you must ensure that the user has the appropriate permissions to your database as well as from the server that JasperServer is running on. Many databases, including MySQL, also require the user grants to include the specific host from which connections are allowed. Otherwise, when testing the JDBC connection, a connection may not be allowed even though the username and password are correct. For example, you may refer to the following page for Setting up MySQL users: http://dev.mysql.com/doc/refman/5.1/en/adding-users.html 4) Ensure Database URL is correct Ensure that the Database URL string entered when defining your JDBC Connection is consistent with what is required for your specific database and database driver. Example Database Connection URLs MySQL: jdbc:mysql://localhost:3306/mydatabasename?useUnicode=true&characterEncoding=UTF-8 PostgreSQL jdbc:postgresql://localhost:5432/mydatabasename SQL Server jdbc:sqlserver://localhost:1433;databaseName=mydatabasename;SelectMethod=cursor Replace localhot to your MySQL hostname if it's running in a diferent machine, and also mydatabasename for the name of the database you want to connect. Hope this helps :) MarianoL
  2. I looks like it cannot get the data type of the field you are choosing. Can you enable the "SQL generated for domain queries" from Manage->Log Settings ? And see what that shows. You can also check on the Adhoc cache. If you send me the domain definition I can try to replicate it in my environment. Best, Mariano
  3. It is definitely doable. Jasper Report Server APIs are very powerful and allow you to do almost anything from browsing the repository, managing users and roled to running and viewing reports. Check the Web Services documentation: http://jasperforge.org/espdocs/docsbrowse.php?id=86&type=docs&group_id=112&fid=352 Also there are a couple of examples in of your Jasper Report Server instalation folder (under samples) there is one in PHP using SOAP and anotherone in java. Mariano
  4. Hi montexristos, The problem that you are having is the stars (*) that you are adding in the the UUID on the report GET request. So change the line: $uri = $url.'*'.$uuid.'*'; to: $uri = $url . $uuid ; And it should work fine. The problem comes from a typo in the Web Services Guide. Around Page 39, where it says " http://<host>:<port>/jasperserver[-pro]/rest/report/*d7bf6c9-9077-41f7-a2d4-8682e74b637e*" the "*" at the beginning and end of the UUID are not needed (if you add them you receive an error), so ignore those and you should be fine. Also, there is a nice PHP class that uses cURL and provides a wrapper for RESTful services called PEST, that will help you. Check it out here, http://github.com/educoder/pest. It is very useful, below is a an example on using this class to do the requests, as you can see is very clean and also it will give you the request body in a smpleXML object. Best, Mariano Code:<?phprequire_once 'PEST/PestXML.php';$JSRest = new Pest(http://localhost:8080/jasperserver/rest/);$JSRest->curl_opts[CURLOPT_HEADER] = true;$restData = array( 'j_username' => $_POST['username'], 'j_password' => $_POST['password']); try { $body = $JSRest->post('login', $restData); $response = $JSRest->last_response; if ($response['meta']['http_code'] == '200') { // Respose code 200 -> All OK // Extract the Cookie and save the string in my session for further requests. preg_match('/^Set-Cookie: (.*?)$/sm', $body, $cookie); $_SESSION["JSCookie"] = '$Version=0; ' . str_replace('Path', '$Path', $cookie[1]); // Now just go header("location: home.php"); exit(); } else { $errorMessage = "Unauthorized HTTP Code: " . $response['meta']['http_code']; }} catch (Exception $e) { $errorMessage = "Unauthorized Exception: " . $e->getMessage() . "<br>"; }?>
  5. Hi, I am Marina Ryzhikova, the Jaspersoft QA Manager. I am responsible for QA for all open source and professional edition releases. We are looking for community members to help us: * Understand your usage and report development needs * Improve the iReport user experience by exploring iReport 3.1.4 and logging tracker tickets for any usability issues you note. * Improve the overall quality iReport by logging tracker tickets for any quality issues you note. If you are interested in helping with this testing, log in to the JasperForge, and log your bugs here: Bug Tracker for iReport Designer
×
×
  • Create New...