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

federico.cattozzi

Members
  • Posts

    87
  • 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

Posts posted by federico.cattozzi

  1. Hi,

    My reports on JasperReports Server use a JNDI Data Source defined into this file

    C:Program Filesjasperreports-server-5.1apache-tomcatconfCatalinalocalhostjasperserver-pro.xml

    Developing with iReport I use a JDBC connection instead of JNDI to test the reports.

    Now I'm trying to switch to JasperSoft Studio.

    When I use JasperSoft Studio to try to open any Input Control placed on the server, JasperSoft Studio does not found JNDI Data Source and throws this exception:

    java.lang.Exception: 1 - Name <JNDI_NAME> is not bound in this Context    at com.jaspersoft.ireport.jasperserver.ws.WSClient.get(WSClient.java:274)    at com.jaspersoft.studio.server.protocol.soap.SoapConnection.get(SoapConnection.java:74)    at com.jaspersoft.studio.server.protocol.ProxyConnection.get(ProxyConnection.java:52)    at com.jaspersoft.studio.server.editor.input.InputControlsManager.getInputControls(InputControlsManager.java:120)    at com.jaspersoft.studio.server.editor.ReportRunControler$1.run(ReportRunControler.java:81)    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)[/code]

    If I manually add the JNDI Data Source to "Data Adapters" using "Import From Workspace" option and then I test it, this exception is thrown:

    javax.naming.NameNotFoundException; remaining name 'env/<JNDI_NAME>'//See attached image[/code]

    So how can I configure JNDI Data Source into JasperSoft Studio?

  2. Hi, I am experiencing the same problem.

    My environment:

    Client: Jaspersoft iReport Designer 4.5.1 -> 4.6

    Server: JasperReports Server 3.5 -> 4.5

    Java: JRE 7 update 7

    System: Windows 7 version 6.1 64bit

     

    I think that the guilty is Java 7.

    Surfing the web you can find other bugs related to SocketException in Java 7.

     

    I solved forcing iReport to use Java 6.

    Edit iReport shortcut adding appropriate "jdkhome" option as below:

    "C:\Program Files (x86)\Jaspersoft\iReport-4.5.1\bin\ireport.exe" --jdkhome "C:\Program Files\Java\jdk1.6.0_33"

     

  3. Have you tried it? I'm using Community Edition and this is a very basic feature.

    If you are lazy :) try the attacched file on your JasperReports Server without Input Control and without Data Source.



    Post Edited by helyair at 07/05/2012 09:20
  4.  Oracle:

    Code:
    SELECT (SELECT COUNT (*)          FROM holder         WHERE TRUNC (MONTHS_BETWEEN (SYSDATE, born_date) / 12) < 25)          AS under_25,       (SELECT COUNT (*)          FROM holder         WHERE TRUNC (MONTHS_BETWEEN (SYSDATE, born_date) / 12) >= 25)          AS equal_25_and_over  FROM DUAL
  5. Use REPORT_COUNT built-in variable into a textField with attribute evaluationTime="Report".

    You can use REPORT_MAX_COUNT parameter to limit the number of rows fetched.

    I also use a textField with following expression:

    Code:
    $V{REPORT_COUNT}.intValue() == $P{REPORT_MAX_COUNT}.intValue() ? "Not all data could be fetched" : null
  6. Workaround:

    If you are using SQL and your subreports do not use the result of the main query as parameter, move the query from main report to another new subreport, so you will have 3 subreports and the main report becomes only a container.

    In the "container" instead of the main query put something like "SELECT 1 FROM DUAL", this permits to print the detail band only one time with the content of all 3 subreports inside.



    Post Edited by helyair at 06/18/2012 13:41
  7. I answer to myself.

    An example:

    Code:
    public class MyJRDefaultScriptlet extends net.sf.jasperreports.engine.JRDefaultScriptlet {}	public int getMaxValue(String s) throws JRScriptletException, SQLException{		Connection con = ((Connection)this.getParameterValue(JRParameter.REPORT_CONNECTION));		Statement stmt = null;		String query = "SELECT max(foo.value) FROM foo WHERE foo.s = '" + s + "'";		int max = 0;		try {			stmt = con.createStatement();			ResultSet rs = stmt.executeQuery(query);			while (rs.next()) {				max = rs.getInt("value");			}		} catch (SQLException e ) {					} finally {			if (stmt != null) { stmt.close(); }		}		return max;	}}
  8.  I have a workaround:

    Code:
    public class MyEngineServiceImpl extends EngineServiceImpl {	public OrderedMap executeQuery(ExecutionContext context,			ResourceReference queryReference, String keyColumn, String[] resultColumns,			ResourceReference defaultDataSourceReference,			Map parameterValues) {		Object reportMaxCount = parameterValues.get(JRParameter.REPORT_MAX_COUNT);		if (reportMaxCount instanceof String)			parameterValues.put(JRParameter.REPORT_MAX_COUNT, Integer.valueOf((String)reportMaxCount));		else if (reportMaxCount instanceof BigDecimal)			parameterValues.put(JRParameter.REPORT_MAX_COUNT, Integer.valueOf(((BigDecimal)reportMaxCount).intValue()));		return super.executeQuery(context,				queryReference, keyColumn, resultColumns,				defaultDataSourceReference,				parameterValues);	}}
  9. Importing my reports from JS 3.5 to JS 3.7.1 or 4.1 I think to have found a bug on instantiation of the built-in parameter REPORT_MAX_COUNT.

    Im my reports a user can choice REPORT_MAX_COUNT number from a "Single Select List of Values".

    This works always in JS 3.5, but in JS 3.7.1 or 4.1 doesn't work if in the same form "Cascading Input Controls" are present.

    If I remove them report runs, but links inside it that send REPORT_MAX_COUNT to other reports don't work.

    See attacched images to understand the two errors.

  10.  I don't understand if you are using JasperServer or a your "web app".

    If you are using JS, you can't generate report output into a zip file, but you can use a OS scheduled task that calls "js-export" to export them into a zip file when you want.

×
×
  • Create New...