Jump to content

Friendly User

Members
  • Posts

    435
  • Joined

  • Last visited

  • Days Won

    2

 Content Type 

Forum

Downloads

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Events

Profiles

Everything posted by Friendly User

  1. Hypothetical scenario:We have an Ad Hoc View (Table type), and one column can contain HTML tags. Since those tags are not rendered as HTML (tags are visible), we would like to create a calculated field that would strip tags from that column's content. Solutions:It is possible to do that on domain level in calculated fields sections. for this we would have to write a function in applicationContext-semanticLayer.xml. In the defaultSQLGenerator bean add a new entry: <entry key="escapeHTML"> <value> return "regexp_replace(" + sqlArgs[0] + ", '\\&lt;.*?&gt;', '','g')" </value> </entry> After restarting the server this function will be available to be used in domain designer calculated fields section. You just do escapeHTML(fieldName). However, while this approach might work for databases that have the regexp_replace function, but for example for MySQL, it is not good. So here you have to add a new groovy function that can be later used in the ad hoc editor. In /WEB-INF/groovy/groovy_column/BaseGroovyColumn.groovy add the following function: def StripTags(String s) { if (s == null) { return null; } else { return s.replaceAll("\\<.*?>",""); } } and in /WEB-INF/applicationContext-el.xml add : <bean parent="functionDef"> <property name="name" value="StripTags"/> <property name="javaType" value="java.lang.String"/> <property name="argumentTypes"> <list> <value>#{ objectTypeMapper.checkType('String') }</value> </list> </property> </bean> NOTE - as of 6.3.0 you need to edit applicationContext-el-operators.xml instead of applicationContext-el.xml The result is that now you have StripTags function that can be used in ad hoc calculated fields. Something to note about this approach: Since there is no SQL implementation, the property "inMemory" should be true, but this is covered because the parent bean "functionDef" already has inMemory set to true.The argumentTypes list is set correctly for a single String argument. If you have different argument types, you can look in applicationContext-el.xml for examples. In more complex cases, you may need to implement custom logic in a subclass of OperatorDefinitionImpl.Explanation of the difference between sqlArgs and args arrays:sqlArgs contains strings, which are SQL versions of the arguments passed to the function.args contains DomEL expression objects for the arguments; if you know something about these objects, you can access some useful information. For example, a string constant like 'abc' in DomEL will get turned into a Literal object, and you can get the value by accessing the "value" property, as above.
  2. Symptoms:You consistently get the issue, when creating an ad hoc report from a view, where the user is lacking permissions for the temp folder. Resolution:To allow users to create ad hoc reports and views the user needs to have Read+Write+Delete permissions for the /temp/ folder. In some cases it might be useful to restrict access to the temp folder if the user is just executing the reports or is not a power user in the system. If you set up them later as such you need to make sure that their roles have enough permissions for the temp folder.
  3. Symptoms:When running any report on TIBCO JasperReports Server through the UI the following error is consistently thrown: [toc]java.lang.IllegalStateException: Exception occurred rendering view org.springframework.web.servlet.view.JstlView: name 'modules/viewReport/ViewReport'; URL [/WEB-INF/jsp/modules/viewReport/ViewReport.jsp][/code]Resolution:If this exact problem occurs on a consistent basis then most likely you are running JasperReports Server on Tomcat 7.0.65 or 8.0.28. This is a known issue for those versions. Solutions would be to downgrade the Tomcat version. For example 7.0.63 would work totally fine. If you get a similar error that is thrown for other pages then you might: Be running out of memory (check the logs for the OutOfMemory exception). Increasing the JVM heap size should resolve the problem Have a customization that renders the JSP non-compilable which would require a closer look at the nature of modifications Have incorrectly compiled JSP for some reason. Stopping the server and cleaning the tomcat work folder could help in this case.
  4. Hello, iReport uses Locale.getDefault() to set value for REPORT_LOCALE. It usually defaults to OS locale. If you don't want to use default locale you would indeed need to set the REPORT_LOCALE parameter programmatically. Internationalization options become available once you associate the locale bundle with report. $R{item_key_in_locale_bundle} syntax is used to get values for keys from the bundle. For more information please refer to our JR Ultimate Guide "Internationalization" section. Regards, Vadim
  5. Hello, maybe you're running application as the user who has no rights to create files in that location. Try to specify some concrete location where you know you have all the rights for the user who runs the app. Regards, Vadim
  6. Hello, I am not sure I understand the issue correclty. Do you want to display the report query in report? Or do you want to pass the query? To pass the query click the Report Query button right next to Preview button. There you can specify the query for main report dataset. If you want to display the report query somewhere in the report you can create a String text field with the following expression: $P{JASPER_REPORT}.getMainDataset().getQuery().getText() Regards, Vadim
  7. Hello, when creating report in New->Report you can click on the report template and click finish right away. This will create blank report based on that template. You can afterwards specify the query and map fields manually in designer without need to query the DB. Regards, Vadim
  8. Hello, this sounds like a doable scenario: you can create a jasper report template that would look like W2 template and fill it with data that would come from web application (parameters for report query or some result set). JasperReports and report queies can be highly parametrized. Unfortunately I do not have a JasperReports template that would look like a w2 form :( Regards, Vadim
  9. Hello Sanjana, I am not sure on the Apex Forms implementation details but you can embed reports into external applications using rest_v2 web services. Please refer to our web services guide for more information. Best regards, Vadim
  10. Hello Phaks, take a look at this thread and especially answer by user kmkdz: http://community.jaspersoft.com/questions/802580/how-create-excel-data-source-jasperreports-server Usage of CSV data source in JRS is similar, you would just need to replace XLS with CSV in your configurations. Hope this helps, Vadim
  11. Hello Sandeep, take a look at evaluation time property for text fields (section Evaluating Text Fields in JR Ultimate Guide). Basically what this property does is define when the element will be evaluated. You can delay the evaluation of element in detail band up until the end of report. Hope this helps. Regards, Vadim
  12. Hello Brett, I assume you're looking into JasperReports Server. I believe both requirements are possible. JR engine allows you to parametrize report queries and JRS had administrative functionality (users roles, profile attributes) that can limit access to certain data or reports. Reports can use JRS user details like user name or profile attribute to parametrize the query. Alternatively you can create a domain and set up domain security for it that would restrict data access to different users. I would strongly suggest you to contact our sales team for more details on the JR/JRS features. Kind regards, vadim
  13. The code: ($F{field_name} == null ? new Boolean(false) : new Boolean(true) ) can be just shortened to $F{field_name}.equals(null). Make sure that your field field_name actually returns a proper java null value. It can return an empty string ("") which isn't the same thing as null.
  14. Hello, java.lang.Comparable is not a type but an Interface. You can have any expression in series that would return you a data type that implements java.lang.Comparable. Numbers, dates and string types all implement comparable interface. Regards, Vadim
  15. Hello, this would be possible only if you actually remove the margins in the report. Margins define what space should be preserved and not occupied by any of the elements. Regards, Vadim
  16. Have you specified Font Locales when you've been installing the font? There also may exist a font in the system already that is named Lucida Console which doesn't have Greek characters. Can you please check that? Also does JSS generate the HTML export as JRS does?
  17. > How does one extend this? In /WEB-INF/bundles/adhoc_masks%locale%.properties you can add more masks. Like this for example: ADH_100_MASK_date_3 = YYYYMMdd ADH_100_MASK_timestamp_5 = YYYYMMdd > Perhaps it might be helpful to state that Groovy is the way to go? Domain designer calc fields can use groovy expressions like this groovy('code here'). Nothing too fancy right now, I'd suggest to stick to basic expressions for now.
  18. Hello Jay, In ad hoc view editor you can change the format of timestamp field by dragging it to the pane and right clicking on it -> Date format. That changes the display format. 1. the unclickable domain designer when you specify date field mask in display tab sounds like a defect that is marked to be fixed in 5.6. 2. Should be possible using Groovy expressions. Kind regards, Vadim
  19. Hello, unfortunately we do not supply bundles for Portugese (Portugal) locale, only for Brazilian Portugese. You may use pt_BR language bundle and adopt it to pt_PT. Otherwise maybe someone on these boards already has one and will send them over to you. Kind regards, Vadim
  20. This seems to be possible to be used as an XML datasource for a report. Take a look at our /demo/samples/xmldatasource sample report which uses and queries the XML datasource to fill the report. You can then export that to PDF. Hope this helps.
  21. Awesome, great to hear that. Will post the suggestion as answer.
  22. Only superuser has access to Manage-Server Settings menu where Import-Export UI is located.
  23. Hello Amit, this board is mostly monitored by technical people who do not have much insight regarding licensing and legal. You would be better off sending this inquiry to our sales team (sales@jaspersoft.com / https://www.jaspersoft.com/contact-us). Kind regards, Vadim
  24. Hello, not sure what chart package you use, I assume JR Charts. You can set a Series Hyperlink for your pie slices: Right Click on Pie chart -> Chart Data -> Details -> Section Hyperlink. There you can set expression for each section hyperlink. For more details on how hyperlink expressions work please refer to JR Ultimate Guide. Kind regards, Vadim
  25. Hello, please check that you're actually executing the report against the correct data adapter/data source in JSS and that adapter is correctly configured. JR practically relies on JDBC driver to return a dataset for it to use. Regards, Vadim
×
×
  • Create New...