net.sf.jasperreports.engine.JRDataSource Java Examples

The following examples show how to use net.sf.jasperreports.engine.JRDataSource. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BaseFillHandle.java    From jasperreports with GNU Lesser General Public License v3.0 6 votes vote down vote up
protected BaseFillHandle (
		JasperReportsContext jasperReportsContext,
		JasperReportSource reportSource,
		Map<String,Object> parameters,
		JRDataSource dataSource,
		Connection conn
		) throws JRException
{
	this.jasperReportsContext = jasperReportsContext;
	this.jasperReport = reportSource.getReport();
	this.parameters = parameters;
	this.dataSource = dataSource;
	this.conn = conn;
	this.filler = JRFiller.createReportFiller(jasperReportsContext, reportSource);
	this.listeners = new ArrayList<AsynchronousFilllListener>();
	lock = this;
}
 
Example #2
Source File: VirtualizerApp.java    From jasperreports with GNU Lesser General Public License v3.0 6 votes vote down vote up
private static JasperPrint fillReport(JRFileVirtualizer virtualizer) throws JRException
{
	long start = System.currentTimeMillis();

	// Virtualization works only with in memory JasperPrint objects.
	// All the operations will first fill the report and then export
	// the filled object.
	
	// creating the data source
	JRDataSource dataSource = new JREmptyDataSource(1000);
	
	// Preparing parameters
	Map<String, Object> parameters = new HashMap<String, Object>();
	parameters.put(JRParameter.REPORT_VIRTUALIZER, virtualizer);

	// filling the report
	JasperPrint jasperPrint = JasperFillManager.fillReport("build/reports/VirtualizerReport.jasper", parameters, dataSource);
	
	virtualizer.setReadOnly(true);

	System.err.println("Filling time : " + (System.currentTimeMillis() - start));
	return jasperPrint;
}
 
Example #3
Source File: SortedDataSource.java    From jasperreports with GNU Lesser General Public License v3.0 6 votes vote down vote up
public JRDataSource getOriginalDataSource() throws JRException
{
	if (currentRecord != null && originalDataSource instanceof RandomAccessDataSource)
	{
		RandomAccessDataSource dataSource = (RandomAccessDataSource) originalDataSource;
		if (dataSource.currentIndex() != currentRecord.originalRecordIndex)
		{
			if (log.isDebugEnabled())
			{
				log.debug("moving original data source to record " + currentRecord.originalRecordIndex);
			}
			dataSource.moveToRecord(currentRecord.originalRecordIndex);
		}
	}
	
	return originalDataSource;
}
 
Example #4
Source File: JRHibernateQueryExecuter.java    From jasperreports with GNU Lesser General Public License v3.0 6 votes vote down vote up
/**
 * Creates an instance of {@link JRHibernateListDataSource JRHibernateListDataSource},
 * {@link JRHibernateIterateDataSource JRHibernateIterateDataSource} or
 * {@link JRHibernateScrollDataSource JRHibernateScrollDataSource}, depending on the 
 */
@Override
public JRDataSource createDatasource() throws JRException
{
	JRDataSource datasource = null;
	String queryString = getQueryString();
	
	if (session != null && queryString != null && queryString.trim().length() > 0)
	{
		createQuery(queryString);

		datasource = createResultDatasource();
	}

	return datasource;
}
 
Example #5
Source File: AvvisoPagamentoPdf.java    From govpay with GNU General Public License v3.0 6 votes vote down vote up
public byte[] creaAvviso(Logger log, AvvisoPagamentoInput input, String codDominio, AvvisoPagamentoProperties avProperties) throws Exception {
	// cerco file di properties esterni per configurazioni specifiche per dominio
	Properties propertiesAvvisoPerDominio = avProperties.getPropertiesPerDominio(codDominio, log);

	this.caricaLoghiAvviso(input, propertiesAvvisoPerDominio);

	// leggo il template file jasper da inizializzare
	String jasperTemplateFilename = propertiesAvvisoPerDominio.getProperty(AvvisoPagamentoCostanti.AVVISO_PAGAMENTO_TEMPLATE_JASPER);

	if(!jasperTemplateFilename.startsWith("/"))
		jasperTemplateFilename = "/" + jasperTemplateFilename; 

	InputStream is = AvvisoPagamentoPdf.class.getResourceAsStream(jasperTemplateFilename);
	Map<String, Object> parameters = new HashMap<>();
	JRDataSource dataSource = this.creaXmlDataSource(log,input);
	JasperPrint jasperPrint = this.creaJasperPrintAvviso(log, input, propertiesAvvisoPerDominio, is, dataSource,parameters);

	byte[] reportToPdf = JasperExportManager.exportReportToPdf(jasperPrint);
	return reportToPdf;
}
 
