Package net.sf.jasperreports.engine

Examples of net.sf.jasperreports.engine.JRDataSource


    public InputStream generateGridReport(String docType, GridDTO data) {
        try {
            FastReportBuilder reportBuilder = new FastReportBuilder();
            reportBuilder.setTitle("IWebMvc - Sample Grid Report").setSubtitle("Generated at " + new Date()).setUseFullPageWidth(true);
            for (String column : data.getColumns()) reportBuilder.addColumn(column, column, String.class.getName(), 1);
            JRDataSource ds = new JRBeanCollectionDataSource(data.getData(), false);
            JasperPrint jp = DynamicJasperHelper.generateJasperPrint(reportBuilder.build(), new ClassicLayoutManager(), ds);
            return "EXCEL".equals(docType) ? exportToExcel(jp) : exportToPDF(jp);
        } catch (Exception e) {
            throw new IWebMvcException("Error building grid report", e);
        }
View Full Code Here


    return String.valueOf(getParameterValue(parameterName));
  }

  public JRDataSource createDatasource() throws JRException
  {
    JRDataSource dataSource = null;
   
    String queryStr = getQueryString();
    if (connection != null && queryStr != null)
    {
      if (log.isDebugEnabled())
View Full Code Here

    try
    {
      if (dataSourceExpression != null)
      {
        JRDataSource dataSource = (JRDataSource) filler.evaluateExpression(dataSourceExpression, evaluation);
        dataset.setDatasourceParameterValue(parameterValues, dataSource);
      }
      else if (connectionExpression != null)
      {
        Connection connection = (Connection) filler.evaluateExpression(connectionExpression, evaluation);
View Full Code Here

 
    parseQuery();
  }
 
  public JRDataSource createDatasource() throws JRException {
    JRDataSource datasource = null;
    String queryString = getQueryString();
   
    if (em != null && queryString != null && queryString.trim().length() > 0) {
      createQuery(queryString);
View Full Code Here

   * Creates a data source out of the query result.
   *
   * @return the data source
   */
  protected JRDataSource createResultDatasource()  {
    JRDataSource resDatasource;
   
    try {
      int pageSize = JRProperties.getIntegerProperty(dataset,
          JRJpaQueryExecuterFactory.PROPERTY_JPA_QUERY_PAGE_SIZE,
          0);
View Full Code Here

  /* (non-Javadoc)
   * @see net.sf.jasperreports.engine.util.JRQueryExecuter#createDatasource()
   */
  public JRDataSource createDatasource() throws JRException
  {
    JRDataSource dataSource = null;
   
    createStatement();
   
    if (statement != null)
    {
View Full Code Here

   * {@link JRHibernateIterateDataSource JRHibernateIterateDataSource} or
   * {@link JRHibernateScrollDataSource JRHibernateScrollDataSource}, depending on the
   */
  public JRDataSource createDatasource() throws JRException
  {
    JRDataSource datasource = null;
    String queryString = getQueryString();
   
    if (session != null && queryString != null && queryString.trim().length() > 0)
    {
      createQuery(queryString);
View Full Code Here

   *
   * @return the data source
   */
  protected JRDataSource createResultDatasource()
  {
    JRDataSource resDatasource;
   
    String runType = JRProperties.getProperty(dataset,
        JRHibernateQueryExecuterFactory.PROPERTY_HIBERNATE_QUERY_RUN_TYPE);
    boolean useFieldDescriptions = JRProperties.getBooleanProperty(dataset,
        JRHibernateQueryExecuterFactory.PROPERTY_HIBERNATE_FIELD_MAPPING_DESCRIPTIONS,
View Full Code Here

    // 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 parameters = new HashMap();
    parameters.put(JRParameter.REPORT_VIRTUALIZER, virtualizer);
View Full Code Here

            Map parameters = (Map) request.getAttribute("jrParameters");
            if (parameters == null) {
                parameters = UtilHttp.getParameterMap(request);
            }

            JRDataSource jrDataSource = (JRDataSource) request.getAttribute("jrDataSource");
            JasperPrint jp = null;
            if (jrDataSource == null) {
                String datasourceName = delegator.getEntityHelperName(info);
                if (datasourceName != null && datasourceName.length() > 0) {
                    Debug.logInfo("Filling report with connection from datasource: " + datasourceName, module);
View Full Code Here

TOP

Related Classes of net.sf.jasperreports.engine.JRDataSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.