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

bobtins

Members
  • Posts

    32
  • 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 bobtins

  1. The attribute "compressableMimeType" should be "compressibleMimeType". https://tomcat.apache.org/tomcat-8.5-doc/config/http.html
  2. I'd like to explain the origin of the problem in more depth. The workaround, which is to install JR Server in a directory with a shorter path, is still valid. I also thought that the 260 character limit was the culprit; however, this is confusing because in later versions of Windows, including Windows 10, this restriction has been lifted. Also, this can happen when none of the paths exceed 260 characters. It turns out that there is still a limit of 32,768 bytes on the size of the entire command line. This seems like a lot, but during the installation, an import process is started which includes a list of all the JARs in the directory <JRS_INSTALL>/buildomatic/conf_source/iePro/lib. In JRS 6.4, the count of JARs is approximately 304, so it's pretty easy to go over this limit. Previous versions of JRS had fewer JARs, so it was possible to have a longer path without hitting this error. The easiest workaround is still to install JRS on a shorter path; an issue has been filed to lift this limitation in a future version of JRS.
  3. Actually, the very last formatting option, which just shows three places, will actually show from three to sixteen, but the number used as an example only has two decimal places. Here are some more details if the provided formats are not enough: You can do further configuration of formatting in Ad Hoc by modifying the file WEB-INF/bundles/adhoc_masks.properties. Here are the formats for decimal types: ADH_100_MASK_dec_0 = #,##0.00ADH_100_MASK_dec_1 = 0ADH_100_MASK_dec_2 = $#,##0.00;($#,##0.00)ADH_100_MASK_dec_3 = $#,##0;($#,##0)ADH_100_MASK_dec_4 = $#,##0.000############# Decimal formats are specified by the Java DecimalFormat class; here's some documentation: https://docs.oracle.com/javase/tutorial/i18n/format/decimalFormat.html
  4. The definition of the Mid function is in the form of a Groovy language snippet which is part of the SQLGenerator bean. This definition is in WEB-INF/applicationContext-semanticLayer.xml. There is a defaultSQLGenerator bean which defines the Mid function this way: <entry key="Mid"> <value>"substr(" + sqlArgs[0] + ", " + sqlArgs[1] + (sqlArgs.size() == 3 ? (", " + sqlArgs[2]) : "") + ")"</value> </entry>[/code]If you only need to get Redshift working for domains, then you can change this default definition so it uses "substring" instead of "substr". If you need to get other data sources working, then this config change may affect the Mid function for other datasources, and you would have to configure a Redshift-specific SQLGenerator. Try changing the default and see how that works.
  5. Just wondering more about the dependency issue. Is it that there are too many, or it's difficult to make sure you have them all? The project is Maven-based, but I see there aren't any instructions for building from source. Is there anything that would make it easier to get going with this library?
  6. /scratches head OK, that's weird... I wish I could reproduce what you're seeing--thanks for trying this under a number of different circumstances. The web page runs some code to getting info from the repository on what the current user can do with each resource, and this gets translated into parts of the UI, including menus and the around the resource name that lets you click and run it. So somewhere this is going wrong. When you tried with joeuser, what were the perms for joeuser on the root folder and the test folder?
  7. @tbuterbaugh: That's a good idea--if the 5.2 JR server is available, I would confirm that it works there to rule out other causes for the problem. However, we have seen an issue with a similar error message (java.lang.RuntimeException: overwriting expression 'null'...) on upgrade to 5.5. In that case, the Ad Hoc view used a topic in which one field name contained a space, which was OK in 5.2. If this view still works in 5.2, we'd like to get some more information (if you don't mind sharing it) so that we can investigate. Could you export the Ad Hoc view that's causing a problem? This needs to be done by logging in as "superuser"; instructions can be found in the online doc here: http://support.jaspersoft.com/Docs/viewDocument.php?doc_id=184342507&start_page=119&nav=true Thanks!
  8. I tried to duplicate your issue with the sample "joeuser" user. I created a new role "testrole" with "joeuser" as a member, then I created a folder with read-only permissions for "testrole". I copied a report into that folder, and joeuser could run it. As jasperadmin, I scheduled the same report with PDF output into the read-only folder. When I logged back in as joeuser, I could see and run the PDF output. It looks like this works for me, so can you explain more about what happens? It sounds like you can see the PDF as a Content Resource, but what happens when you click on it?
  9. Are you setting the attributes with the Manage Users admin page? How are you accessing the attributes?
  10. Thanks, this is a good example of something we should be able to support in the product. We are implementing an expansion of the calculated fields capabilities in Ad Hoc for next release, and one thing I would like to enhance is the way we handle summary calculations. Currently, we just allow the user to specify a function, but for cases like this, the user should be allowed to have full control over how to calculate the summary. A few releases back, we did make a change so that the sum of a calculated field "a/b" would be "sum(a)/sum(b)". The formula that you want for the summary is actually "1 - sum(discount)/sum(retail)". I put your sample data into a database and tried it out. What I found was that the summary for "discount/retail" comes out as "sum(discount)/sum(retail)", but not summary for "1 - discount/retail" is really "sum(1 - discount/retail)", which is not correct. Thanks again for bringing this up. Often we are trying to strike a balance between ease of use and power in designing the user interface. In cases like this, users have a good idea of what to do, and we should figure out how to get out of the way and let them do it!
  11. That's interesting, I've been just looking into the same issue... I researched the existing XML datasources and query executers. Here's a good description of how to use them. It seems like there are two ways to get an XML datasource from a URL using JR standalone (without JR Server): 1. create datasource directly - create a JRXmlDataSource by passing the URL to the constructor - pass the datasource in the "REPORT_DATA_SOURCE" parameter 2. use one of the query executers - fetch the contents of the URL and parse it into an org.w3c.xml.Document - create a query in your JRXML with language set to "xPath" and a queryString containing the XPath of the elements you want to iterate over - pass the document object in the "XML_DATA_DOCUMENT" parameter In either of these cases, you need to have some Java code for setup--either building the JRXmlDatasource or parsing the XML. In JRServer, you would have to do this with a custom data source. One of the sample custom data sources (under samples/customDataSource in the JRServer install directory) is the so-called "webscraper" datasource. It's very similar to the XML query executer and data source. It can take the URL of an HTML page, fetch it, turn it into XML, and use an XPath to get a list of elements. I haven't tried it on an XML, but it might just work. The good thing about this implementation is that you can use it in JR Server either with or without a custom data source instance, because it can get the URL and XPath right from the queryString. If you want to check this out, you can get info about custom data sources (including the samples) in the JR Server doc, and there is also a readme.txt under samples/customDataSource. Here is the info from that file describing the Webscraper sample: Webscraper Custom Data Source The webscraper custom data source implementation can fetch a web page, decode the HTML, and extract selected data which is turned into field values in the data source. Its Spring bean definition file is located in <js-install>/samples/customDataSource/webapp/WEB-INF/applicationContext-webscraperDS.xml. These are the configuration items for the datasource: URL: An HTTP URL which refers to the HTML page containing the desired content DOM path: An XPath expression which locates HTML elements to be turned into rows in the data source Field paths: XPath expressions for each field defined in the JRXML which are used to locate the field value within each row selected by the DOM path The implementation creates a data source by taking the following steps: Uses the URL to issue a GET request for an HTML page. Converts the HTML response into XML using JTidy (http://jtidy.sourceforge.net). Uses the DOM path to select XML elements from the converted response. Create a new data source row for each selected element For each field, use the field path to determine the content for each field The data source has two parameters: the URL of the web page, and the XPath that selects the elements in the HTML page which will become rows in the data source. The parameters can be specified either by a data source definition in the repository or by a query string in the JRXML.The example reports for this data source read a web page from http://www.craigslist.org and extract a list of items for sale. The file reports/webscrapertest.jrxml has no query defined. Instead, it relies on an instance of the custom data source that has been created in the repository. Typical parameters to use with this data source are: URL: http://sfbay.craigslist.org/sfc/cta/ DOM Path: /html/body/blockquote[2]/div/pThe file reports/webscraperQEtest.jrxml contains a queryString element which specifies the URL and the DOM path. It should be used without defining a data source instance, because JasperServer will not run the query executer for this particular implementation if a data source is defined for the report unit. I hope this is useful for you! Let me know if you have any questions. Post Edited by bobtins at 07/18/2011 20:13 Post Edited by bobtins at 07/18/2011 20:15
  12. FWIW, I dug into this a little bit to figure out just how the order of input controls is determined. If the order of the input controls is really bugging you and you don't mind getting your hands dirty, you can change the order using SQL. Hibernate lets you map an ordered list of objects, and report units use this mapping for their input controls. The mapping from report unit to input control is stored in the table "JIReportUnitInputControl", and it has the id for the report unit, the input control, AND an index which determines the order of the input controls. You can update the index (column control_index) to change the order, but because control_index is part of the primary key, you can't just swap one by one because at some point you will have duplicate values. See below for how I swapped the two input controls with a couple update statements. See the attached screen shot for the result--not that useful, but it demonstrates the functionality! Practically, this means that we already have the hooks to do this; we just have to implement a way to change the order of the list in the repository and surface it in the web UI and web services. Code:mysql> desc jireportunitinputcontrol;+------------------+------------+------+-----+---------+-------+| Field | Type | Null | Key | Default | Extra |+------------------+------------+------+-----+---------+-------+| report_unit_id | bigint(20) | NO | PRI | NULL | || input_control_id | bigint(20) | NO | MUL | NULL | || control_index | int(11) | NO | PRI | NULL | |+------------------+------------+------+-----+---------+-------+3 rows in set (0.00 sec)mysql> select * from jireportunitinputcontrol where report_unit_id = 2197;+----------------+------------------+---------------+| report_unit_id | input_control_id | control_index |+----------------+------------------+---------------+| 2197 | 2195 | 0 || 2197 | 2196 | 1 |+----------------+------------------+---------------+2 rows in set (0.00 sec)mysql> update jireportunitinputcontrol set control_index = (3 + control_index) where report_unit_id = 2197;Query OK, 2 rows affected (0.00 sec)Rows matched: 2 Changed: 2 Warnings: 0mysql> select * from jireportunitinputcontrol where report_unit_id = 2197;+----------------+------------------+---------------+| report_unit_id | input_control_id | control_index |+----------------+------------------+---------------+| 2197 | 2195 | 3 || 2197 | 2196 | 4 |+----------------+------------------+---------------+2 rows in set (0.00 sec)mysql> update jireportunitinputcontrol set control_index = (control_index % 2) where report_unit_id= 2197;Query OK, 2 rows affected (0.02 sec)Rows matched: 2 Changed: 2 Warnings: 0mysql> select * from jireportunitinputcontrol where report_unit_id = 2197;+----------------+------------------+---------------+| report_unit_id | input_control_id | control_index |+----------------+------------------+---------------+| 2197 | 2196 | 0 || 2197 | 2195 | 1 |+----------------+------------------+---------------+2 rows in set (0.00 sec)
  13. JR supports Hibernate queries (with language "hql") with the JRHibernateQueryExecuterFactory. If you compile a JRXML with this kind of query and want to run the report with a standalone program, you need to instantiate a Hibernate SessionFactory and pass it to the JR filler using the "HIBERNATE_SESSION" parameter. In JasperServer, it's up to the ReportDataSource to do this, but out of the box, we only support bean, JDBC, and JNDI versions of ReportDataSource. There is actually a Hibernate custom data source in the "samples/customDataSource" directory, along with two other custom data sources. The Hibernate data source was added later and the doc on custom data sources (JasperServer User's Guide section 6.1) doesn't cover it. The Java source files and Spring config files for the implementation also have some helpful comments. To get started using the Hibernate custom data source, I'd do the following steps: Make sure that the Hibernate SessionFactory that you want to use is set up by doing one of the following: Configure a named Spring bean with class SessionFactory or HibernateDaoSupport in a Spring application context file (WEB-INF/applicationContext-<something>.xml) Configure a default session factory using the Hibernate-specific config file in WEB-INF/classes/hibernate.cfg.xml (one is included in the sample directory) Do nothing if you want to use JasperServer's repository session factory (spring bean name is "sessionFactory") Follow the instructions in the User's Guide section 6.1 to install the samples in your JasperServer webapp Restart your app server Log in as an admin and create a data source; you should now have the choice of Hibernate Data Source, so pick that For Session Factory Bean Name: If you created a SessionFactory as a named Spring bean, enter the name of that bean If you use hibernate.cfg.xml, leave it blank If you want to use JasperServer's session factory, enter "sessionFactory" You should now be able to create a report unit with JasperServer or with iReport's JasperServer plugin, using your newly created data source
  14. This recently came up as a customer support issue, so I did a little research on it. I looked into this a little bit--there are a couple parts to what the customer wants. First is getting this to work in JasperServer. If you wanted to set a server-wide default format factory by passing in the parameter to every report, you could add a new BuiltInParameterProvider to the array in applicationContext.xml: <bean id="builtInParameterProviders" class="java.util.ArrayList"> <constructor-arg> <list> <bean class="com.jaspersoft.jasperserver.api.engine.jasperreports.util.UserProfileBuiltInParameterProvider"/> </list> </constructor-arg> </bean> The source code of the UserProfileBuiltInParameterProvider has some more explanation of how it works. There may also be some mechanism in JR to configure the default format factory through jasperreports.properties. Second, how would you actually implement the new format factory in Java 5 or 6? In either case you would start by subclassing DefaultFormatFactory. Java 6 is easier--you can take the formatter returned from the superclass createNumberFormat() and set the rounding mode. Java 5 is a little harder but not impossible. You would get the formatter returned from the superclass createNumberFormat(), then create a wrapper that implements format() by converting the number into a BigDecimal and doing the correct rounding on it (you would have to look at the DecimalFormat to see how many decimal places it contains). Here's a good link for understanding rounding modes: http://www.javabeat.net/tips/35-precise-rounding-of-decimals-using-rounding-m.html Post Edited by bobtins at 09/20/2010 16:48
  15. BTW, I just noticed that you were considering modifying the source. If for some reason you can't upgrade to 3.7 and are interested in knowing how we fixed it, it's checked into the js-3.5.0 branch under revision 16310. Here's the URL for that revision in the public JS repository: http://jasperforge.org/scm/viewvc.php/?view=rev&root=jasperserver&revision=16310 Let me know if you have any more questions about this.
  16. ldangelo Wrote: Hi All, I'm wondering if anyone has experienced this problem (or if it has been fixed in a later version). We are using jasper server to schedule report execution. The output of the reports is stored in a folder in the repository "Content files". The reports being generated are very large 80-160 MB. And there are a lot of them. When you use the jasper server UI to view the contents of this folder it issues a query to get the list of JFileResource in that folder... The problem comes when this query returns the data stored in the blob. Obviously with 100's of reports generated 80M and larger this is not going scale (we run out of memory). So my questions: 1) Is this the case in the most recent version of JS? 2) Has anyone else experienced this problem? 3) Why would it return the contents of the blob at all? Is this necessary? I know that conventional wisdom on this forum is to increase the amount of heap available. However, we are running jasper server in a multi-tentant environment with 50 companies accessing the same instance with an average of 5 users per company. Obviously increasing heap space will eventually fail if say 3 people click on the folder at the same time... What I'm looking at doing is modifying the source to not include the contents of the blob but I have no idea what the impact of doing this would be. Any advice would be appreciated... I just looked through the Jaspersoft bug database and found that this is fixed in version 3.7. I tried it out myself by turning Hibernate SQL debugging on, which shows all the SQL that Hibernate is doing (it's a lot). Actually, when I schedule a report, it creates a content resource (in table JIContentResource) instead of a file resource. These two are almost the same, but the fix is only for content resources, which will cover the issue you described. In any case, I observed that the JIContentResource.data column is not included unless you display a particular report output, which is what you probably want to happen. I would advise you to upgrade to 3.7--or if you can wait a little while, we will be coming out with the 3.7.1 version of CE in the next month.
  17. One more point to connect this up to what you're trying to do: It sounds like you tweaked the webscraper data source query executer, so you are using the example in "mode 2" as I described above. This means that if you want to use it on JasperServer, just create your report unit without associating a data source. Let me know if I still haven't cleared this up. Post Edited by bobtins at 04/05/2010 17:48
  18. You've hit on a subtle issue with respect to data sources in JasperServer. Sherman is correct about setting JRParameter.REPORT_DATA_SOURCE in the parameter map. If you create a JasperServer report unit which uses a data source from the repository, and that data source sets the JRParameter.REPORT_DATA_SOURCE parameter, JasperServer says "OK, I already have my JRDataSource and I don't have to run the query". If this seems a little confusing, read on. There are really three possible ways you can get a JRDataSource to a report in JasperServer (notice that I don't mean JasperServer data source, because this is actually optional): 1. JasperServer data source only You can create an implementation of a JasperServer custom data source which can work without a query. It can get all the information it needs from Spring configuration or from the parameters of the JasperServer data source in repository. When this custom data source is used in a report, it sets the parameter JRParameter.REPORT_DATA_SOURCE in the parameter map, which JasperServer then passes on to the report. An example of this is the Webscraper datasource when used without a query. This is used in the example report customDataSource/reports/webscrapertest.jrxml. 2. QueryExecuter only You can create an implementation of JRQueryExecuterFactory and JRQueryExecuter that can get all the information they need to create a JRDataSource from the query itself. An example of this is the Webscraper query executer, which is used in the example report customDataSource/reports/webscraperQEtest.jrxml, which works without a JasperServer data source. 3. JasperServer data source with QueryExecuter In this case, the JasperServer data source and the JRQueryExecuter work together to create the JRDataSource. The JasperServer data source sets parameters which get used by the JRQueryExecuter implementation. The JRQueryExecuter parses the query and creates the JRDataSource for the report. Examples of this are the JDBC and JNDI JasperServer data sources, which work with the SQL JRQueryExecuter to create a JRDataSource from a SQL query. The confusing thing about the webscraper example is that it can be run as either type 1 or type 2, but when you run it as type 2 (using a query), you can't use the JasperServer data source. Most implementations will be either type 1 or type 2, but not both.
  19. If you want to set up a bean data source in JasperServer, you can create a custom data source. If you are using JasperServer CE, the doc for how to do this is in the User's Guide; if you're using Pro, it's in the Admin Guide. In addition, there is an example of a bean data source in samples/customDataSource which is ready to build and deploy. You should be able to drop in your own code and get going pretty quickly. I hope that helps! Bob
  20. Oh yeah, and don't worry about the security manager message on startup. That has nothing to do with the problem :)
  21. This is a bug that I fixed in 3.7.0.1 which should be coming out soon. In the meantime, there is a workaround. Here is the summary of what's going on: We’re doing security filters in memory by default now, which is a change from3.5. That has some implications for security filters using the "groovy()"function because it doesn’t work the same way when you use it for anin-memory filter.The quick workaround is to do security filters in the query and everythingshould work like it did in 3.5. To do that:- Look for this line in WEB-INF/applicationContext-adhoc.xml in your webapp: <property name="applySecurityFilterInMemory" value="true"/>- Change "true" to "false"- Restart the webapp[/code]
  22. The way I've been running JasperServer in Eclipse is to run Tomcat as a plain old Java app (that's what it is, after all!). I start out with a project based on the JasperServer source code directory. I am usually running pro, so I have a pro and CE project, with the CE project as a dependency of the Pro. I create a debug configuration (Run/Debug configs...) for Tomcat (I'm running 6.0.18) and enter settings in the tabs like so: Main tab: set project to my pro project set main class to the Tomcat main (org.apache.catalina.startup.Bootstrap)Arguments tab: Program arguments: start VM arguments (these can vary; the catalina.* args will depend on your Tomcat base dir): -Xmx800M -Xms128m -Xss2m -XX:PermSize=32m -XX:MaxPermSize=200m -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -Djavax.xml.soap.MessageFactory=org.apache.axis.soap.MessageFactoryImpl -Djavax.xml.soap.SOAPConnectionFactory=org.apache.axis.soap.SOAPConnectionFactoryImpl -Djavax.xml.soap.SOAPFactory=org.apache.axis.soap.SOAPFactoryImpl -Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl -Dcom.sun.management.jmxremote -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file="e:/install/apache-tomcat-6.0.18/conf/logging.properties" -Djava.endorsed.dirs="e:/install/apache-tomcat-6.0.18\common\endorsed" -Dcatalina.base="e:/install/apache-tomcat-6.0.18" -Dcatalina.home="e:/install/apache-tomcat-6.0.18" -Djava.io.tmpdir="e:/install/apache-tomcat-6.0.18\temp" -Djs.license.directory="e:/projects/pro/license/src/main/resources" JVM: use any version 6 JVM Classpath: <tomcat home>/bin/bootstrap.jar <jdk home>/lib/tools.jar (this is the compiler you need for jsp's)Source: You need to make sure your project's in there, along with any other source you'd like to attach. There is some trickery in setting up the JasperServer project itself, but once you get that, you should be able to run tomcat on it. Good luck!
  23. OK, I didn't realize that JR had upgraded. I'd like to be able to use a later version but 1.5.5 should be fine. We will change JS so it uses 1.5.5 too. Teodor, you can close this...or should I close it? Not sure what the conventions are for the trackers.
  24. I wrote this JSP and this error confused me because it says that the EL expression is wrong but I know it works for me. I googled and found out that there is a problem with EL in Tomcat 6.0.18, which you happen to be using, and a lot of folks have run into it (I don't see the problem with 6.0.16). Here's a description of the issue: http://jira.codehaus.org/browse/MRM-905 The workaround is to change the following line in WEB-INF/jsp/adhoc/cacheDetail.jsp: <c:when test="${! empty(cache.dataSets)}"> and add a space after "empty" and before "(": <c:when test="${! empty (cache.dataSets)}"> I added a couple spaces just to make sure you'd see it :) I'll make this change so it gets in for next release. Thanks!
×
×
  • Create New...