Thursday, May 20, 2010

PureMVC Fabrication Popup


I am sure sombody has to go through this. PopUp In PureMVC.... But Not performing any events.... I know why..
Mediator for pop component is initializing befor you have the component.. Check the solution below...

//reportPopup is of type customComponent(PdfReportFrame).

 reportPopup = PopUpManager.createPopUp(this.payrollModule,PdfReportFrame,true) as PdfReportFrame;
 registerMediator(new PdfReportFrameMediator(reportPopup, source));


List Collection Data Not visible in mainreport of subreport - iReport


I have been wondering How iReport takes care of subreport I faced all above problem doing subreport in iReport.

In order to pass List / collection to subreport following things need to be done....

In Main Report. >>>>>>>>>>>>>>>>> Put Following

<import value="net.sf.jasperreports.engine.*"/>
<import value="*"/>

//Define List

<field name="addresses" class="java.util.List"/>

Pass List to subreport

<subreport isUsingCache="true">
<reportElement x="0" y="39" width="555" height="276"/>
<subreportExpression class="java.lang.String"><![CDATA[$P{SUBREPORT_DIR} "report1_subreport5.jasper"]]></subreportExpression>

In Subreport >>>>>>>>>>>>>>>>> put Following

very important >>> below address is field in my addressess List in Main Report

<field name="address" class="java.lang.String"/>

and In Detail Section Put Following

<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement x="142" y="20" width="92" height="20"/>
<font size="12"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{address}]]></textFieldExpression>

Remeber Many time you might not see subreport visible in main report reson being it the Property for Data to visible >>

"When No Data "(Property of report) should be set accordingly.

Hope this might help some one....


Tuesday, May 18, 2010

Subreport not displayed in main Jasper Report ireport

I am sure somebody would face this problem..
Using ireport 3.7.2

Subreport in Ireport is not displayed until I do the following.

<subreport><reportelement height="100" width="200" x="146" y="100"><subreport>
<reportelement height="100" width="200" x="146" y="100">
<subreportexpression class="java.lang.String"></subreportexpression></reportelement></subreport>
<subreportexpression class="java.lang.String"></subreportexpression></reportelement></subreport>

Remember to set properties of subreport (Also if ur using a static text to display in subreport)

Connection Type >>>> Use a datasource expression
Data Source Expression >>>> new net.sf.jasperreports.engine.JREmptyDataSource()

Make Sure you select "When No Data" Property to All Section No Details. most of the time Problem would be that data being set properly to subreport.

Look at this link for added information

Monday, May 17, 2010

simple Example with Javabeans/Java Object / POJO DataSource for JasperReport


small tutorial.. on Jasper Report JavaBeans DataSoruce with Static method

import java.util.ArrayList;

import sdInterface.JRDataSource;

public class JRFactoryClass {

public static ArrayList createBeanCollection () {
ArrayList list = new ArrayList();
// Java bean populated with row data by iBATIS
Employee msb = new Employee ();

list.add (msb);
Employee msb1 = new Employee ();

list.add (msb1);

return list;


create a JavaBeans set DataSource in Ireport to map the object with fieldName and static method.

Friday, May 14, 2010

Jasper Reports Java Objects/Class Map Example

Hi All,

Jasper Report Java Object Mapping example..

Following link give most of it. though it is back dated..

There are few books on IReport >> You might want to download from here.
Guide To IReport
The Definitive Guide to iReport (Expert's Voice)

Guide To JasperReport for Java
JasperReports for Java Developers: Create, Design, Format and Export Reports with the world's most popular Java reporting library

Multiton/singleton AS3 for Modules Flex / PureMvc / Fabrication

Hi Friends,

Was wondering how to reference a singleton instance for particular Module in flex..

after reading few blog and googling ..

found a solution/rather built upon it .. thought this might be helpful to somebody…

Most things in AS are built on Java so Looked at Java Mulitone >> and there is the solution…

import flash.utils.Dictionary;

public class InternalModelLocator
private static var instances:Dictionary= new Dictionary();//Dictionary is treated as Java Hash Map

public function InternalModelLocator()
/* Only One Instance created with GetInstanceMethod*/

/* module_uuid can be a String --------
In case of PureMVC "multitonKey" (this.multitonKey) can be used as unique key for multiple modules
public static function getInstance(module_uuid:String):InternalModelLocator
var instance:InternalModelLocator = instances[module_uuid];

if(instance == null)
instance = new InternalModelLocator();
instances[module_uuid] = instance;
return instance;

Let me know if I miss some thing or needs more elboration….

Thursday, May 13, 2010

Problem Downloading file filerefrence flex

Hi Friends,

strangly flex SDK some times work as if its dossed off.

you cannot create a fileRefrence object within same function your calling download..

you Cannot do following

var fileRef:FileReference = new FileReference();
var urlRequest:URLRequest = new URLRequest(source);;

You can do following

Create dummy filerefrence object. and then use in Function.