Monday, May 17, 2010

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

Hi,

small tutorial.. on Jasper Report JavaBeans DataSoruce

JRFactoryClass.java 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 ();
msb.setAgentId("2378");
msb.setFirstName("Test");
msb.setLastName("Sample");
msb.setGender("Male");

list.add (msb);
Employee msb1 = new Employee ();
msb1.setAgentId("2373");
msb1.setFirstName("Tested");
msb1.setLastName("Sample0");
msb1.setGender("Female");

list.add (msb1);

return list;
}


}

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

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..

http://ireport.sourceforge.net/cap3.html


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..
Strange

you Cannot do following

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

You can do following

Create dummy filerefrence object. and then use in Function.

Ranjit

Looking online Free book On Any computer Topic

Hi All,

If your looking online book to download basically in any topic in computers,

You should visit >>

PDFCHM

I have been following them for long and thought it might help book lovers.

It will find all your question for "How does it work".

Ranjit


Wednesday, May 12, 2010

Create/Register Mediator for Runtime created UIComponent Like adding into Pop up - PureMVC

Hi Friends,

Here I am again Puting accross point where I thought for second.
The solution for registering mediator for component in popup created at run time is below.

reportPopup = PopUpManager.createPopUp(this.payrollModule,PdfReportFrame,true) as PdfReportFrame;
registerMediator(new PdfReportFrameMediator(reportPopup)); //this without resolving component on parent
PopUpManager.centerPopUp(reportPopup);


Every thing else goes same way.


Ranjit

Type 1086: Syntax error: expecting semicolon before minus. Flex Problem - IFRAME expecting semicolon before minus

Flex Builder is throwing an "expecting semicolon before minus" error on the XML declaration!!

This is due to Package Name have "-" symbol. Would be great if Flex builder show approriate file.

:-) Helped me. Hope it helps some body.

Ranjit