Example #6
Source File: JRJpaQueryExecuter.java    From jasperreports with GNU Lesser General Public License v3.0 6 votes vote down vote up
/**
 * Creates a data source out of the query result.
 * 
 * @return the data source
 */
protected JRDataSource createResultDatasource()	{
	JRDataSource resDatasource;
	
	try {
		int pageSize = getPropertiesUtil().getIntegerProperty(dataset, 
				JRJpaQueryExecuterFactory.PROPERTY_JPA_QUERY_PAGE_SIZE,
				0);

		resDatasource = new JRJpaDataSource(this, pageSize);
	}
	catch (NumberFormatException e) {
		throw 
			new JRRuntimeException(
				EXCEPTION_MESSAGE_KEY_NUMERIC_TYPE_REQUIRED,
				new Object[]{JRJpaQueryExecuterFactory.PROPERTY_JPA_QUERY_PAGE_SIZE},
				e);
	}
	
	return resDatasource;
}
 
Example #7
Source File: ReportGenerationServiceImpl.java    From kfs with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * @see org.kuali.kfs.sys.batch.service.ReportGenerationService#generateReportToOutputStream(java.util.Map, java.lang.Object,
 *      java.lang.String, java.io.ByteArrayOutputStream)
 */
public void generateReportToOutputStream(Map<String, Object> reportData, Object dataSource, String template, ByteArrayOutputStream baos) {
    ClassPathResource resource = getReportTemplateClassPathResource(template.concat(ReportGeneration.DESIGN_FILE_EXTENSION));
    if (resource == null || !resource.exists()) {
        throw new IllegalArgumentException("Cannot find the template file: " + template.concat(ReportGeneration.DESIGN_FILE_EXTENSION));
    }

    try {
        if (reportData != null && reportData.containsKey(ReportGeneration.PARAMETER_NAME_SUBREPORT_TEMPLATE_NAME)) {
            Map<String, String> subReports = (Map<String, String>) reportData.get(ReportGeneration.PARAMETER_NAME_SUBREPORT_TEMPLATE_NAME);
            String subReportDirectory = (String) reportData.get(ReportGeneration.PARAMETER_NAME_SUBREPORT_DIR);
            compileSubReports(subReports, subReportDirectory);
        }

        String designTemplateName = template.concat(ReportGeneration.DESIGN_FILE_EXTENSION);
        InputStream jasperReport = new FileInputStream(compileReportTemplate(designTemplateName));

        JRDataSource jrDataSource = JasperReportsUtils.convertReportData(dataSource);

         JasperRunManager.runReportToPdfStream(jasperReport, baos, decorateReportData(reportData), jrDataSource);
    }
    catch (Exception e) {
        LOG.error(e);
        throw new RuntimeException("Fail to generate report.", e);
    }
}
 
Example #8
Source File: JRMondrianQueryExecuter.java    From jasperreports with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public JRDataSource createDatasource() throws JRException
{
	JRDataSource dataSource = null;
	
	String queryStr = getQueryString();
	if (connection != null && queryStr != null)
	{
		if (log.isDebugEnabled())
		{
			log.debug("MDX query: " + queryStr);
		}
		
		Query query = connection.parseQuery(queryStr);
		result = connection.execute(query);
		logResult();
		
		dataSource = new JRMondrianDataSource(dataset, result);
	}

	return dataSource;
}
 
