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

Scott Andersen

Jaspersoft Staff
  • Posts

    129
  • 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 Scott Andersen

  1. Have you checked the connectivity between the windows machine and the data source?
  2. Here is a link to the samples around styling text. This should help answer your question. http://jasperreports.sourceforge.net/sample.reference/markup/index.html#markup
  3. Here is a recently published WIKI on version control in JasperReports Server. It may help. https://community.jaspersoft.com/wiki/version-control-jasperreports-server
  4. Here is a recently published WIKI on this: https://community.jaspersoft.com/wiki/version-control-jasperreports-server
  5. Here is a recently published WIKI on this: https://community.jaspersoft.com/wiki/version-control-jasperreports-server
  6. Here is a recently published WIKI on this: https://community.jaspersoft.com/wiki/version-control-jasperreports-server
  7. One aspect of implementation of JasperReports® Server that needs to be considered is that of version control. This Wiki article reviews possible approaches to accomplishing this. Requirements There are several ways to produce Jaspersoft content. Jaspersoft Studio is the primary tool to create pixel perfect, complex reports. Artifacts can also be created using JasperReports Server itself. Inside JasperReports Server there are multiple resources that may need to be versioned. Pixel perfect reports. These can be jrxml files or JasperReports Server report packages. Ad hoc reports Data sources Domains Topics Other resources Input controls Queries Images Report developers create, modify, test and deploy to JasperReports Server from Jaspersoft Studio via JasperReports Server REST services. The JasperReports Server REST API can be used to update: Repository contents: report units, data sources domains Users Roles Permissions Audit etc The JasperReports/Studio and JasperReports Server changes within the JasperReports Server repository are to be version controlled. Reports and other artifacts need to deployed into different JasperReports Server environments: Development to test to production A hotfix in production needs to pushed back into other versions and environments The deployment process to JasperReports Server environments is to be automated and leverage version control. There are environment specific settings within the repository and in the JasperReports Server that need to be updated during deployments. There are also processes like upgrades and hotfixes that change the JasperReports Server repository and server. Design Base idea for this approach is to have the JasperReports Server repository structure in a Git repo. Resources only should be maintained. Developer creates a branch for themselves Repeatedly Developer updates the JasperReports Server repository in their local environment. js-export changes to the branch Always export their full repository to the file system of the JasperReports Server repository Repeated exports of the same resources will show only files that have changed Use of universal encryption key Commit Get from Git into JasperReports Server repository Get branch js-import into JasperReports Server repository Everything from Branch Selectively Create a working repository and import branch into it Create exports of individual objects Import the individual object exports into the target JasperReports Server repository Secured values need to be maintained separately for each JasperReports Server repository Exported separately from resources Loaded after import from version control Use server settings JasperReports Server Administrator Guide » User and Role Management » Managing Attributes JasperReports Server Administrator Guide » Data Sources » Attributes in Data Source Definitions/span> Or saved exports Need encryption keys specific to each JasperReports Server repository Pull requests and merges Dev -> Test -> Prod Hotfix back into development Can revert changes in Git, then re-import. Jaspersoft command line functions Export js-export --uris /public --output-dir /path/to/cloned/repo --keyalias deprecatedImportExportEncSecret Secured values change on every export. Import js-import --update --keyalias deprecatedImportExportEncSecret --input-dir "/path/to/cloned/repo" Import using the universal encryption key Update the secured values separately with environment specific values ie. passwords Processes Push the initial JasperReports Server repository to Git Have an existing JasperReports Server repository database available with the resources you want to save into Git. Set up a central Git repository for the JasperReports Server resources. Set a branch or leave as master. Clone the Git repository to a directory in the local environment. Say “/path/to/cloned/repo” Work at the command line in a JasperReports Server buildomatic directory. js-export --uris /public --output-dir /path/to/cloned/repo --keyalias deprecatedImportExportEncSecret Commit the updates to the central Git repository from /path/to/cloned/repo New repository database set up from Git Work at the command line in a JasperReports Server buildomatic directory. Update default_master.properties with the repository database connection details. A new encryption key and a new keystore are about to be created. Any previously created key and keystore will become invalid and the corresponding passwords unusable. If you think this JasperReports Server instance already has a keystore configured by another OS user, stop this process and configure the path in keystore.init.properties file, then run this command again. See the JasperReports Server Security Guide for details. Do you want to continue? (y/N) Y js-ant create-js-db js-ant init-js-db-pro js-ant import-minimal-pro Clone the central Git repo locally and set the branch. js-import --update --keyalias deprecatedImportExportEncSecret --input-dir "/path/to/cloned/repo" Ensure configuration to use an existing repository Before starting, ensure the keystores files relevant for the particular repository are available in the local environment. If you have to deploy from a fresh machine, follow this process to configure the keystore files for the existing repository: https://community.jaspersoft.com/wiki/encryption-jasperreports-server-75#Updating_Keystore_files Delete keystore.init.properties Update default_master.properties with the repository database connection details. js-ant clean-config js-ant gen-config Clone the central Git repo locally and set the branch. js-import --update --keyalias deprecatedImportExportEncSecret --input-dir "/path/to/cloned/repo" Developer/admin updates the repository and Git Edit/publish to the repository via JRS processes. js-export --uris /public --output-dir /path/to/cloned/repo --keyalias deprecatedImportExportEncSecret Always export the full repository! Commit the updates to the central Git repository from /path/to/cloned/repo Developer/admin gets updates from Git into a repository Get latest updates of the central Git repository or clone. Use branches. js-import --update --keyalias deprecatedImportExportEncSecret --input-dir "/path/to/cloned/repo" Saving Server level Attributes With attributes set, they can be exported to a zip file and then imported into target JasperReports Server environments. As the superuser, go to Server Settings > Export. Note the attributes and server settings check boxes below. These export zip files can only be imported into environments that have the same keystore as the original environment. Saving Organization level Attributes Superuser selects Manage Organizations > select an Organization Right click > Export A tenant administrator can do export for their organization. Maintaining Environment specific resources There are resources in the repository that contain values specific to an environment. The best method to preserve these values is to use the server, organization and user attributes which are maintained separately from the repository resources. https://community.jaspersoft.com/documentation/tibco-jasperreports-server-administrator-guide/v750/attributes-data-source-definitions https://community.jaspersoft.com/wiki/built-parameters-logged-user There could also be environment specific resources which would be updated via the Git to repository import process. These will have to be exported separately and then imported after an update from Git has occurred. Dev/Test/Prod, Hot fixes Developers work in a branch. Use merges and pull requests to move resource versions between different branches. Deploy to different environments using branches. Repository changes related to a hotfix are committed to the production branch and then merged or pull requested into other branches. Conflicts Conflicts can happen. Given the nature of the repository resources, it will be difficult in many cases to selectively merge the contents of individual resources with Git and then have a working repository. Exports into Git must be of the same complete areas of the repository, because of dependencies and the fact that the export machinery will not do an export of an object or folder, say, into Git will not respect the greater repository structure and disable the ability to import from Git. If a subset of the repository is exported to Git, that commit will have to be reverted for subsequent imports from Git to work. Current examples of version control with Jaspersoft Jaspersoft Studio Jaspersoft Studio defines projects containing JRXMLs and other resources that can integrate automatically with version control through the file system. In recent versions of Jaspersoft Studio, Git integration is installed by default. When you create a project in Jaspersoft Studio you can pull it from a variety of version control providers (CVS, SVN, Git) Version control of exports Export artifacts from the repository into zip files. Version control the exports. Import the exports into target environments. Use of command line tools:js-export/import Or REST services Export Import Maintenance with REST services Use of JasperReports Server REST APIs resources organizations Coding and scripting. Targeted versioning Versioning raw resources and jrxml ...pulling it...building an export file from scratch and then importing it BASH scripts Use BASH scripts to pull stuff from GIT and push to Jaspersoft via REST to automate. Other Information Various clients have implemented version controls in a number of ways. Contact us for more details / references.
  8. Out of the box there is a function in the adhoc calculated field editor that allows you to get the current date. Unfortunately this is a Date object and not a Timestamp, so you can't get done to the time level. You can however create a custom field "Now" that returns a Timestamp. 1. Create the custom function in WEB-INFgroovygroovy_columnBaseGroovyColumn.groovy def Now() { def now = new Date(); def timestamp = now.toTimestamp(); return timestamp; } 2. Add the function definition to WEB-INFapplicationContext-el-operators.xml This defines the return data type, any input parameters, and how the function is executed. <!-- 'Now' function --> <bean parent="functionDef"> <property name="name" value="Now"/> <property name="javaType" value="java.sql.Timestamp"/> <property name="aliases"> <list> <value>now</value> </list> </property> <property name="properties"> <map> <!-- show in calc field dialog --> <entry key="inAvailableFunctions" value="true"/> <!-- always run in SQL --> <entry key="alwaysInSQL" value="true"/> </map> </property> <property name="inMemory" value="false"/> </bean> 3. Add a function description to the property bundle for adhoc in WEB-INFbundlesadhoc_messages.properties adh.calculated.fields.function.description.Now=Returns Timestamp representing the current time. This will show up in the description in the ad hoc calculated field editior. The function can now be used either in the Calucalted Field editor in the Domain Designer, or in the Ad hoc custom field editor. Related articles below cover the details mentioned above in greater detail. Adding custom fields to ad hoc Creating custom groovy functions
  9. Please for a live demo.Earlier, websites were restricted to access resources from the same origin (Origin is a combination of protocol, domain, and port) by what is called a same-origin policy or SOP. This policy existed to avoid cross-domain attacks such as Cross-Site Request Forgery (CSRF). CORS is a relaxation of the same-origin policy that allows a request from one domain to access a resource from another domain. More details on CORS can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS This article is for 7.8.0 or later versions. See CORS configuration for JRS 7.5.1 and earlier versions only for 7.5.1 or earlier versions (also has tests useful for all versions).Before v7.8, the TIBCO JasperReports® Server used easyXDM (3rd party library to bypass the same-origin policy) to be accessed from Visualize.js EasyXDM exposes an rpc instance that can be used to generate requests as in below:var cdm = new easyXDM.Rpc({ remote: "http://other.domain/cors/"}, { remote: { request: {} // request is exposed by /cors/ }});xhr.request({ url: "pathRelativeToRemote/getrest/", method: "POST", data: {foo:"bar"}}, function(response) { alert(response.status); alert(response.data);});[/code]Now, with CORS implementation, dependency of easyXDM has been removed which enables JasperReports® Server to be accessed from a different domain using Visualize with configuration. CORS is implemented using a filter whose bean declaration can be found in the "applicationContext-security-pro-web.xml " file. The properties allowedHeaders, allowedMethods, maxAge, allowCredentials are configured and do not need a change. The domainWhitelist property specifies a list of domains that are allowed to be accessed using Visualize. To configure the cross-domain whitelist: Login as system administrator (superuser). Select Manage > Server Settings then Server Attributes. The server attribute named domainWhitelist contains a regular expression that matches allowed domains. Set it as follows When your Visualize.js web app is on another domain, such as in this example, create a regular expression to match the protocol, domain name and port numbers. You can also match multiple subdomains or several port numbers as in this example: domainWhitelist = http://*.myexample.com:80d0[/code]The server translates this simplified expression into the proper regular expression ^http://.*.myexample.com:80d0$. If you want to avoid the translation, put ^ $ around your value. When your Visualize.js web app is on the same domain as your JasperReports Server set the value to <blank> (no value) so that no other domain has access: domainWhitelist = <blank>[/code]More details on the domainWhitelist can be found in the JasperReports Server Security Guide, section 4.2.1 Setting the Cross-Domain Whitelist. As CORS is based on a similar concept of allowing only certain domains to access a resource, the domains listed in domainWhitelist property shall be used by CORS for the allowed-origin property. TroubleshootingThe following articles help: Troubleshooting CORS issues in Visualize.js and CORS error in JasperReports Server 7.8.0 (and later).
  10. In the Text field you can set the "Markup" property to "Styled" or "html" and you can then enter multiple styles in the text field expression. Check out the "styledtext" sample in the "JasperReportsSample" project in Jaspersoft Studio.
  11. Create a data adapter in TIBCO Jaspersoft® Studio. Create a report using this data adapter. Test the report in the Jaspersoft® Studio to make sure it works. Export the data adapter from Jaspersoft® Studio. Deploy this data adapter into TIBCO JasperReports® Server repository as XML file. (Right click on the folder in JasperReports® Server, Select "Add Resource", "File". "XML File", "Choose File", In Jaspersoft® Studio, add the following property to the report template: <property name="net.sf.jasperreports.data.adapter" value="repo:{path to the data adapter done in step 5}"/> To get the "repo:... value, Go to the "Properties" of the XML file you added in JasperReports® Server. Review data source properties to determine the repository path to the data adapter: Use that information to set "repo:..." value. This property should replace the existing dataadapter property (com.jaspersoft.studio.data.defaultdataadapter). Test the modified report in the Studio to make sure it works. Publish the modified Jaspersoft® Studio report into JasperReports® Server repository without a data source. Test the report in JasperReports® Server. (Note, this is an update to WIKI article https://community.jaspersoft.com/wiki/how-deploy-and-use-data-adapter-jasperreports-server-v56, tested on Jaspersoft® Studio 7.5 and JasperReports® Server 7.5. )
  12. You can create a report with all the data coming in as a parameter in JSON format. HEre is how you do it. Put sample data with basic structure of the JSON data you are reporting on into a file. This facilitates the creation of and testing of sub reports / reports. (See attached example)Design the subreport(s) using the file as a data source. This makes creating the fields easier. It also helps you test the JSON query to get at the data you want to reach. You can create the fields directly but it is quite involved. Query the JSON to get the structure you want. Generate the fields. OR Create fields individually. Field name, description, Property – field expression;Design and compile your sub report(s)Create the master reportCreate a string parameter that passes the json data into the parameter. Set the initial value to the test JSON structure as a string. (jsonData)Create parameter “JSON_INPUT_STREAM”, class java.io.InputStream, uncheck “Is for prompting”, default value expression: new java.io.ByteArrayInputStream($P{jsonData}.getBytes("UTF8")) $P{jsonData} Is the json parameter you created above.Add the subreport.Edit Parameters. Add parameter “REPORT_DATA_SOURCE”, set expression to new net.sf.jasperreports.engine.data.JsonDataSource( new java.io.ByteArrayInputStream( $P{jsonData}.getBytes("UTF-8") ), ".")$P{jsonData} is the json parameter you created above.“.” Is the query path into the data used in the subreport. json_parameter_report.zip testdata1.json
  13. You might check out this related post: https://community.jaspersoft.com/wiki/exception-getting-dataset-cache
  14. To add drivers you need to be logged in as superuser.
  15. The JasperReports Server Ultimate Guide now shows how to do this: https://community.jaspersoft.com/documentation/tibco-jasperreports-server-ultimate-guide/v710/adding-custom-export-channels
  16. AWS Athena provides you with the means of accessing data from S3 buckets. The Simba Athena JDBC driver allows you to retrieve data through Athena. Exposing Athena External TablesAthena does queries against defined EXTERNAL_TABLEs. For TIBCO JasperReports® Server to be able to see these external tables in the domain designer you need to modify the applicationContext-semanticLayer.xml file to display External tables. Add a value for external tables to the "tableTypes" property in the applicationContext-semanticLayer.xml file, as shown below. <property name="tableTypes"> <list> <value>TABLE</value> <value>VIEW</value> <!--value>SYSTEM TABLE</value--> <!--value>GLOBAL TEMPORARY</value--> <!--value>LOCAL TEMPORARY</value--> <value>ALIAS</value> <value>SYNONYM</value> <value>EXTERNAL_TABLE</value> </list></property>[/code]After making the change, restart the server. Set Up the Simba Athena JDBC DatasourceDownload DriverThe Simba Athena JDBC driver can be downloaded here: https://s3.amazonaws.com/athena-downloads/drivers/JDBC/SimbaAthenaJDBC_2.0.6/AthenaJDBC42_2.0.6.jar Set Up DatasourceDriver name:com.simba.athena.jdbc.Driver Click on "Add Driver: to load the driver. URL: jdbc:awsathena://AwsRegion=[rRegion];S3OutputLocation=s3://[path to S3 bucket to hold query results]; Use Access Key/secret key for user and password. Click on "Test Connection" to test the connection. Save the data source ResultsWhen you create a domain on the datasource, the external_tables will be visible in the domain designer.
  17. You can control this byturning off interavctivity for the chart. See the documentation at https://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v62/setting-advanced-options-html5-charts
  18. You can control this byturning off interavctivity for the chart. See the documentation at https://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v62/setting-advanced-options-html5-charts
  19. You can control this byturning off interavctivity for the chart. See the documentation at https://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v62/setting-advanced-options-html5-charts
  20. You can change the default format of components by using element template sets. A template set is a specialized jrxml file that contains default settings for specific elements. Creating a template set.Editing a template set.Using a template set.Creating a template setThere are a couple of ways to create a template set. From scratch.Go to the “Settings” drop down, select “Elements Templates”, and “Create new Template Set”. This starts the template set wizard to create the template set. From an existing component.Right click on the component and select “Add to Template Set”. If a template set is currently selected the selected component is added to the template set. If no template set is currently selected, you are presented with the option to create a new template set. The template set wizard is displayed. To create a template set all you need is a location in your project to store is and a name Editing a template setThe template set is displayed in the designer just like a normal report design. In addition to adding elements to a template set from an existing component on a report as described above, you can add components directly to the template set, just as you would add a component to a report design. Using a template set.You can point your Studio environment to a template set by selecting “Settings” drop down, “Element Templates”, select the template set you wish to use, and select “Use Template Set”. (Indicated by the red circles in the image below.) To reset to the default element formats click on the “Settings” drop down, “Element Templates”, and “Don’t use a template set”. When a template set is active the element definitions defined in the template set will be used whenever you add a corresponding element to a report. For example, dragging a “Field” into your report will generate a “Text” element with the format of the last text element in your active template set.
  21. FYI - here are links to the samples folder referenced above: http://jasperreports.sourceforge.net/sample.reference/jfreechart/index.html http://jasperreports.sourceforge.net/sample.reference/jcharts/index.html
  22. To add a new driver you need to click on "Other", start to enter the driver name in the driver name field and the "Add Driver " button is enabl;ed. You can then add the driver This adds a new entry in in the list of JDBC drivers.
  23. In order to connect the attributes to the report you need to define a parameter at the report level "Attribute_RetailerID". That parameter should "Is For Prompting" unchecked.
  24. You should be able to use visualize.js to embed the dashb oard directly in your page, without using the JasperReports Server user interface. Here is a sample of embedding a dashboard using visualize.js: https://community.jaspersoft.com/sites/default/files/wiki_attachments/main_2.html#dashboard-samples
×
×
  • Create New...