code: public void setConnection(Connection connection, boolean csv) {
  		this.connection = connection;
  		this.csv = csv;
          try {
              dialect = DialectUtil.getDialect(connection);
          } catch (Exception e) {
              e.printStackTrace();
          }
          if  (chart != null) {
              if (chart.getReport().getQuery() != null) {
                  chart.getReport().getQuery().setDialect(dialect);
              }           
          }
      }
docs: Set database connection
  
  @param connection database connection
  @param csv true for a csv file connection