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

shrije

Members
  • Posts

    112
  • 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 shrije

  1. i could make it work with jfreechart. IReport demo samples have one to use jfreechart on jasper templates. Here one can use jfreechart with histogram to show the chart. Getting the sample data for histogram was a challenge since it does not publish one on their site but i managed to get one from the source code sites.

  2. It will stll with the same template since jasperPrint is the one which will be different for different reports in your case. Just that you have to provide different datasources to the same jasper file to get the jasper print object to finally append them.

  3. Please find the below code. One report corresponds to the one jasper file. Appending one report with another can happen with the code given below. It will be an as-is append.

    Code:
         for( int i = 0; i < listOfInputjasperpath.size(); i++ ) { try {        JasperPrint jasperPrint = JasperFillManager.fillReport(          listOfInputjasperpath.get( i ) + ".jasper", params );        listOfJasperPrint.add( jasperPrint );      } catch( JRException e ) {        throw new RuntimeException( "Exception related to Jasper Filling Data " + e );      }
  4. To solve the issue as discussed, i extended JRXmlDataSource  overridden getFieldValue(). It works for all the types of fields with class java.langString.

                 It does not work when i use this fields in the text box having a different type other than java.lang.String. Atleast it didno work with the type i was using (java.io.InputStream). Below is the code for the same. Initially if i return blank string it would throw JRExpressionEvalException.When i return new String(" "), it does not throw any excpetion but does not render the image for me too as in my example. I tried to debug but the code is dynamically generated so i was having diffculty debugging it.

     

    Code:
    public class BIXmlDataSource  extends JRXmlDataSource{  /**   * <p>   * Create a new instance of BIXmlDataSource.   * </p>   * @param document   * @throws JRException   */  public BIXmlDataSource( Document document )    throws JRException  {    super( document );  }  public Object getFieldValue(JRField jrField) throws JRException {    Object object = super.getFieldValue( jrField );    if(jrField.getValueClassName().equalsIgnoreCase( "java.lang.String" ) && object == null  ){      return new String(" ");    }else      return object;      }<image onErrorType="Blank">				<reportElement x="0" y="0" width="55" height="27" isRemoveLineWhenBlank="true"/>				<box>					<pen lineWidth="1.0"/>					<topPen lineWidth="1.0"/>					<leftPen lineWidth="1.0"/>					<bottomPen lineWidth="1.0"/>					<rightPen lineWidth="1.0"/>				</box>				<imageExpression class="java.io.InputStream"><![CDATA[new ByteArrayInputStream(Base64Decoder.decode($F{pin-legend}))]]></imageExpression>			</image>
  5. Blank when not null works when the field is alone part of the text field. But the problem is when i have to add a label to the text field as in   "Diagnosis :" +  ${field} In such cases, i have to check if each field is empty as part of the expression. I could also add label field and text field seperately. But at time i need the text appearing justified along with the label as in:

    Diagnosis: This is a Comment. This is a Comment.This is a Comment.This is a Comment.This is a Comment.This is a Comment.This is a Comment.This is a Comment.This is a Comment.

    During such times, having blank when null at the report level makes work light a lot.

    On a seperate note adding "additional detail bands in reports " was a boon for our kind development since we used to add groups in order to get bands otherwise in the previous versions. I have used jasper reports for quite some time now and the change i see has been phonomenal.

     

  6. I use jasper reports 3.7.0 with XML Datasource. I transform javabeans to xml using castor api and then use the xml as datasource for my reports. When any field in the javabean is zero-length string or null, the xml nodes for such fields are not created in the xml and thus they show up as "null" in the reports. I used the blanket property in jasper "When Resource Missing Type" as "Type Empty" but this would not work since the field does not have any value or may be it is not meant for the same. Also blank when null would not work if set for each field. Is there any other way to avoid this?

  7. Hi I have a requirement where the fonts to be supported for PDF are open type fonts with the file extension *.otf. I wonder if these are supported in jasper reports 3.7.0 as I tried to install them though iReport it gave a compatibility error. I am attaching one such font file with this post.

     

     

  8. You need to create Group and place city field in the group with the evaluationGroup as the name of the Group say CityGroup. You do not need seperate bean for this. Same bean will render the values for group as well as the other fields in detail.

     

    Shrirang

  9. I am in great trouble. I created around 10 odd templates to completion and  then i was trying to use maven plugin to compile the jrxml files to get the jasper files as installation artifacts. But the plugin from codehaus did not support groovy language expressions. Actually the groovy language must have been set by default. Now when i turn the language property to java my old expressions dont work and strangely i am not somehow able to fix the issue. My question is do we have a plugin which compiles jrxml files in groovy language. How can i get it ?

  10. As per the following code I am trying to map similar data in xml datasource. I am using a subreport. One thing i got from the examples is that the master as well as the child data elements(fields) are placed in detail band only. Is that the best way to do in jasper reports. I have been using jasper for quite some time now and i have designed very complex reports but we have created different subreports for every child data and the parent data was never in the detail band. Right now i am trying to configure the xml datasource but in vain. The subreport does not show up any data.

    Code:
    <Customers>    <CustomerID>WOLZA</CustomerID>    <CompanyName>Wolski  Zajazd</CompanyName>    <ContactName>Zbyszek Piestrzeniewicz</ContactName>    <ContactTitle>Owner</ContactTitle>    <Address>ul. Filtrowa 68</Address>    <City>Warszawa</City>    <PostalCode>01-012</PostalCode>    <Country>Poland</Country>    <Phone>(26) 642-7012</Phone>    <Fax>(26) 642-7012</Fax>  </Customers>  <Orders>    <OrderID>10248</OrderID>    <CustomerID>VINET</CustomerID>    <EmployeeID>5</EmployeeID>    <OrderDate>1996-07-04</OrderDate>    <RequiredDate>1996-08-01</RequiredDate>    <ShippedDate>1996-07-16</ShippedDate>    <ShipVia>3</ShipVia>    <Freight>32.38</Freight>    <ShipName>Vins et alcools Chevalier</ShipName>    <ShipAddress>59 rue de l'Abbaye</ShipAddress>    <ShipCity>Reims</ShipCity>    <ShipPostalCode>51100</ShipPostalCode>    <ShipCountry>France</ShipCountry>  </Orders>
  11. Hi,

    I am using iREport 3.7.0 and its awesome. I have been using iReports since the version 1.x and I see the great changes it is taking place in it. I like the meter chart theme in it but i need to change it slightly so that my bar chart works exactly the same as the meter chart i.e. One dimentional chart.

    Thanks in advance.

    Shrirang

  12. I wish to use XML datasource with the following sample data. Can anyone suggest me ? This data id different than the one in the source code samples.

     

    Code:
    <?xml version="1.0" encoding="UTF-8"?><Northwind>  <Customers>    <CustomerID>ALFKI</CustomerID>    <CompanyName>Alfreds Futterkiste</CompanyName>    <ContactName>Maria Anders</ContactName>    <ContactTitle>Sales Representative</ContactTitle>    <Address>Obere Str. 57</Address>    <City>Berlin</City>    <PostalCode>12209</PostalCode>    <Country>Germany</Country>    <Phone>030-0074321</Phone>    <Fax>030-0076545</Fax>   <Orders>     <OrderID>10249</OrderID>     <CustomerID>ALFKI</CustomerID>     <EmployeeID>6</EmployeeID>     <OrderDate>1996-07-05</OrderDate>     <RequiredDate>1996-08-16</RequiredDate>     <ShippedDate>1996-07-10</ShippedDate>     <ShipVia>1</ShipVia>     <Freight>11.61</Freight>     <ShipName>Toms Spezialitäten</ShipName>     <ShipAddress>Luisenstr. 48</ShipAddress>     <ShipCity>Münster</ShipCity>     <ShipPostalCode>44087</ShipPostalCode>     <ShipCountry>Germany</ShipCountry>   </Orders>  </Customers>  <Customers>    <CustomerID>ANATR</CustomerID>    <CompanyName>Ana Trujillo Emparedados y helados</CompanyName>    <ContactName>Ana Trujillo</ContactName>    <ContactTitle>Owner</ContactTitle>    <Address>Avda. de la Constitución 2222</Address>    <City>México D.F.</City>    <PostalCode>05021</PostalCode>    <Country>Mexico</Country>    <Phone>(5) 555-4729</Phone>    <Fax>(5) 555-3745</Fax>   <Orders>     <OrderID>10248</OrderID>     <CustomerID>ANATR</CustomerID>     <EmployeeID>5</EmployeeID>     <OrderDate>1996-07-04</OrderDate>     <RequiredDate>1996-08-01</RequiredDate>     <ShippedDate>1996-07-16</ShippedDate>     <ShipVia>3</ShipVia>     <Freight>32.38</Freight>     <ShipName>Vins et alcools Chevalier</ShipName>     <ShipAddress>59 rue de l'Abbaye</ShipAddress>     <ShipCity>Reims</ShipCity>     <ShipPostalCode>51100</ShipPostalCode>     <ShipCountry>France</ShipCountry>   </Orders>  </Customers>  <Customers>    <CustomerID>ANTON</CustomerID>    <CompanyName>Antonio Moreno Taquería</CompanyName>    <ContactName>Antonio Moreno</ContactName>    <ContactTitle>Owner</ContactTitle>    <Address>Mataderos  2312</Address>    <City>México D.F.</City>    <PostalCode>05023</PostalCode>    <Country>Mexico</Country>    <Phone>(5) 555-3932</Phone>   <Orders>     <OrderID>10250</OrderID>     <CustomerID>ANTON</CustomerID>     <EmployeeID>4</EmployeeID>     <OrderDate>1996-07-08</OrderDate>     <RequiredDate>1996-08-05</RequiredDate>     <ShippedDate>1996-07-12</ShippedDate>     <ShipVia>2</ShipVia>     <Freight>65.83</Freight>     <ShipName>Hanari Carnes</ShipName>     <ShipAddress>Rua do Paço, 67</ShipAddress>     <ShipCity>Rio de Janeiro</ShipCity>     <ShipRegion>RJ</ShipRegion>     <ShipPostalCode>05454-876</ShipPostalCode>     <ShipCountry>Brazil</ShipCountry>   </Orders>  </Customers></Northwind>
  13. I am facing this issue with iREport when configuring datasource with Hibernate using Spring.Error creating bean with name 'entityManagerFactory' defined in class path resource [analysis-server-dao-spring-config.xml]: Cannot create inner bean 'org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter#19c21c1' of type [org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter] while setting bean property 'jpaVendorAdapter'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter#19c21c1' defined in class path resource [analysis-server-dao-spring-config.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/hibernate/ejb/HibernatePersistence

    We are using spring 2.5.5 and hibernate 3.4.0 GA. Attached is the spring file.

    Code:
    <?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"	xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"	xsi:schemaLocation="       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">	<bean		class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">		<property name="locations">			<value>component.properties</value>		</property>		<property name="placeholderPrefix" value="$DB{" />		<property name="ignoreUnresolvablePlaceholders" value="true" />	</bean>	<bean id="entityManagerFactory"		class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">		<property name="persistenceUnitName" value="component" />		<property name="dataSource" ref="componentDataSource" />		<property name="persistenceXmlLocation" value="classpath:META-INF/persistence.xml" />		<property name="jpaVendorAdapter">			<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">				<property name="database" value="$DB{db.database.type}" />				<property name="showSql" value="true" />				<property name="generateDdl" value="true" />			</bean>		</property>	</bean>	<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">		<property name="entityManagerFactory" ref="entityManagerFactory" />		<property name="dataSource" ref="componentDataSource" />	</bean>	<tx:annotation-driven transaction-manager="transactionManager" />	<bean id="componentDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">		<property name="driverClass" value="$DB{db.connection.driver_class}" />		<property name="jdbcUrl" value="$DB{db.connection.url}" />		<property name="user" value="$DB{db.connection.username}" />		<property name="password" value="$DB{db.connection.password}" />	</bean>	<bean id="componentProgressDao"		class="com.company.iii.component.dao.impl.componentProgressDaoEjb3Impl">		<property name="entityManagerFactory" ref="entityManagerFactory" />	</bean>	<bean id="componentrequestDao"		class="com.company.iii.component.dao.impl.componentrequestDaoEjb3Impl">		<property name="entityManagerFactory" ref="entityManagerFactory" />	</bean>	<bean id="componentResultDao"		class="com.company.iii.component.dao.impl.componentResultDaoEjb3Impl">		<property name="entityManagerFactory" ref="entityManagerFactory" />	</bean>	<bean id="aggregateRequestDao"		class="com.company.iii.component.dao.impl.AggregateRequestDaoEjb3Impl">		<property name="entityManagerFactory" ref="entityManagerFactory" />	</bean>	<bean id="parameterGroupDao"		class="com.company.iii.component.dao.impl.ParameterGroupDaoEjb3Impl">		<property name="entityManagerFactory" ref="entityManagerFactory" />	</bean>	<bean id="parameterDao"		class="com.company.iii.component.dao.impl.ParameterDaoEjb3Impl">		<property name="entityManagerFactory" ref="entityManagerFactory" />	</bean>	<bean id="componentAlgorithmDao"		class="com.company.iii.component.dao.impl.componentAlgorithmDaoEjb3Impl">		<property name="entityManagerFactory" ref="entityManagerFactory" />	</bean>	<bean id="markerDao" class="com.company.iii.component.dao.impl.MarkerDaoEjb3Impl">		<property name="entityManagerFactory" ref="entityManagerFactory" />	</bean>	<bean id="parameterDefinitionDao"		class="com.company.iii.component.dao.impl.ParameterDefinitionDaoEjb3Impl">		<property name="entityManagerFactory" ref="entityManagerFactory" />	</bean>	<bean id="parameterDefinitionGroupDao"		class="com.company.iii.component.dao.impl.ParameterDefinitionGroupDaoEjb3Impl">		<property name="entityManagerFactory" ref="entityManagerFactory" />	</bean></beans>
×
×
  • Create New...