Examples of JRDataSource


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

Examples of net.sf.jasperreports.engine.JRDataSource

    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

Examples of net.sf.jasperreports.engine.JRDataSource

    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

Examples of net.sf.jasperreports.engine.JRDataSource

 
    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

Examples of net.sf.jasperreports.engine.JRDataSource

   * 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

Examples of net.sf.jasperreports.engine.JRDataSource

  /* (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

Examples of net.sf.jasperreports.engine.JRDataSource

   * {@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

Examples of net.sf.jasperreports.engine.JRDataSource

   *
   * @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

Examples of net.sf.jasperreports.engine.JRDataSource

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

Examples of net.sf.jasperreports.engine.JRDataSource

            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
Copyright © 2018 www.massapi.com. 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.