2006 IR Open Dicussion Posted August 27, 2006 Share Posted August 27, 2006 By: subesingh - subesingh1 how to use bean as datasource 2006-04-17 06:20 To use bean class as data source i have written a bean class and a bean factory class. as given below package com.klgsystel.vidushi.billing.printing; import javax.swing.table.AbstractTableModel; import java.util.Collection; import java.util.Arrays; import net.sf.jasperreports.engine.JRField; import net.sf.jasperreports.engine.JRDataSource; import net.sf.jasperreports.engine.JRException; public class PrintBillDataSource { /** * */ private static Object[] data; public PrintBillDataSource(Object[] data0) { data = new Object[] { new CustomBean()}; } /** * */ public static Object[] getBeanArray() { return data; } /** * */ public static Collection getBeanCollection() { return Arrays.asList(data); } } But I do not understand how it map the jasper text field with columns Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now