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

gnatali

Members
  • Posts

    34
  • 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 gnatali

  1. This should be solved with the newer versions, (1.0+). Please make sure you follow the installation guide for community: (This step is required only for Community Edition): open the file [JRS_DIR]WEB-INFapplicationContext-WebServiceDataSource.xmlGo to line 49 of the xml file, inside the bean addQueryLanguage change the property beanName from queryLanguagesPro to queryLanguagesCeSave the xml file
  2. TIBCO Jaspersoft® Studio SVN plugin is based on subeclipse Video Tutorials [toc on_off::hide=1]Accessing Subclipse online documentation from TIBCO Jaspersoft StudioOpening perspective, adding repository, checkout project, simple show historyAdding a project to an existing repository. Initial import of the projectSynchronization, commit of a simple report and related resourcesSynchronization and update from headResolving conflicts and merge operationUseful External DocumentationSubclipse Usage TipsSubversion/Subclipse Tutorial
  3. Release NotesWorks on TIBCO JasperReports® Server, Community Edition : fixed a bug that was preventing the plugin to work on TIBCO JasperReports® Server, Community EditionNew Samples to guide you in advaced use cases:SubReport using the same result (Only one webservice call is made)Movie/Tv Series Sample: this sample use parametrized webservice query, this feature let you create a very flexible query that depends on parameters.A better Exception logging will help you understand easier what webservice call caused the exception In TIBCO Jaspersoft® Studio : added warning when response of the webservice is different than 200. In this case Jaspersoft Studio will show a dialog with the result of webservice call so you can better understand what was the issue with your webservice call (Screenshot 1) Ability to parse date and numeric fields from a string value specifying the pattern at report level: added 2 Parameters that will contain the String pattern to be used in the parsing:REPORT_DATE_FIELDS_PATTERN : Parameter name of the parameter that will contains the pattern to format datesREPORT_NUMBER_FIELDS_PATTERN : Parameter name of the parameter that will contains the pattern to format numbersScreenshotsScreenshot 1 VideosSamples : Find Movie/TV Series Report
  4. Hi, looks like the quey is wrong, What version are you using (both jrs and webservice datasource)? Can you post the query? There is a dedicated tab in the query editor in Studio that will show you the Query Otherwise you can find it in the jrxml Thanks G
  5. You can do that using the WebService Datasource. you find all the details in the project page: http://community.jaspersoft.com/project/web-service-data-source Please take the time to add a review of this project if you find it useful, the more feedback we get the better we can improve Thanks G
  6. Hi Stefan, the instructions were not designed for a docker installation. The backup is just there to make sure people are aware that they have to be careful with what they do in that folder :) I believe the issue you are facing is related to this bug: http://community.jaspersoft.com/web-service-data-source/issues/6661 Can you please double check the logs file and let me know if this is the case? I am planning on fixing this bug soon Thanks G
  7. Command Line Installer (Windows)TIBCO Jaspersoft® Studio installer can be executed via command line. Command Line installation supports also an Unattended Mode (Silent Mode) . [toc]Options for command line InstallerOption DescriptionOptionNotesSilent Mode (Optional) /SThis option will tell the installer to run in silent mode, no prompt will be required from userLicense Path (Optional)/LICENSEThe License path is optional, the license at the path defined will be copied into the installation folder of TIBCO Jaspersoft® Studio with the name TIBCOJaspersoft-JSS.license. If this option is specified it must be before the /D optionDestination Directory (Mandatory)/DThe Path where TIBCO Jaspersoft® Studio should be installed to. Sample Install CommandAssuming the following: Installer Path: JASPERSOFTInstallerTIBCOJaspersoftStudioPro-6.3.0.final-windows-installer-x86_64.exe License File (downloaded from support portal): C:JaspersoftMy Licensesjasperserver.license Desired destination Folder : C:SWJASPERSOFTJSS630 The install command will be: \JASPERSOFT\Installer\TIBCOJaspersoftStudioPro-6.3.0.final-windows-installer-x86_64.exe /S /LICENSE=C:\Jaspersoft\My Licenses\jasperserver.license /D=C:\SW\JASPERSOFT\JSS\630 License File locationThis is valid only for the Commercial version of TIBCO Jaspersoft® Studio. You can also put the license directly in the installation folder , using the following name: TIBCOJaspersoft-JSS.license. The installer will look for the license following this flow: (Optional) If the command is executed including the /LICENSE option the license at specified path will be copied into the Installation folder with name: TIBCOJaspersoft-JSS.license. The license will be checked in the installation folder with name TIBCOJaspersoft-JSS.license. If no license is present the 30day evaluation license will be used.
  8. Sure! You find all the details at this page: http://www.jaspersoft.com/contact-us Thanks G
  9. gnatali

    Parameter Contributors

    Parameter ContributorWhat's for?With parameter contributor, you can take some parameters, play with them, and put back in the map some other parameters, or replace values of existing ones. Sample Use CaseLet's say that your report is displaying the grades for a given student. In your DB structure grades are kept in the table grades only for 1 year after the student got the degree. So you don't know which table you should get the list of grades from. What you want is to fire a query with the student name (or id or whatever) to get the year of degree. Then if this year is (llower than) < currentYear - 1 the table you are interested in is historical_grades otherwise is grades. Parameter Contributor can help you with that... how? Let's have a look!! Grade List ReportOur Grade list Report is fairly simple, it has a parameter STUDENT_ID and a parameter GRADES_TABLE_NAME. The GRADES_TABLE_NAME param is not prompted to the user, it will be populated by our parameter contributor. In our query we'll use it after the from clause: SELECT * FROM $P!{GRADES_TABLE_NAME} WHERE STUDENT_ID = $P{STUDENT_ID} (Have you noticed the different usage of the 2 parameters in the query? this is not related to the Parameter Contributor: parameters included with $P! will not be wrapped by quotes in SQL, but just injected in the sql query.) This is all we need here, the magic will happen in the parameter Contributor! How can I include a new Parameter Contributor?Parameter contributors are a JR extension point, so they are added as extensions. Short answer is : with a jar. Long answer is: we should have a look on what is inside this jar :) The key elements in a parameterContributor are: Parameter Contributor (s ... you may have more than one contributor)contains your business logic, is where the magic happenshas a method contributeParameters(Map<String, Object> parameters) . Here you have access to report parameters and you can add yours to the parameters map.must implement net.sf.jasperreports.engine.ParameterContributorParameter Contributor Factory:describe the list of contributors that you wish to add.must implement net.sf.jasperreports.engine.ParameterContributorFactoryExtension Registry Factory:will create the registry with your extensions to be loaded. In this case will just cointain our Parameter Contributor FactoryIs the one referenced from the jasperreports_extension.properties filemust implement: net.sf.jasperreports.extensions.ExtensionsRegistryFactoryjasperreports_extension.properties:You may have seen this already in other docs. Is the standard way to register extensions in JasperReports Library.Is a properties file, so you'll find key=value structurekey: if you are registering a parameter contributor the prefix must be net.sf.jasperreports.extension.registry.factory.parameter.contributor . Followed by a name you like. should be unique in jasperContextvalue : the class name of our Extension Registry Factorynet.sf.jasperreports.extension.registry.factory.parameter.contributor.grades.table=com.jaspersoft.parameter.contributor.GradesTableNameParameterContributorExtensionsRegistryFactoryGradesTableNameParameterContributorHere you can can find the jar with the source included (parameterContributor_GradesTable_java17_jrs601.jar ). Have a look in the code will be easier than read a periphrasis here. As we said the business logic is in: com.jaspersoft.parameter.contributor.GradesTableNameParameterContributor package com.jaspersoft.parameter.contributor; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Calendar; import java.util.Map; import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JRParameter; import net.sf.jasperreports.engine.ParameterContributor; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * @author Gianluca Natali */ public class GradesTableNameParameterContributor implements ParameterContributor { protected final Log logger = LogFactory .getLog(GradesTableNameParameterContributor.class); public static final String STUDENT_ID_PARAM = "STUDENT_ID"; public static final String GRADES_TABLE_NAME_PARAM = "GRADES_TABLE_NAME"; @Override public void contributeParameters(Map<String, Object> parameters) throws JRException { /* The contributor is not report dependent. So it will be executed for all your reports. * Here I check the presence of the parameter I use as flag. If is not there I will do nothing. */ //This is the parameter inputed by the user String studentIdParam = (String) parameters.get(STUDENT_ID_PARAM); if (studentIdParam == null) { return; } // Retrieving the connection from report parameters Connection reportConnection = (Connection) parameters.get(JRParameter.REPORT_CONNECTION); // Fire the query to find the student Student student = findStudent(studentIdParam, reportConnection); // Here my business logic to retrieve the table name int currentYear = Calendar.getInstance().get(Calendar.YEAR); boolean isInHistoric = student.getYearOfDegree() < currentYear - 1; String gradesTableName = isInHistoric ? "historical_grades " : "grades"; // Adding the grades table name to the parameters map parameters.put(GRADES_TABLE_NAME_PARAM, gradesTableName); } @Override public void dispose() { // Here you can dispose elements used from the contributor. this will be // called after the report is filled. As example you could close a jdbc // connection opened in the contributeParameters method } protected Student findStudent(String studentId, Connection connection) { String query = "SELECT full_name, degree_year, student_id FROM students where student_id=?"; Student student = null; /*Retrieving the student from db. check the jar for details*/ return student; } protected class Student { /*Student object definition. check the jar for details */ } } parametercontributor_gradestable_java17_jrs601.jar
  10. This page contains a list of common issues / misconfigurations using the Jaspersoft WebService Datasource . For additional information on this project please refer to the project's Home Page WebService Request IssuesIllegal Character in RequestIf you are passing in the Url some special chars (like a json string...) you will get the error below. Such character will have to be escaped, this is done automatically if you use the GET Parameters content type in the Webservice Query as explained in the Webservice Datasource Documentation net.sf.jasperreports.engine.JRException: Error creating request at com.jaspersoft.webservice.data.util.WebServiceConnector.createRequestForWs(WebServiceConnector.java:174) at com.jaspersoft.webservice.data.util.WebServiceConnector.callWS(WebServiceConnector.java:133) at com.jaspersoft.studio.data.webservice.designer.DesignerWidget.getTreeInputFile(DesignerWidget.java:388) at com.jaspersoft.studio.data.webservice.designer.FieldsArea.loadViewer(FieldsArea.java:175) at com.jaspersoft.studio.data.webservice.designer.FieldsArea.access$0(FieldsArea.java:154) at com.jaspersoft.studio.data.webservice.designer.FieldsArea$1.widgetSelected(FieldsArea.java:133) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4362) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1113) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4180) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3769) at org.eclipse.jface.window.Window.runEventLoop(Window.java:827) at org.eclipse.jface.window.Window.open(Window.java:803) at com.jaspersoft.studio.property.dataset.dialog.DatasetAction.run(DatasetAction.java:82) at org.eclipse.jface.action.Action.runWithEvent(Action.java:473) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511) at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:462) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4362) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1113) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4180) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3769) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:654) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) at com.jaspersoft.studio.pro.rcp.JSSProApplication.start(JSSProApplication.java:112) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608) at org.eclipse.equinox.launcher.Main.run(Main.java:1515) Caused by: java.lang.IllegalArgumentException: Illegal character in query at index 40: http://yourDomain.com/rest/?queryString={"jsonParam":{"jsonKey": "jsonVal"}} at java.net.URI.create(URI.java:852) at org.apache.http.client.fluent.Request.Get(Request.java:79) at com.jaspersoft.webservice.data.util.WebServiceConnector.createGetRequest(WebServiceConnector.java:254) at com.jaspersoft.webservice.data.util.WebServiceConnector.createRequestForWs(WebServiceConnector.java:164) ... 44 more
  11. For additional information on this project please refer to the project's Home Page. This page contains documentation of the Jaspersoft WebService Datasource. Usage in Jaspersoft® Studio Create a new Data Adapter of type WebServiceAfter installing the plugin a new Data Adapter Type will be available [toc]Configuring the Data AdapterThe properties needed are: NameServer URI: the first part or URI address, consider the same Data Adapter can be used to call different weservices, so this should include only the unmodifiable part of URL, but there is no check or rule governing thisConnection Type: possible Values are : POST, GET, Elastic Search ConnectionLanguage: is the language used to decode the response from the webservice, possible values are: xml or jsonAuthentication: the authentication methor required by the Webservice. You can extend this list via add ons to the pluginnonebasic: username and passwordGoogle Authentication: Google API key, this authentication method was build as a sample for extending the Webservice DataAdapterExample: Using the WebserviceDatasource in ReportsBy default the Query Language when you create a report using a Webservice DataAdapter is WebServiceQuery. When using the WebServiceQuery Language you will get a dedicated UI on the Dataset and Query Dialog in Jaspersoft Studio The configuration Have 3 different Views: Request: configure the Request to be sent to your WebserviceFields: Configure how the result from the Webservice call should be mapped to FieldsSource: At the end all the configurations in the first 2 steps is translated into a query in json format, you can always access the source itself and apply changes manually if needed. This query can also be copied and used in an Input Control Query in JasperReports Server. So your IC will be populated from WebService, in a breeze. Query - Request ConfigurationThe Configuration of the Request is the core of the query, so it may seem a bit complex at a first look. Let's describe each component: Query Language: WebServiceQueryBase URL: this url will be concatenated to the base URI we defined in the Data Adapter. As per our sample the OpenWeatherMap expose many APIs, each of this api have a different url, but the root uri is the same (the site domain). So the Base URL would be the 2nd half of the URL excluding the parameters (see image below)Content Type & Content of Request: what is the Content type requested by the webservice API? possible values are:XML: This will Show a text area to inout the Content of the Request, here you can paste your xmlJSON: This will Show a text area to inout the Content of the Request, here you can paste your JSONGET Parameters: for GET Request parameters are passed in the URL. Often the parameters contain special characters (as example when a parameter is expressed in json...) that will have to be escaped. This is done automatically, you will just have to add the parameters using the Add Button, insert Parameter Name and Value (see image below).TIP: You can also Drag&Drop A parameter from the parameters area at the bottom!Headers: Some APIs require you to pass some parameters in the header (as example an authentication key). You can do this easily using the dedicated areaValid for Any content Described above : as other query Languages in Jaspersoft you can use parameters inside the query "Everywhere". Sometimes you will be able to do it in this UI using the $P syntax, otherwise you can always switch to the source Tab and do it there. Drag&Drop of Parameters from the bottom area should always give you a shortcut Query - Fields ConfigurationAfter configuring the request is time to Map the result to Fields! To do That switch to the Fields tab and click the button "Get Server Response" . This will execute the request you just configured and will show you a UI to select the fields from the Result. We reused the existent dataAdapters XML and JSON as a base so you will recognize here a similar interface for selecting the fields. Also here Drag&Drop will help you in speeding up the configuration The Actions Required Are: Get Server ResponseDouble click the Root node (for the loop)Drag&Drop the fields from the left area (json/xml) to the right Fields ListClick Read FieldsOpen Data Preview Tab to check if your fields are correctly extracted Now you can Design you report using fields/parameters/variables, as usual :) String Pattern for Date and Numeric fieldsIn version 1.0 we introduced support for a String pattern to parse Date and Numeric fields from the json response. Just define the following parameters in your report to specify your desidered pattern: REPORT_DATE_FIELDS_PATTERN : Parameter name of the parameter that will contains the pattern to format datesExample: use the string pattern "yyyy-MM-dd HH:mm:ss" if your json field is in the format: "2015-11-17 03:08:39"REPORT_NUMBER_FIELDS_PATTERN : Parameter name of the parameter that will contains the pattern to format numbers SubReport and Additional DatasetsAny datasource that is not JDBC or JNDI powered suffer the same issue: there is no connection to be passed to the sub report/ subdataset. That's why when you specify Use same connection as parent you will experience errors in runTime. No worries, here we'll explain you how to address this problem! While working with subReport you may have different requirements: you have a main dataset and an additional dataset, that use 2 different webservice callyou have a main resultset that you wish to loop, and for each row you want to execute a new query (webservice call)you have a main resultset that you wish to loop, and for each row you want reuse the same json as the parent but with a different json queryMultiple datasets, Multiple queriesIn this scenario we'll use Data Adapters to fix the connection we want to use for each dataset. You can create DataAdapters in Studio and then publish them to the server. In your report dataset (the main report properties if you are configuring a subreport, the dataset properties if you are configuring an additional dataset) you can specify the default data adapter. Select this from the Studio workspace or the jrs repository. You can also point directly to the resource using the full path like this: "repo:/public/Samples/wsDatasource/Resources/Datasources/DataAdapter/NY_ES_DataAdapter". In the subreport configuration (or the dataset) specify not to use any connection at all (leave blank both the connection expression and the datasource expression. The only thing we'll have to do is passing some mandatory parameters for internal webservice datasource to work properly : uriKeyauthTypeKeyauthParametersKeylanguageKeyverbKeyYou can also pass directly the whole parametersMap for your convenience. Multiple datasets, Exactly the same json (only one webservice call)This is a very common usecase. JSON has a flexible structure and support hierarchies of objects, and arrays, so some times a single json returned from a Webservice is all we need to fill our report AND subreports. In this usecase what we want is: Our master report execute the webservice call, get the json, configure the json path and fields mapping for the main report needthe master will call the subreport passing the json already extracted and specifying a different json path for the root node and the fields mapthe subreport will no longer need a query and will just expect the fields from the json passed by the master reportGood news: This feature is part of the Webservice Datasource! You can pass the datasource from master to subreport (or dataset) specifying a Datasource expression. In this expression we'll use the clone method on the datasource: ((com.jaspersoft.webservice.data.query.IWSDataSource)$P{REPORT_DATA_SOURCE}).clone(jsonRootNode,subFieldsMap) the clone method support 2 parameters, you can execute it passing: zero parameter .clone() : the subreport will get exactly the same resultset, same json, same json root path and fields... not very useful eh? 1 parameter .clone(jsonRootNode): you can specify a different rootPath for the json file, the fields map will stay the same 2 parameters .clone(jsonRootNode,subFieldsMap) : you can specify both a new root path for the json AND a new mapping for the json fields. This is probably the most common usecase. You find a sample and more details at this pageUsage in JasperReports® ServerUsing WebService Datasource with Adhoc Samples : Find Movie/TV Series Report
  12. This page contains step by step instructions to install the WebService Datasource in JasperReports® Server and Jaspersoft® Studio. For additional information on this project please refer to the Project Home Page. Download WebService DatasourceExtract the zip downloaded from the Project's Release Area. Update: using version 1.5 on JasperReports® Server v6.4, only the zip Jaspersoft Web Service Data Source v1.5 was needed in the following steps The unzipped folder will be referenced as [WS_DS_DIR] from now on. Install Jaspersoft Studio PluginLocalize your Jaspersoft Studio Installation directory. We'll reference it as [JSS_DIR] from now onOpen the folder [WS_DS_DIR]JSSCopy the jar files in this folderOpen the folder [JSS_DIR]pluginspaste the previously copied jars(The above didn't work with standalone Jaspersoft Studio 6.4.0 and 6.5.1 on windows 10. What did work was putting the jar files into [JSS_DIR]dropinseclipseplugins as per this stackoverflow self answered question ) Install in JasperReports ServerLocalize your JasperReports Server web application folder. We'll reference it as [JRS_DIR] from now onOpen the folder [WS_DS_DIR]JRSWEB-INFCopy all the folder's contentStop your web server running JasperReports ServerOpen the folder [JRS_DIR]WEB-INFBackup this folder before executing next step! (this is not mandatory, but recommended)paste the previously copied files. Please note that it is not supposed to override any existing file.(This step is required only for Community Edition):open the file [JRS_DIR]WEB-INFapplicationContext-WebServiceDataSource.xmlGo to line 49 of the xml file, inside the bean addQueryLanguage change the property beanName from queryLanguagesPro to queryLanguagesCeStart your web server running JRSImport Samples in JasperReports Server repositoryNote: I found that the Jaspersoft Studio instructions above did not work for me (version 6.4.3). As mentioned in this Stack Overflow article (https://stackoverflow.com/questions/42116973/enable-jasper-studio-webservice-plugin), one way to get this to work is to add the three .jar files from /jrs into the jaspersoftstudio/dropins folder instead. In my case, I had also installed the ElasticJasper plugin (/blog/elasticsearch-and-jasper-reports-finally-together) and I had to uninstall that plugin completely before I was able to get the Web Service adapter to show. So, the alternate instructions are: Localize your Jaspersoft Studio Installation directory. We'll reference it as [JSS_DIR] from now onOpen the folder [WS_DS_DIR]JSSCopy the jar files in this folderOpen the folder [JSS_DIR]dropinspaste the previously copied jarsrestart Jaspersoft Studio
  13. Hi Erik, what font are you using? It may be a font that you have only in your local Studio but it is not available in the browser. If this is the case you can solve it using Font Extensions http://community.jaspersoft.com/wiki/custom-font-font-extension
  14. This is now possible using Web Service Datasource http://community.jaspersoft.com/project/web-service-data-source This Community project implement a Custom Datasource, built using the latest Custom Datasource framework (leveraging Data Adapters internally). It is also working inside JasperReports Server: You can use it to fill Query based Input Controls, as well as Ad Hoc Reporting (for Commercial version) using it through Topic. Thanks
  15. This is now possible using Web Service Datasource http://community.jaspersoft.com/project/web-service-data-source This Community project implement a Custom Datasource, built using the latest Custom Datasource framework (leveraging Data Adapters internally). It is also working inside JasperReports Server: You can use it to fill Query based Input Controls, as well as Ad Hoc Reporting (for Commercial version) using it through Topic. Thanks
  16. This is now possible using Web Service Datasource http://community.jaspersoft.com/project/web-service-data-source This Community project implement a Custom Datasource, built using the latest Custom Datasource framework (leveraging Data Adapters internally). It is also working inside JasperReports Server: You can use it to fill Query based Input Controls, as well as Ad Hoc Reporting (for Commercial version) using it through Topic. Thanks
  17. Overview Configure Tomcat: Enabling the JPDA Debugger in JVM Tomcat running with bat or shAdd these lines at the beginning of tomcat’s startup.bat if you want to use custom JPDA setting. For the default values these are not needed rem Forcing tomcat to start with PDA enabled to debug with eclipseset JPDA_ADDRESS=8000set JPDA_TRANSPORT=dt_socket[/code]And at the end of the script replace call "%EXECUTABLE%" start %CMD_LINE_ARGS%[/code]With call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%[/code]REMEMBER: Restart tomcat! Tomcat Running as a serviceChange name of the tomcat7w.exe using the name of the service. In my environment the service is called jasperreportsTomcatnum1 So in the folder C:Jaspersoftjasperreports-server-cp-6.0.1apache-tomcatbin Rename tomcat7w.exe to jasperreportsTomcatnum1w.exe (This should be already named correctly from version 6.1 ) after that run the exe, go to the java tab and add in the java options -Xdebug-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n[/code] Configure EclipseConfigure Remote debugClick on the Menu Run > Debub Configurations... Configure a new Remote Java Application (see picture below) Create the JRS project Create a project with the jrs source. Go on File > New.. > Java Project Select the project name and jdk to be used and click finishNow let’s find the sources to copy here. As example if you want to debug the class AdhocCrosstabAjaxController follow this stepsDo a search in the src folder of jrs downloaded from the support portalYou’ll find the class in these paths:jasperreports-server-5.5.0-srcjasperreports-server-5.5.0-srcjasperserver-progyroscopesrcmainjavacomjaspersoftjiadhocactionjasperreports-server-5.5.0-srcjasperreports-server-5.5.0-srcjasperserver-progyroscopesrctestjavacomjaspersoftjiadhocactionIn this case the class is available in the test and main branch, let’s take the main oneGo at the root of the java structure for the class so:jasperreports-server-5.5.0-srcjasperreports-server-5.5.0-srcjasperserver-progyroscopesrcmainjavaCopy the folder com , that contains all the java structure of packages insideGo back in Eclipse with the folder in the clipboard, right click on the src folder of your JRS project and click paste Configure the Buildpath: right click on the project > Build Path > Configure Build Path... In the Libraries tab add all the jars fromapache-tomcat/webapps/jasperserver-pro/WEB-INF/libapache-tomcat /lib Now the project should be buildable. If you find errors in some classes don’t worry to much. It will probably work anyway Debug JRSNow that everything is setted up let’s start debugging Add a breakpoint in the class you are interested inGo in your browser and log in jrs as usual. Eclipse will intercept and stop the execution as soon as you reach the breakpoint selected.Click on the eclipse icon and start debuggingReferencehttp://wiki.apache.org/tomcat/FAQ/Developing#Q1
  18. In this wiki page we'll explain 2 different approaches to customize JasperReports Server. Plug in your customized logic: create your own classes , pack them in a jar and add it to JasperReports Server. Then configure the xml applicationContext files to use your customized logic. This is the best approach, but in some case this is not possible (we'll see when)Building a patch using Maven: Customize existent class(es) and rebuild JasperReports server patched jar(s)Plug in your customized logicSearch xml files for the class configurationJasperReports Server leverages the Spring MVC framework to give you all the flexibility to change the implementation of key feature... As example if you want to change the behavior of any class the first check you have to perform is: search the class name in all the .xml files in jasperserver app. If you are using Tomcat the folder should be: [TOMCAT_ROOT]/webapps/jasperserver/WEB-INF I personally use Notepad++ in Windows to perform this kind of search: Search -> Find in files...Find what: then add the class you whish to customizeFilters: *.xmlDirectory: [TOMCAT_ROOT]/webapps/jasperserver/WEB-INFand click Find AllLet's say we want to customize the FTPUtil class. We search for it Here the results, we found the configuration! If you get hits of this in the applicationContext*.xml then you are in good shape. You can just create your own class and configure it in the xml. Remember to add your new jar (with the class inside) in the lib folder of JasperReports Server If you don't find a proper result here have a look at Building a Patch Using Maven of this wiki article. Create your Customized classIf you want just to customize part of the logic a Best Practice is to extend the original jaspersoft class so you can know for sure what is the logic you added (as well it will be easier to update in later versions). After you created your class you can build it and export it as jar. Use your favourite IDE, as example Eclipse or IntelliJ. Just configure a new project and add in the build path the required jars from JasperReports Server. In a hurry? just add all jars from these locations: [TOMCAT_ROOT]/webapps/jasperserver/WEB-INF/lib[TOMCAT_ROOT]/libNow you can replace the name in the applicationContext*.xml with your class qualified name com.jaspersoft.my.customization.MyClass Add your jar to this folder [TOMCAT_ROOT]/webapps/jasperserver/WEB-INF/librestart tomcat and test it out. Building a Patch Using MavenBut what if the class you want to customize is not defined in an xml file but just referenced from the source code itself? Then the process is a bit trickier but no worries: we'll get there together. A sample of this usecase is if you want to customize one of our web services. The Job Webservice as example. Let's say we want to modify the way we produce email notification. Browsing the source we realize the class we whish to customize is ReportJobMailNotification , so let's search for it in xml... The only result regard something with a similar name, but not our class. PersistentReportJobMailNotification.hbm.xml We can say that this class is not defined in any xml file then. What to do now? We'll have to patch the existent class, and create a patched version of the jar that contains it. Then replace the original jar with our patched version. Easy right? We'll do this using Maven. If you are not confident with Maven , google "learn maven" and become a guru first! Just kidding, I am no expert neither, I can't thank our Build team enough for their guidance and help. So if you don't feel confident with Maven, this is totally fine for now. Pre-requisitesMaven installed (version 3.0.4 minimum). You can check your version with command mvn -versionAccess to JasperReports Server ArtifactoryFor Pro version only: access to Support Portal with your company credential, download the Maven Repository from Downloads > JasperReports Server > SourceEasy sampleFind the jar containing the class you want to patchBrowse our Artifactory website. Go to the section Archive Search Here you can search for a class and it will tell you in which repo/jar it is (super handy!). This process applies also if you need to change classes inside multiple jars, but your customized classes are not dependent one from the other. I'll cover this use case later. So let's say we want to patch this class: ReportJobMailNotification Search it: It's included in this jar: jasperserver-api-engine-x.x.x.jar (replace x with version you are going to patch). So what we want is to create a patched version of this jar, to replace it in JasperReports Server lib folder. Let's do it! Create a maven patch projectWe'll use maven for this so let's create a simple maven project (find it attached) Unzip it where you prefer. Let's have a look at the structure: src: here the source file with your modification. Only the ones that you are modifyingtarget: empty - it will be filled by the building process by mavenpom.xml : this file contain all the configuration - here we define what we want to patch and how. The pom.xmlThe most important properties to understand are: groupId, artifactId, version : we can find these info in artifactory website, just click in the "Show in Tree" button that appears when you hover on the Artifact Path (for the version you're interested in, e.g. 6.0.1): Then you should see this: Notice that we have groupId, artifactId and version in 2 place at the beginning: as property of the main project and inside the dependencies. Just the version is different! This is telling maven that we are using the original jar as dependency, and our own should be tagged with the version 6.0.1-MySample repositories: these repos will be used by maven to resolve dependencies defined in our project. Dependencies are defined by our maven project, and in cascading order from the project we are using as dependency (jasperserver-api-engine) ... and so on. Just use the repos I defined in the samples, this should be enough in most of usecasesartifactItem: If you scroll to the end of pom.xml you'll find the other important piece of configuration. Here we define which files we want to filter from the original jar. So basically we have to define the classes we are going to customize :) That's it! Now we can.. Build the project using mavenSo first of all make sure you have it installed. Open a command line (cmd in windows) and type: mvn -version[/code]If this command works we can proceed to the next step. Go to the directory where you extracted the repository and type: cd [YOUR_PATH]sample1_jasperserver-api-enginemvn package --batch-mode > output-log.txt[/code]When the process finishes, open the target folder. You should see the jar patched with your versionName at the end (MySample) and ready to be copied in [TOMCAT_ROOT]/webapps/jasperserver/WEB-INF/lib . Remember to remove the original one! Advanced SampleIn this sample we cover how to build 2 projects patching JasperReports Server jars, when the projects have cross referecenses We'll use the Easy sample as starting point so if you didn't completed that please do so first :) Earlier we customized the class ReportJobMailNotification. Now let's say we want to change the class PersistentReportJobMailNotification . If our change is independent from the change we made in the class ReportJobMailNotification we can use the same approach as earlier. Otherwise we'll need something more complex because we'll have to reference our customized jar instead of the original one (in the jaspersoft repositories). Download the complex sample to check the new configuration The pom.xml – what changesThe pom.xml of jasperserver-api-engine-impl contain a little difference compared to the jasperserver-api-engine project. the definition of the dependency on the original jar contains an exclusion for the jar we customized. Dependency on jasperserver-api-engine-impl , exclude jasperserver-api-engine-impl . If you are wondering why the dependency on jasperserver-api-engine-impl should bring in the jasperserver-api-engine project the answer is: maven. The cool thing about Maven is that it will resolve all the dependency in cascade.Now that we excluded the original jasperserver-api-engine jar we have to add an additional dependency on the customized jar (we'll find it in the target folder of the jasperserver-api-engine project after the build). Multiple Projects BuildIn the last sample we created a new project. Having 2 projects introduced some questionable configurations: All the pom.xml contain the same list of dependencies. What if we have a lot of projects and we decide to add another repository? Would be great to have this list centralizedHaving 2 project with this structure means we have to build the projects separately, with 2 commands, even in a certain order as they have dependencies one on the other.The version is specified in all the pom.xml, but in our case they all refer to the same project, and version.Luckily there is another approach that can solve all these limitations. Let's centralize some stuff in a new root project! (download the 3rd sample from this wiki attachment). Now the structure of folders look a bit different. There is a generic pom.xml in the root folder. Let's have a look at it The pom.xmlThis centralized pom.xml contains: an artifact id for the central projectthe version for the project (removed from internal project's pom.xml)the list of modules (projects)the maven-compiler-plugin (removed from internal project's pom.xml)the list of repositories (removed from internal project's pom.xml) Build the project using mavenThe build of a single project is easier. You just need to run one command in the root folder (where the main pom.xml is - in this tutorial we call it Sample3 folder for sample sake) browse the directory where you extracted the repositories cd [YOUR_PATH]Sample3mvn install -B > output-log.txt [/code]When the process finish open the target folder of the different projects, you should see the jar patched, with your versionName at the end (MySample) and ready to be copied to [TOMCAT_ROOT]/webapps/jasperserver/WEB-INF/lib. Remember to remove the original one! Reapeat this action for all the projects JasperReports Server PRO patched jar BuildThe last sample is about building the source code of the Professional version of JasperReports Server. In order to do that you need a Professional license and access to the Support Portal. Other than that the process is very similar. We added an additional project in the sample , patching the jasperserver-api-externalAuth project Download the Maven Repository for Professional versionLogin to the Support Portal with your credential. If you have troubles ask your sales representative.Go In downloads Section , then Jasper Reports Server Jump to Source section Download the JasperReports Server Maven Repository Unzip it somewhere in your local drive. We'll reference to this path as [LOCAL_JRS_REPO] from now on.In the centralized pom there is a new repository, the only difference with the previous ones is that is defined with a local path: <!-- local --><repository> <id>localrepository</id> <url>file://C:/Jaspersoft/Source/jasperreports-server-6.0.1-repo/repository</url></repository>[/code]Additional InfoBatch Mode and output.txtIn all the command describe in this page you find a property --batch-mode or -B . Both stands for Batch Mode. Batch mode is useful when you want to export the result of the maven build to a file. It produce a less noisy logging, easier to read. The command >output.txt will redirect the output to a file. This is not mandatorory and you can remove this. If you remove the outputFile you can also remove the batch mode described in the above bullet. Without the batchMode and output file definition the previous commands will look like: mvn installmvn package[/code]
  19. Jaspersoft-ETL-PluginA set of components for TIBCO Jaspersoft ETL, shipped as plugin for your convenience. Easily interact with your JasperReports Server instance leveraging the flexibility of TIBCO Jaspersoft Web Services. Download: Click Here to Download the Plugin Project Home Page: http://community.jaspersoft.com/project/jaspersoft-etl-plugin Author(s): Pierre Lambert, Gianluca Natali Thanks to: jrs-rest-client (https://github.com/Jaspersoft/jrs-rest-java-client/) Current Version: 0.95 RequirementsJasperReports Server v5.6, v6.0Jaspersoft ETL 5.4+InstallationInstall the Plugin (Watch the Video)Extract the content of the plugin zip attached to this page in a folder. We'll refer to this folder as [JETL_PLUGIN_SRC] Find the installation folder for Jaspersoft ETL in your disk. This path will be referred as [JETL_ROOT] from now on copy the entire folder "[JETL_PLUGIN_SRC]/src/com.jaspersof.ps.talend.components_5.4.1.r111944" in [JETL_ROOT]/plugins . open with a text editor the file [JETL_ROOT]/configuration/config.ini and check the presence of org.eclipse.update.reconcile=true osgi.clean=true Make sure these parameters are not present twice! These are needed just the first time. Start Jaspersoft ETL Remember: After the first start of Jaspersoft ETL, if the plugin was correctly installed and Jaspersoft folder is available from palette switch these values to false! Import the sample job for TIBCO Jaspersoft ETL (Watch the Video)Import the file "samples/exportJobETL.zip" It should have just one job inside Open the imported job and check the various components to change the desidered configurations according to your environment. Parameters as start month, end month and topN are available in the job context. You can also use a component to prompt these parameter to the user in Jaspersoft ETL Studio Enjoy ReferenceWhy Use a Plugin ?Our components leverage a lot of jars. Without the plugin approach all the jars would have to be duplicated. Check this page for more info about the plugin approach: Create a Talend Plugin
  20. Jaspersoft ETL is a branded version of the Talend ETL product. ETL is a common requirement for BI projects. That is why we offer a branded version of Talend ETL with our product offering, giving our users this feature without requiring them to obtain 2 different licenses from 2 vendors. Now, Added Value for Jaspersoft ETLJaspersoft is a great product, specifically oriented to front-end consumer users. This means that for some activities such as scheduling, for example, we give very basic support. Jaspersoft ETL could fill this gap providing a set of components to interact with your JasperReports Server instance. This is the idea behind this project. Curious? Test it out!Check this page for detailed info to get you started: Get the Jaspersoft ETL Plugin Jaspersoft ETL Plugin Is an easy way to ship a set of components in Jaspersoft ETL giving you a GUI interface to interact with JasperReports Server WebServices for all kind of back-end requirements. Interact with JasperReports Server directly in your job easilyJust drag and drop the component you are interested in and put the jrs url, username and password. And it simply works!Behind the scenes a REST call is made, leveraging our great Java Rest Client. ETL ComponentsTalend ETL, similar to studio, uses a set of components in a PaletteThere is a large variety of Components for different purposesTo build a component, it is not needed to build java code (javajet)There is an XML to configure the behavior of the component and the configuration you will have access to, etc..You can create a new component and add it on the TalendForge CommuityTalend PluginTalend is Eclipse based and uses plugins to extend its capabilities. This means we can build a plugin to contain all our component to ship them easily. Benefits of building a plugin for TalendKeep all your components togetherEasier to share and deliverSelf-containedEasier to centralize common resources (jar,images,..)Advanced customizations (javajet)See this page for more details: Create a Talend Plugin Use casesCreate Organization StructureCreate the Organization and users and roles driven by anything (a query, an XML …)Very useful for SoftwareAsAService applicationManage User roles and attributes without customizing JasperReports Server securityHandle Import – Export with an ETL jobExport your JasperReports Server repositoryfor back up purposefor SAAS customers (usually using Multi-Tenancy feature) to clone an organization template, including canned reports, anytime they have a new customerThis is not easy in JasperReports Server and requires the user to manually modify the export zip content in order to change the organization nameStoring the export somewhere on an FTP server, or in the cloud (Amazon S3 as example. Talend has a specific component for that, ready to be used)Run automatically every nightSending an email at the end of processHave a question? You can post a question to our Question and Answer Forum.
  21. ThemesThemes are used inside JasperReports to customize the layout of the web application. Themes are powered by CSS so you can customize the layout just leveraging your knowledge in CSS. You can find more details watching this video: http://youtu.be/1HPdgtw2_1U?list=PL5NudtWaQ9l7lRpVT0he0gj3mPJ83xM4r Best PracticesOnly override what you want to change, this will make your upgrade to newer version much easierYou can use themes to hide objects for theming purpose. So you don't need to modify jsp- is not a security feature , the link are still there in the htmlUse specific class rules in css to customize the layout in embedded scenario ( use .noDecoration class to apply a css rule only when running with &decorate=no. See embeded theme for a sample)SamplesHigh Performance Carlogin page modified, bigger header for menu, new colors Login Page Repository White & Blue ThemeLogin Page Repository Page hpc_theme_v220141222.zip whiteblue_theme_60_20141222.zip embedded_theme_60_20141229.zip
×
×
  • Create New...