Example #9
Source File: JRCsvDataSourceProvider.java    From jasperreports with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public JRDataSource create(JasperReport report) throws JRException
{
	JRCsvDataSource ds;
	if (reader != null)
	{
		 ds = new JRCsvDataSource(reader);
	}
	else 
	{
		throw 
		new JRException(
			EXCEPTION_MESSAGE_KEY_CANNOT_FIND_SOURCE,
			(Object[])null);
	}

	ds.setDateFormat(dateFormat);
	ds.setNumberFormat(numberFormat);
	ds.setFieldDelimiter(fieldDelimiter);
	ds.setRecordDelimiter(recordDelimiter);
	ds.setColumnNames(columnNames);

	return ds;
}
 
Example #10
Source File: AvvisoPagamentoPdf.java    From govpay with GNU General Public License v3.0 6 votes vote down vote up
public JRDataSource creaXmlDataSource(Logger log,AvvisoPagamentoInput input) throws UtilsException, JRException, JAXBException {
//		WriteToSerializerType serType = WriteToSerializerType.XML_JAXB;
		Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
		jaxbMarshaller.setProperty("com.sun.xml.bind.xmlDeclaration", Boolean.FALSE);
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		JAXBElement<AvvisoPagamentoInput> jaxbElement = new JAXBElement<AvvisoPagamentoInput>(new QName("", "input"), AvvisoPagamentoInput.class, null, input);
		jaxbMarshaller.marshal(jaxbElement, baos);
		JRDataSource dataSource = new JRXmlDataSource(new ByteArrayInputStream(baos.toByteArray()),AvvisoPagamentoCostanti.AVVISO_PAGAMENTO_ROOT_ELEMENT_NAME);
		return dataSource;
	}
 
Example #11
Source File: JRFillDataset.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Creates the data source from a connection.
 * 
 * @return the data source to be used
 * @throws JRException
 */
private JRDataSource createQueryDatasource() throws JRException
{
	if (query == null)
	{
		return null;
	}

	try
	{
		if (log.isDebugEnabled())
		{
			log.debug("Fill " + filler.fillerId + ": Creating " + query.getLanguage() + " query executer");
		}
		
		QueryExecuterFactory queryExecuterFactory = JRQueryExecuterUtils.getInstance(getJasperReportsContext()).getExecuterFactory(query.getLanguage());
		SimpleQueryExecutionContext queryExecutionContext = SimpleQueryExecutionContext.of(
				getJasperReportsContext(), getRepositoryContext());
		queryExecuter = queryExecuterFactory.createQueryExecuter(queryExecutionContext, this, parametersMap);
		filler.fillContext.setRunningQueryExecuter(queryExecuter);
		
		return queryExecuter.createDatasource();
	}
	finally
	{
		filler.fillContext.clearRunningQueryExecuter();
	}
}
 
Example #12
Source File: ReportGenerationServiceImpl.java    From kfs with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * The dataSource can be an instance of JRDataSource, java.util.Collection or object array.
 * 
 * @see org.kuali.kfs.sys.batch.service.ReportGenerationService#generateReportToPdfFile(java.util.Map, java.lang.Object, java.lang.String,
 *      java.lang.String)
 */
public void generateReportToPdfFile(Map<String, Object> reportData, Object dataSource, String template, String reportFileName) {
    ClassPathResource resource = getReportTemplateClassPathResource(template.concat(ReportGeneration.DESIGN_FILE_EXTENSION));
    if (resource == null || !resource.exists()) {
        throw new IllegalArgumentException("Cannot find the template file: " + template.concat(ReportGeneration.DESIGN_FILE_EXTENSION));
    }

    try {
        if (reportData != null && reportData.containsKey(ReportGeneration.PARAMETER_NAME_SUBREPORT_TEMPLATE_NAME)) {
            Map<String, String> subReports = (Map<String, String>) reportData.get(ReportGeneration.PARAMETER_NAME_SUBREPORT_TEMPLATE_NAME);
            String subReportDirectory = (String) reportData.get(ReportGeneration.PARAMETER_NAME_SUBREPORT_DIR);
            compileSubReports(subReports, subReportDirectory);
        }

        String designTemplateName = template.concat(ReportGeneration.DESIGN_FILE_EXTENSION);
        InputStream jasperReport = new FileInputStream(compileReportTemplate(designTemplateName));

        JRDataSource jrDataSource = JasperReportsUtils.convertReportData(dataSource);

        reportFileName = reportFileName + ReportGeneration.PDF_FILE_EXTENSION;
        File reportDirectory = new File(StringUtils.substringBeforeLast(reportFileName, File.separator));
        if(!reportDirectory.exists()) {
            reportDirectory.mkdir();
        }

        JasperRunManager.runReportToPdfStream(jasperReport, new FileOutputStream(reportFileName), decorateReportData(reportData), jrDataSource);
    }
    catch (Exception e) {
        LOG.error(e);
        throw new RuntimeException("Fail to generate report.", e);
    }
}
 
