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

nbochenko

Members
  • Posts

    25
  • 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 nbochenko

  1. As far as I know, CDH 4.5 is supported, pre-4.x versions are no longer supported by CDH either.
  2. Hi, A simplified version of these steps would be: 1. Install JRS from scratch to new DB. No need to edit context.xml if you point it to another DB at the beginning. 2. Export repo with import-export tools. 3. Import this repo to the new repo. Note that the versions should be the same, or you have to follow the upgrade procedure. If you had a working instance of JRS before importing the old repository, you should be able to login with jasperadmin/jasperadmin and superuser/superuser (default access credentials). Regards, Nikita
  3. What Java version are you running? Is this Oracle Java 1.7? You could try re-deploying Oracle JDBC driver via JBoss (console or via control files) and if that deployed successfully, re-deploy JRS.
  4. Issue:In some use cases default aggregation function in domain designer is set to "None". In some rare cases, if you need to edit many fields, you may want to change the default aggregation function selected in UI: [toc] Resolution:In order to change it, find file /domain.designer.display.js. Locate the lines: if (!item.isParent()) { metanode.extra['dataType'] = item.param.extra.JavaType, metanode.extra['defaultAgg'] = 'none', metanode.extra['defaultMask'] = 'none' } Change metanode.extra['defaultAgg'], for example, to this: metanode.extra['defaultAgg'] = 'Average', You will need to refresh your page. Note that this is only a UI setting, and won't change your domain. It is relevant only when selecting Measures.
  5. GoalsUsing REST to design a simple continuous integration with SVN, Python 2.7 and JasperReports Server gives some obvious benefits: Versioning of reports with easy roll-back procedureContinuous integrationManagement of development and production environmentsDisclaimerSample code is not production ready. It has numerous issues and should be used only as a starting point or as demonstration means. DocumentationJasperReports Server Web Services Guide - see Docs.Python 2.7 official documentation.Requests library for PythonApache Subversion (SVN) documentation pysvn documentationShort DescriptionThere are various hooks available in Subversion. We are mostly interested in post-commit hooks. Using knowledge of previous article about uploading reports (see uploading reports with python 2.7 and requests ), we can see that continuous integration in its simple form should be easy: Commit to SVNOn the server side, run post-commit hookPost-commit hook calls update on local version of SVN repo via pysvnExecutes PUT request on new reportsIf reports have been updated, we need to run POST request to update themDetailsUsing pysvn to create or update working copy: #!/usr/bin/env pythonimport pysvnimport loggingimport argparse#see attachment and comments for detailsfrom report_upload import report_uploaddef svn_checkout(svn_url, svn_path): """ Used to checkout or update local copy svn_url - repo url, could be svn://, file://, http:// svn_path - local path of the working copy, i.e. /home/user/jasper_repo/ """ client = pysvn.Client() if not os.path.exists(svn_path): client.checkout(svn_url, svn_path) else: try: client.update(svn_path) except Exception as e: print e raise def report_log(rev, svn_path): """ Using revision and local working copy to generate changed files rev is revision number in, for ex., 3 svn_path local path of the working copy, i.e. /home/user/jasper_repo/ """ revision = pysvn.Revision(pysvn.opt_revision_kind.number, rev) client = pysvn.Client() # getting svn log for revision number with changed paths log = client.log(svn_path, discover_changed_paths=True, revision_end=revision) # getting list of files for HEAD head_files = client.list(svn_path, recurse=True) files = [] for i in head_files: # using pysvn.node_kind.file to separate actual files if i[0].kind == pysvn.node_kind.file: files.append(unicode(i[0].repos_path[1:])) diff_paths = [] # separating changed paths in log to a list for i in log: paths = i['changed_paths'] for j in paths: if j['action'] in ['A', 'M']: diff_paths.append(unicode(j['path'])) # returning only intersection with file list and changed files list diff_files = set(diff_paths).intersection(files) return list(diff_files)if __name__ == '__main__': # logging in a very simple form logging.basicConfig(filename='error.log', level=logging.WARNING, format='%(asctime)s %(message)s') # initializing argparse. It is useful if we need to run the hook manually parser = argparse.ArgumentParser(description="SVN uploader on post-commit") parser.add_argument("-R","--rev", help="Revision", required=True) parser.add_argument("-f","--svn_url", help="SVN url", required=True) parser.add_argument("-p","--svn_path", help="local path to init") args = parser.parse_args() # checking out or updating local svn repository try: svn_checkout(args.svn_url, args.svn_path) except Exception as e: logging.error('Exception in svn_checkout(): %s' % e) # getting file list for report upload diff_files = report_log(args.rev, args.svn_path) for i in diff_files: report_upload(repo_path=i, report_jrxml=args.svn_path + str(i), report_datasource="/datasources/repositoryDS", jasper_url='http://localhost:8080/jasperserver-pro', user='jasperadmin', password='jasperadmin') # done![/code]You can use report_upload from uploading reports with python 2.7 and requests. The most notable changes are: jrxml file is loaded in a variableif PUT does not work we attempt POST. A correct way would be to test path for existence and select a correct method depending on the request.Add a post-commit hook to svn hooks. For example: svn_upload.py -R $2 -f file:///opt/svn-repo -p /opt/upload/jasper-working-copy See subversion documentation and sample hook scripts (hooks/post-commit.tmpl) for details. On windows you will have to use cmd or bat scripts. For example: set TXT=%1set REV=%2echo "updating %TXT%" >> commit.logD:sourcejaspertrunkrestsupdate_svn.py -R %REV% -f file:///D:/source/test_repo -p d:/source/svn_test>>commit.log Sample codeSee attached zip archive for sample code. Current issuesNo production optimizationDoes not handle PUT and POST differences correctly - jsut attempts one after another/DDoes not handle locks. It should be locking files if development is done by more than one person to avoid conflicts.No actual error handling. If your postcommit failed - it has failed, and you will never know it.No deleting of deleted files.Works only with one datasource. No attachments or Input Controls.Directories are also not created- you will have to follow existing repo path in your SVN repository or force other paths.Logging should be more elaborate.
  6. GoalsSystem Administrators or developers may have a need to download arbitrary report contents via REST to JasperReports Server. Using a simple script to do that rather than import/export, iReport or JSS can be useful in number of situations: Embedding report download and viewing in other applicationsDevelopment process - download report content without tying up to repository structure. Could be useful to initilize a new repository with new structure.System Administration process - when using an export is not feasibleBulk download via command-lineVarious test utilitiesThis article is related to uploading reports with python 2.7 and requests DocumentationJasperReports Server Web Services Guide - see Docs.Python 2.7 official documentation.Requests library for PythonShort descriptionWeb Services Guide, 2.2.1 and 2.2.2 Requesting the Contents of a JasperReport and Requesting the Contents of a File Resource This is a bit more complex than uploading a report (see uploading reports with python 2.7 and requests ) GET http://<host>:<port>/jasperserver[-pro]/rest/resource/path/to/resource/We will get a valid ResourceDescriptor with all attachements listedNow we need to parse this ResourceDescriptor and download required attachementsNw we need to download each file, for example: GET /jasperserver/rest/resource/reports/samples/AllAccounts_files/AllAccounts_Res3?fileData=trueYou HAVE to use fileData=trueResourceDescriptor syntax is out of the scope of this article. I would suggest exisiting ResourceDescriptors. You can check them via iReport or REST GET to resources service. Example request#!/usr/bin/envimport requestsimport xml.etree.ElementTree as ET # Path to resource rest service:url = 'http://loclahost:8080/jasperserver-pro/rest/resource' # Report to process:report = '/somereport' # Authorisation credentials:auth = ('jasperadmin', 'jasperadmin') # file types to download:file_types = ['jrxml', 'img', 'jar' ] # Init session so we have no need to auth again and again:s = requests.Session() r = s.get(url=url+report, auth=auth) # init empty dictionaryfiles = {} # creating tree from ResourceDescripotor we have in Responsetree = ET.fromstring(r.content) # searching tree. Could be more efficient with Xpath# You may also implement testing for reportUnit wsType for speedsup for i in tree.iter('resourceDescriptor'): if 'wsType' in i.attrib: # we do not need all wsTypes, checking against file_types set previously if i.attrib['wsType'] in file_types: #Storing uriString and wsType files[i.attrib['name']] = [i.attrib['uriString'], i.attrib['wsType']] # This could have been done while searching the tree.for filename in files: #each file has a bit different url file_url = url + files[filename][0] using session and parameters to get file content r = s.get(url=url, params=params) # Files in repository # can be stored without extension, so # writing to filename with extension of wsType. i.e: # jrxml, jar, img. This has implication of all images # having ".img" file extension, etc. # Note that file is opened in binary mode with open(filename + "." + files[filename][1], "wb") as f: # we can have binary data, so using r.content f.write(r.content) # Done![/code]Example implementation: command-line utility to download report filesSee report_download.zip. Required libraries (in most cases only requests needs to be installed): import requestsimport argparseimport xml.etree.ElementTree as ETimport loggingimport httplibimport osimport sys [/code]To see help, run report_download.py -h: usage: report_download.py [-h] -r REPO_PATH [-f FOLDER] [-l JASPER_URL] [-u USER] [-p PASSWORD]Upload jrxml file as a report to JasperReports serveroptional arguments: -h, --help show this help message and exit -r REPO_PATH, --repo_path REPO_PATH Report repository path (with report name) -f FOLDER, --folder FOLDER Folder to download report -l JASPER_URL, --jasper_url JASPER_URL JasperReports Server URL, default http://localhost:8080/jasperserver-pro -u USER, --user USER JasperReports Server user, default superuser -p PASSWORD, --password PASSWORD JasperReports Server password, default superuser[/code]Example usage: report_download.py -r /organizations/organization_1/reports/samples/Cascading_multi_select_report -l http://localhost/jasperserver-pro-51 -f cascading[/code]NotesIn this article I am assuming the PRO version of JasperReports Server is used. However, the same should work for CE version if you use correct uri, repo path and user.
  7. GoalsSystem Administrators or developers may have a need to upload arbitrary reports via REST to JasperReports Server. Using a simple script to do that rather than import/export, iReport or JSS can be useful in number of situations: Development process - new report version of the report uploaded via SVN or GIT hook. This keeps both reports versioned and deployed to the server.System Administration process - when using an export is not feasibleBulk upload via command-lineEmbedding report upload functionality in other applicationsVarious test utilitiesDocumentationJasperReports Server Web Services Guide - see Docs.Python 2.7 official documentation.Requests library for PythonShort descriptionWeb Services Guide, 2.2.4 Creating a Resource describes how to create a request. In a short form this should be: PUT http://<host>:<port>/jasperserver[-pro]/rest/resource/path/to/resource/form-data: valid ResourceDescriptorapplication/octet-stream for attached JRXML files.ResourceDescriptor syntax is out of the scope of this article. I would suggest exisiting ResourceDescriptors. You can check them via iReport or REST GET to resources service. A sample resourcedescriptor_0.xml is attached for reference. Example requestLooking through requests documentation this should look something like this: #!/usr/bin/pythonimport requests #open resource descriptor and jrxml file for readingtry: resource_descriptor = open('resource_descriptor.xml', 'rb') report_jrxml = open('test.jrxml', 'rb')except: raise #Path to resource rest service:url = 'http://loclahost:8080/jasperserver-pro/rest/resource' #Authorisation credentials:auth = ('jasperadmin', 'jasperadmin') #initialize data. Requests will handle encoding.data = {"ResourceDescriptor": resource_descriptor.read() } #initialize files with report_name and data tuple. Requests will handle encoding.#Note that "name" in the PUT request should equal report_files path,#i.e. for report in /repopathtoreport/report the path would be /repopathtoreport/report_filesfiles = {'/repopathtoreport/report_files': ('report_name', upload)} #making a put request straight from documentationr = requests.put(url=url, data=data, files=files, auth=auth) #to see request status code do#print r.status_code #will raise HTTP error if there is one:r.raise_for_status() #Done! Good practice would be to close files when they are not required - both can be quite big.[/code]Example implementation: command-line utility to upload reportsExample uses jinja2 to render valid ResourceDescriptor. Templates should be located in 'templates' directory (see res_descr.xml) See jasperrest_0.zipfor jasperrest.py. Libraries required: import requestsimport argparseimport loggingimport httplibimport jinja2import os[/code]To see help, run jasperrest.py -h : usage: jasperrest.py [-h] -r REPO_PATH -j REPORT_JRXML -d REPORT_DATASOURCE [-l JASPER_URL] [-u USER] [-p PASSWORD] [-t TEMPLATE]Upload jrxml file as a report to JasperReports serveroptional arguments: -h, --help show this help message and exit -r REPO_PATH, --repo_path REPO_PATH New report repository path (with report name) -j REPORT_JRXML, --report_jrxml REPORT_JRXML jrxml_file for upload -d REPORT_DATASOURCE, --report_datasource REPORT_DATASOURCE datasource repo path -l JASPER_URL, --jasper_url JASPER_URL JasperReports Server URL, default http://localhost:8080/jasperserver-pro -u USER, --user USER JasperReports Server user, default superuser -p PASSWORD, --password PASSWORD JasperReports Server password, default superuser -t TEMPLATE, --template TEMPLATE ResourceDescriptor template name in templates dir, default res_descr.xml Sample syntax: jasperrest -r /public/new07 -j test.jrxml -d /organizations/organization_1/datasources/repositoryDS -l http://localhost:8080/jasperserver-pro NotesIn this article I am assuming the PRO version of JasperReports Server is used. However, the same should work for CE version if you use correct uri, repo path and user.
  8. Case insensitive search for Oracle 10g/11gBy default Oracle DB performs case-sensitive search when doing like %char%. That causes filters created in AdHoc Designer to be also case-sensitive. Starting from db version 10g, you can use REGEXP_LIKE condition to enable case-sensitive search. You would need to: [toc]Open /WEB-INF/applicationContext-semanticLayer.xmlFind: <bean id="oracleSQLGenerator" parent="defaultSQLGenerator" scope="prototype" /> Edit entry "contains" to use regexp_like(source_char, pattern, match_param). See example belowSave this file and restart the server.Example<entry key="contains"> <value> def search = args[1].value; if (search == null) return sqlArgs[0] + " like '%' || " + sqlArgs[1] + " || '%'" if (! (search instanceof String)) { search = search.value } return " regexp_like(" + sqlArgs[0] + "," + "'" + search.replace("'","''") + "', 'i')" </value></entry> Note this line: return " regexp_like(" + sqlArgs[0] + "," + "'" + search.replace("'","''") + "', 'i')" Original line would use LIKE %...%: return sqlArgs[0] + " like '%" + search.replace("'","''") + "%'" Other DBsDepending on your DB, you may want to customise other related beans in applicationContext-semanticLayer.xml. MySQL by default performs case-insensitive search via collation table. PostgreSQL by default performs case-sensitive search, but can use regular expression in a similar to Oracle manner. See beans "postgreSQLGenerator" and "mysqlSQLGenerator" for details on MySQL or PostgreSQL. You can also find some other, less often used SQL variations defined there.
  9. IssueOccasionally the labels are too big for the Pie Chart and do not fit into the chart. Is there a way to control this behaviour? SolutionYou can use Fusion Charts properties for that. If you check Fusion docs you will find this property: <chart ...="" managelabeloverflow="1" ...>[/code]Essentially it will wrap the labels if there is enough space. You can apply this in a Pie Chart in this manner: <fc:chart type="Pie" xmlns:fc="http://jaspersoft.com/fusion" xsi:schemalocation="http://jaspersoft.com/fusion http://jaspersoft.com/schema/fusion.xsd"> <fc:chartproperty name="manageLabelOverflow"> <fc:propertyexpression> <!--[CDATA["1"]]--> </fc:propertyexpression> </fc:chartproperty> ...</fc:chart>[/code]BeforeAfterYou can find some other available properties in Fusion Charts documentation.
  10. Q: Legend settings for selected series should be hidden based on a parameter selection. How should we achieve that?[toc on_off::hide=1] A: You can use a series property contributor that sets the showInLegend for each series.The solution is rather convoluted because series contributors can only access bucket and measure values and cannot directly reference dataset values such as parameters. For that reason a dummy column level is required to make the values available for the chart. For example: <dataaxis axis="Columns"> <axislevel name="root"> <labelexpression>"root"</labelexpression> <axislevelbucket> <bucketexpression>""</bucketexpression> <bucketproperty name="showCategory1"> ($P{showSeries}.indexOf("All") != -1) || ($P{showSeries}.indexOf("Category1") != -1) </bucketproperty> <bucketproperty name="showCategory2"> ($P{showSeries}.indexOf("All") != -1) || ($P{showSeries}.indexOf("Category2") != -1) </bucketproperty> <bucketproperty name="showCategory3"> ($P{showSeries}.indexOf("All") != -1) || ($P{showSeries}.indexOf("Category3") != -1) </bucketproperty> </axislevelbucket> </axislevel></dataaxis>[/code]and <hc:series name="Category1"> <hc:contributor name="SeriesProperty"> <hc:contributorproperty name="showInLegend" value="root.showCategory1" valuetype="Bucket" /> </hc:contributor></hc:series><hc:series name="Category2"> <hc:contributor name="SeriesProperty"> <hc:contributorproperty name="showInLegend" value="root.showCategory2" valuetype="Bucket" /> </hc:contributor></hc:series><hc:series name="Category3"> <hc:contributor name="SeriesProperty"> <hc:contributorproperty name="showInLegend" value="root.showCategory3" valuetype="Bucket" /> </hc:contributor></hc:series>[/code]
  11. IssueIn some cases you may need to find out the version of a deployed JasperReports Server via shell or command line. SolutionYou can find your JasperReports Server verison in WEB-INF/Internal. Community Edition<js-install>/WEB-INF/internal/jasperserver.properties[/code]PRO edition<js-install>/WEB-INF/internal/jasperserver-pro.properties[/code]ExamplesOn Linux, if Apache Tomcat is installed in /opt/tomcat/, the path to these files would be: /apache-tomcat-7.0.29/webapps/jasperserver-pro-501/WEB-INF/internal[/code]On Windows, it can be something like this: C:Program FilesApache Software FoundationTomcat 6.0webappsjasperserver-proWEB-INFinternal[/code]
  12. IssueIf you use rest v2 to export a report, you will always recieve paginated export, even if exporter allows non-paginated export. Can a report export be non-paginated? SolutionUse parameter ignorePagination=true in your REST call, for example: http://127.0.0.1:8080/jasperserver-pro/rest_v2/reports/public/testReport.html?ignorePagination=true[/code]This also works for other formats that support non-paginated output: PDF, XLS, etc. for export of excel - XLS http://127.0.0.1:8080/jasperserver-pro/rest_v2/reports/public/testReport.XLS?ignorePagination=true[/code]for export of PDF format http://127.0.0.1:8080/jasperserver-pro/rest_v2/reports/public/testReport.PDF?ignorePagination=true[/code]
  13. You have to use anonsvn:anonsvn. See http://anonsvn:anonsvn@code.jaspersoft.com/svn/repos/jasperserver for example, or use "Browse Source Code" link
  14. You have to use anonsvn:anonsvn. See http://anonsvn:anonsvn@code.jaspersoft.com/svn/repos/jasperserver for example, or use "Browse Source Code" link
  15. How to print datasource name or URL in a report? For example, if you have Testing and Development datasource, it would be nice to have a way to distinguish them on runtime. If you are using JNDI datasource, add: $P{REPORT_CONNECTION} to your report. If you are using JDBC: $P{REPORT_CONNECTION}.getMetaData().getURL() Resulting string would be something like this: jdbc:mysql://localhost:3306/sugarcrm_451?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&autoReconnectForPools=true
  16. Question DescriptionHow do you change default ordering/sorting of crosstab? For example, if you have product_id and product_name and would like to order by product_id, not by product_name. SolutionsSort in report queryYou can pre-sort your data in your query. For example, use "ORDER BY product_id" clause. You would need to check "Data is pre-ordered" checkbox in table properties for this to work. Note that if you have a complex corsstab, you may need add all sorts of ORDER BY clauses to your query. Crosstab groupCreate two crosstab groups, the first using product_id as key and the second using product_name. The first group would have no/zero width header. Use "Order by..."The order by expression can be used to order crosstab groups based on measure totals, for example, $V{POSITIONS_QUANTITYMeasure}. You could use it to order the groups on product id by adding product id as a measure with calculation=Nothing/First See http://jasperreports.sourceforge.net/schema.reference.html#orderByExpression for more details Use a custom comparatorYou would need to create a custom Java Class that holds both the value you are ordering by and a value you are displaying.
  17. Issue: How do I change default +/- 10 years selection in calendar Drop-down for AdHoc designer? In calendar, The list of the available years is +/- 10 years in relation to the entered date in the filter. In some cases, we can't select a date for the year 2012(see screen shot). Would it be possible to increase the range to +/- 20 years? Solution Find scripts/adhoc/designer.filter.js Find class constructDateControl. For v4.7.1 you also need to do same canges in constructDateTimeControl Add yearRange, for example yearRange: "c-20:c+20", Note the comma For example: constructDateControl : function(input){ jQuery(input).find('input[type=text]').datepicker({ showOn:"button", buttonText:"", dateFormat:"yy-mm-dd", changeYear:true, changeMonth: true, showButtonPanel: true, yearRange: "c-20:c+20", onChangeMonthYear:function (year, month, inst) { var newDate = inst.input.datepicker("getDate"); if (newDate && !(newDate.getFullYear() === year && newDate.getMonth() === month - 1)) { newDate.setFullYear(year); newDate.setMonth(month - 1); inst.input.datepicker("setDate", newDate); adHocFilterModule.onChangeForDateInput(inst.input.parents(".filter").attr("id")); } }, beforeShow:jQuery.datepicker.movePickerRelativelyToTriggerIcon}).next().addClass('button').addClass('picker'); }, [/code]
  18. To add / modify the data display forms in ad hoc viewIssue Description:How to add/modify the available data display forms in ad hoc view? ex : '1 235 €'[/code]Resolution:You can easily modify this pattern via {jrs}WEB-INF/bundles/adhoc_masks.properties (global properties). For localized changes you should edit appropriate files, for example, adhoc_masks_fr.properties for French locale. For example, to set it to something like €1,235 you need to edit patterns this way: {jrs}ADH_100_MASK_int_2 = u20AC#,##0;(u20AC#,##0) {jrs}ADH_100_MASK_int_3 = #,##0;(#,##0) {jrs}ADH_100_MASK_dec_0 = #,##0.00 {jrs}ADH_100_MASK_dec_1 = 0 {jrs}ADH_100_MASK_dec_2 = u20AC#,##0.00;(u20AC#,##0.00) {jrs}ADH_100_MASK_dec_3 = u20AC#,##0;(u20AC#,##0) Where u20AC is the Unicode sign for € symbol. Ref. Case #00029374
  19. ProblemQ: In some cases you need to select top ten (five, 20, 25) records for a chart from a very large dataset, and adding a second dataset with a LIMIT 10 condition is not an option. SolutionA: You can use report variables and filter expressions to filter data for chart. You would need your query ordered by some condition, for example (sample foodmart db): SELECT SUM(customer_sales."store_sales") AS customer_sales_store_sales, customer_sales."customer_fullname" AS customer_sales_customer_fullname FROM "public"."customer_sales" customer_sales GROUP BY customer_sales."customer_fullname" ORDER BY customer_sales_store_sales DESC, customer_sales."customer_fullname" Add a Chart (this works for both Charts and Charts Pro) with the same dataset as your report. Edit Chart Data -> Dataset -> Filter Expression for Charts and Chart Properties -> Chart Data -> Filter Expression for Charts Pro. Add a filter expression, for example:($V{REPORT_COUNT} > new Integer(10)) ? false : true
  20. QuestionDoes JaperReports support PDF/A compliant export? Answer:Starting from JasperReports Library 4.1.2.3 we support PDF/A compliant export ( PDF/A-1a and PDF/A-1b variants only). This means that JasperReports Server 4.2.1, iReport 4.2 and all the subsequent releases support PDF/A export. You can check for more informaton on how to generate PDF/A1 compliant files in JasperReports library samples, /demo/samples/jasper. Details:In the jrxml, the images that contain transparent elements must be marked with a key (e.g. TransparentImage) like this: <img scaleimage="Clip" /><reportelement height="40" key="TransparentImage" uuid="f61e2b11-b485-4ca0-bb45-d9e7eb58d323" width="165" x="0" y="5"> <imageexpression> <!--[CDATA["jasperreports.png"]]--> </imageexpression> <hyperlinktooltipexpression> <!--[CDATA["The JasperReports Logo"]]--> </hyperlinktooltipexpression></reportelement>[/code]These images will be removed from export, with a config property, because they're not supported by this standard. Finally, the config properties. Set them in the jrxml: exclude transparent images; either leave the value blank or set it with the key: <property name="net.sf.jasperreports.export.pdf.exclude.key.TransparentImage" value="" />[/code]include structure tags for PDF/A-1a compliance; unnecessary for PDF/A-1b: <property name="net.sf.jasperreports.export.pdf.tagged" value="true" />[/code]set pdfa conformance - pdfa1a/pdfa1b/none: <property name="net.sf.jasperreports.export.pdfa.conformance" value="pdfa1a" />[/code]specify the path of the ICC profile: <property name="net.sf.jasperreports.export.pdfa.icc.profile.path" value="/home/user/AdobeRGB1998.icc" />[/code]V5.x UpdatePosted by The Dentist on March 24, 2014 - 7:14am After having spend a lot of time on this matter, we have found out how to get PDF/A-1a working with our application. There are some things to do that are not mentioned in the howto that I had linked in my question: You'll need to embed your fonts in your pdf. In Jaspersoft Studio, make sure that the fonts are listed in the corresponding menu of your projects properties (don't confuse with your reports properties). From that menu, you should be able to export the fonts as jar, which you should include in your build path to embed the fonts within your java application. I also set the net.sf.jasperreports.default.pdf.embedded property to true, although that may not be necessary.Make sure you have a default style. To do so, open the styles section of your report and select the style you'd like to make default or open your style template if you use one and select the font there. Then, under advanced set default to true. If you had no style in your report so far, add one by right-clicking on the styles entry and find your way through the menus. You'll be able to refer to an existing style template as well.Additional hint: when trying to set up a PDF/A-1a document for the first time, make sure you use an image format that does not know transpareny (like jpeg) and don't use "one empty record" as datasource, but set up some datasource yourself (seems like with "one empty record", Jaspersoft Studio will show a page on the preview, but won't eport to pdf anything). Maybe png without transparency will work, too (haven't tried yet), and the datasource is independant from pdf/a technically, these things may help limiting the sources of errors. As of now, I was able to get it to work with my client application only. I had no luck to export pdf/a-1a from Jaspersoft Studio so far.
  21. Number stored as Text in ExcelIn some cases you need to export numbers as a text to excel. For example, you may have some alphanumeric codes in your DB, like 10001A, 10001B, ... 100011. This results in Excel showing a warning "Number stored as Text" when editing these files: This is an Excel way of protecting users from possible errors. You can safely click "Ignore Error" if you know that these fields should remain as text ones. Disabling this check in ExcelIn some cases this warning can be very annoying. It can be disabled permanently here: File --> Options --> Formulas --> Error checking rules --> uncheck the 'Number formatted as text or preceded by an apostrophe' option --> OK, like this: You can restore this check any time you like, by following the same procedure.
  22. Joins ViewIn JasperReports Server v4.x Joins View in Domain Designer were changed to be more comfortable on mainstream screen resolution. Joins field was moved from bottom to the left, providing more simple interface. In some cases - like low screen resolution, old 4:3 aspect and long table names - it may be useful to revert to old design. PrerequisitesYou would need to create a new empty custom theme or use an existing custom theme. The process is very simple and is described in User Interface Customization Guide (Support Portal -> Documents -> Prioir Releases -> 4.0.x) Adding custom_overrides.cssYou would need to add to your custom css file these lines: domainDesigner_joins .primaryLeft > .primary { bottom:47%; right:0; margin-left:0; margin-right:0;}domainDesigner_joins .primaryLeft>.secondary { width:auto; left:0; top:50%;}domainDesigner_joins .secondary.column > .sizer { display:none; }[/code]Resulting Joins view
  23. Table Element filtering/sortingJasperReports Server 4.2.x/4.5.xStarting from JasperReports Server 4.2.x an interactive sorting-filtering feature for table element was introduced. Using this feature regenerates the table element with new sorting or filtering rules. In case of extremely large datasets using this feature may take quite a long time, and it can be disabled globally. DisablingTo disable this feature globally you need to create an empty file at given location and restart your JasperReports Server: WEB-INF/classes/net/sf/jasperreports/components/sort/resources/SortElementHtmlTemplate.vm You would also need to create directory structure for that. If you are running Linux, executing mkdir -p net/sf/jasperreports/components/sort/resources from WEB-INF/classes/ should work. You would also need to set file permissions according to your app server specifications. For example, in a typical case for jboss you would need to execute from /WEB-INF/classes/: chown -R jboss:jboss net chmod u+rw -R net
  24. Summary[toc on_off::hide=1] When exporting a report to xls (Excel) from JasperReports Server, resulting report contains no images. ReasonBy default XLS exporter is set to skip images when exporting from JasperReports Server Resolution Locate /WEB-INF/applicationContext.xml In file search for xlsExportParameters bean: <bean id="xlsExportParameters" class="com.jaspersoft.jasperserver.api.engine.jasperreports.common.XlsExportParametersBean"> ... <property name="ignoreGraphics" value="true"/> ... </bean> Change property ignoreGraphics value to false: <property name="ignoreGraphics" value="false"/>
×
×
  • Create New...