Example #13
Source File: JRXmlaQueryExecuter.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public JRDataSource createDatasource() throws JRException
{
	getResult();
	
	return new JROlapDataSource(dataset, xmlaResult);
}
 
Example #14
Source File: ReportFunctions.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Function("ORIGINAL_DATA_SOURCE")
public JRDataSource ORIGINAL_DATA_SOURCE()
{
	try
	{
		return originalDataSource();
	}
	catch (JRException e)
	{
		throw new JRRuntimeException(e);
	}
}
 
Example #15
Source File: ReportFunctions.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
protected JRDataSource originalDataSource() throws JRException
{
	JRDataSource dataSource = (JRDataSource) getContext().getParameterValue(JRParameter.REPORT_DATA_SOURCE);
	if (dataSource instanceof SortedDataSource)
	{
		dataSource = ((SortedDataSource) dataSource).getOriginalDataSource();
	}
	return dataSource;
}
 
Example #16
Source File: XalanXPathQueryExecuter.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public JRDataSource createDatasource() throws JRException
{
	XalanXmlDataSource datasource = null;
	
	String xPath = getQueryString();
	
	if (log.isDebugEnabled())
	{
		log.debug("XPath query: " + xPath);
	}
	
	if (document != null && xPath != null)
	{
		if (namespacesMap == null)
		{
			namespacesMap = extractXmlNamespacesFromProperties();
		}
		
		datasource = new XalanXmlDataSource(document, xPath);
		
		datasource.setXmlNamespaceMap(namespacesMap);
		datasource.setDetectXmlNamespaces(getBooleanParameterOrProperty(XalanXPathQueryExecuterFactory.XML_DETECT_NAMESPACES, false));
		datasource.setDocumentBuilderFactory(documentBuilderFactory);
		
		datasource.setLocale((Locale)getParameterValue(XalanXPathQueryExecuterFactory.XML_LOCALE, true));
		datasource.setDatePattern(getStringParameter(XalanXPathQueryExecuterFactory.XML_DATE_PATTERN, XalanXPathQueryExecuterFactory.PROPERTY_XML_DATE_PATTERN));
		datasource.setNumberPattern(getStringParameter(XalanXPathQueryExecuterFactory.XML_NUMBER_PATTERN, XalanXPathQueryExecuterFactory.PROPERTY_XML_NUMBER_PATTERN));
		datasource.setTimeZone((TimeZone)getParameterValue(XalanXPathQueryExecuterFactory.XML_TIME_ZONE, true));
	}
	
	return datasource;
}
 
Example #17
Source File: ReportFunctions.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Function("SUB_DATA_SOURCE")
@FunctionParameters({@FunctionParameter("expression")})
public JRDataSource SUB_DATA_SOURCE(String expression)
{
	try
	{
		HierarchicalDataSource<?> hierarchicalDataSource = hierarchicalDataSource();
		return hierarchicalDataSource.subDataSource(expression);
	}
	catch (JRException e)
	{
		throw new JRRuntimeException(e);
	}
}
 
Example #18
Source File: AbstractJasperReportsView.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
/**
 * Create a report using the given provider.
 * @param provider the JRDataSourceProvider to use
 * @return the created report
 */
protected JRDataSource createReport(JRDataSourceProvider provider) {
	try {
		JasperReport report = getReport();
		if (report == null) {
			throw new IllegalStateException("No main report defined for JRDataSourceProvider - " +
					"specify a 'url' on this view or override 'getReport()'");
		}
		return provider.create(report);
	}
	catch (JRException ex) {
		throw new IllegalArgumentException("Supplied JRDataSourceProvider is invalid", ex);
	}
}
 
Example #19
Source File: ContractsGrantsAwardBalancesReportServiceImpl.java    From kfs with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 *
 * @see org.kuali.kfs.module.cg.report.service.ContractsGrantsAwardBalancesReportService#generateReport(org.kuali.kfs.module.cg.report.ContractsGrantsReportDataHolder, org.kuali.kfs.sys.report.ReportInfo, java.io.ByteArrayOutputStream)
 */
@Override
public String generateReport(ContractsGrantsReportDataHolder reportDataHolder, ReportInfo reportInfo, ByteArrayOutputStream baos) {
    Date runDate = new Date();

    String reportFileName = reportInfo.getReportFileName();
    String reportDirectory = reportInfo.getReportsDirectory();
    String reportTemplateClassPath = reportInfo.getReportTemplateClassPath();
    String reportTemplateName = reportInfo.getReportTemplateName();
    ResourceBundle resourceBundle = reportInfo.getResourceBundle();

    String subReportTemplateClassPath = reportInfo.getSubReportTemplateClassPath();
    Map<String, String> subReports = reportInfo.getSubReports();

    Map<String, Object> reportData = reportDataHolder.getReportData();
    // check title and set
    if (ObjectUtils.isNull(reportData.get(KFSConstants.REPORT_TITLE))) {
        reportData.put(KFSConstants.REPORT_TITLE, reportInfo.getReportTitle());
    }
    reportData.put(JRParameter.REPORT_RESOURCE_BUNDLE, resourceBundle);
    reportData.put(ReportGeneration.PARAMETER_NAME_SUBREPORT_DIR, subReportTemplateClassPath);
    reportData.put(ReportGeneration.PARAMETER_NAME_SUBREPORT_TEMPLATE_NAME, subReports);

    String template = reportTemplateClassPath + reportTemplateName;
    String fullReportFileName = reportGenerationService.buildFullFileName(runDate, reportDirectory, reportFileName, "");

    List<String> data = Arrays.asList(KFSConstants.EMPTY_STRING);
    JRDataSource dataSource = new JRBeanCollectionDataSource(data);

    reportGenerationService.generateReportToOutputStream(reportData, dataSource, template, baos);

    return reportFileName;
}
 
Example #20
Source File: JRFillDataset.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Sets the data source to be used.
 * 
 * @param parameterValues the parameter values
 * @param ds the data source
 */
public void setDatasourceParameterValue(Map<String,Object> parameterValues, JRDataSource ds)
{
	useDatasourceParamValue = true;
	
	if (ds != null)
	{
		parameterValues.put(JRParameter.REPORT_DATA_SOURCE, ds);
	}
}
 
Example #21
Source File: JaxenXPathQueryExecuter.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public JRDataSource createDatasource() throws JRException
{
	JaxenXmlDataSource datasource = null;
	
	String xPath = getQueryString();
	
	if (log.isDebugEnabled())
	{
		log.debug("XPath query: " + xPath);
	}
	
	if (document != null && xPath != null)
	{
		if (namespacesMap == null)
		{
			namespacesMap = extractXmlNamespacesFromProperties();
		}
		
		datasource = new JaxenXmlDataSource(document, xPath);
		
		datasource.setXmlNamespaceMap(namespacesMap);
		datasource.setDetectXmlNamespaces(getBooleanParameterOrProperty(JaxenXPathQueryExecuterFactory.XML_DETECT_NAMESPACES, false));
		datasource.setDocumentBuilderFactory(documentBuilderFactory);
		
		datasource.setLocale((Locale)getParameterValue(JaxenXPathQueryExecuterFactory.XML_LOCALE, true));
		datasource.setDatePattern(getStringParameter(JaxenXPathQueryExecuterFactory.XML_DATE_PATTERN, JaxenXPathQueryExecuterFactory.PROPERTY_XML_DATE_PATTERN));
		datasource.setNumberPattern(getStringParameter(JaxenXPathQueryExecuterFactory.XML_NUMBER_PATTERN, JaxenXPathQueryExecuterFactory.PROPERTY_XML_NUMBER_PATTERN));
		datasource.setTimeZone((TimeZone)getParameterValue(JaxenXPathQueryExecuterFactory.XML_TIME_ZONE, true));
	}
	
	return datasource;
}
 
Example #22
Source File: AsynchronousFillHandle.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
protected AsynchronousFillHandle (
	JasperReportsContext jasperReportsContext,
	JasperReport jasperReport,
	Map<String,Object> parameters,
	JRDataSource dataSource
	) throws JRException
{
	this(jasperReportsContext, jasperReport, parameters, dataSource, null);
}
 
Example #23
Source File: AsynchronousFillHandle.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
protected AsynchronousFillHandle (
	JasperReportsContext jasperReportsContext,
	JasperReport jasperReport,
	Map<String,Object> parameters,
	JRDataSource dataSource,
	Connection conn
	) throws JRException
{
	this(jasperReportsContext, SimpleJasperReportSource.from(jasperReport),
			parameters, dataSource, conn);
}
 
Example #24
Source File: AsynchronousFillHandle.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
protected AsynchronousFillHandle (
	JasperReportsContext jasperReportsContext,
	JasperReportSource reportSource,
	Map<String,Object> parameters,
	JRDataSource dataSource,
	Connection conn
	) throws JRException
{
	super(jasperReportsContext, reportSource, parameters, dataSource, conn);
}
 
Example #25
Source File: AsynchronousFillHandle.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Creates an asychronous filling handle.
 * 
 * @param jasperReportsContext the context
 * @param jasperReport the report
 * @param parameters the parameter map
 * @param dataSource the data source
 * @return the handle
 * @throws JRException
 */
public static AsynchronousFillHandle createHandle(
	JasperReportsContext jasperReportsContext,
	JasperReport jasperReport,
	Map<String,Object> parameters,
	JRDataSource dataSource
	) throws JRException
{
	return createHandle(jasperReportsContext, SimpleJasperReportSource.from(jasperReport),
			parameters, dataSource);
}
 
Example #26
Source File: AsynchronousFillHandle.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static AsynchronousFillHandle createHandle(
	JasperReportsContext jasperReportsContext,
	JasperReportSource reportSource,
	Map<String,Object> parameters,
	JRDataSource dataSource
	) throws JRException
{
	return new AsynchronousFillHandle(jasperReportsContext, reportSource, parameters, dataSource, null);
}
 
Example #27
Source File: AsynchronousFillHandle.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * @see #createHandle(JasperReportsContext, JasperReport, Map, JRDataSource)
 */
public static AsynchronousFillHandle createHandle(
	JasperReport jasperReport,
	Map<String,Object> parameters,
	JRDataSource dataSource
	) throws JRException
{
	return createHandle(DefaultJasperReportsContext.getInstance(), jasperReport, parameters, dataSource);
}
 
Example #28
Source File: JRFiller.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 *
 */
public static JasperPrint fill(
	JasperReportsContext jasperReportsContext,
	JasperReport jasperReport,
	Map<String,Object> parameters,
	JRDataSource dataSource
	) throws JRException
{
	return fill(jasperReportsContext, SimpleJasperReportSource.from(jasperReport),
			parameters, dataSource);
}
 
Example #29
Source File: ReportGenerationServiceImpl.java    From kfs with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * @see org.kuali.kfs.sys.batch.service.ReportGenerationService#generateReportToPdfFile(java.util.Map, java.lang.String, java.lang.String)
 */
public void generateReportToPdfFile(Map<String, Object> reportData, String template, String reportFileName) {
    List<String> data = Arrays.asList(KFSConstants.EMPTY_STRING);
    JRDataSource dataSource = new JRBeanCollectionDataSource(data);

    generateReportToPdfFile(reportData, dataSource, template, reportFileName);
}
 
Example #30
Source File: BaseFillHandle.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
protected BaseFillHandle (
		JasperReportsContext jasperReportsContext,
		JasperReport jasperReport,
		Map<String,Object> parameters,
		JRDataSource dataSource,
		Connection conn
		) throws JRException
{
	this(jasperReportsContext, SimpleJasperReportSource.from(jasperReport),
			parameters, dataSource, conn);
}