def load_datasource(datasource = nil)
      jasper_params = prepare_params

      # Parse and load XML as datasource
      if datasource
        _InputSource                 = Rjb.import('org.xml.sax.InputSource')
        _StringReader                = Rjb.import('java.io.StringReader')
        _JRXmlUtils                  = Rjb.import('net.sf.jasperreports.engine.util.JRXmlUtils')
        _JRXPathQueryExecuterFactory = Beardley.with_warnings { Rjb.import('net.sf.jasperreports.engine.query.JRXPathQueryExecuterFactory') }
        input_source = _InputSource.new
        input_source.setCharacterStream(_StringReader.new(datasource.to_s))
        data_document = Beardley.with_warnings do
          _JRXmlUtils._invoke('parse', 'Lorg.xml.sax.InputSource;', input_source)
        end
        jasper_params.put(_JRXPathQueryExecuterFactory.PARAMETER_XML_DATA_DOCUMENT, data_document)
      end

      # Build JasperPrint
      fill_report(jasper_params, datasource)
    end
def load_datasource(datasource = nil)
      jasper_params = prepare_params

      # Parse and load XML as datasource
      if datasource
        _InputSource                 = Rjb.import('org.xml.sax.InputSource')
        _StringReader                = Rjb.import('java.io.StringReader')
        _JRXmlUtils                  = Rjb.import('net.sf.jasperreports.engine.util.JRXmlUtils')
        _JRXPathQueryExecuterFactory = Beardley.with_warnings { Rjb.import('net.sf.jasperreports.engine.query.JRXPathQueryExecuterFactory') }
        input_source = _InputSource.new
        input_source.setCharacterStream(_StringReader.new(datasource.to_s))
        data_document = Beardley.with_warnings do
          _JRXmlUtils._invoke('parse', 'Lorg.xml.sax.InputSource;', input_source)
        end
        jasper_params.put(_JRXPathQueryExecuterFactory.PARAMETER_XML_DATA_DOCUMENT, data_document)
      end

      # Build JasperPrint
      fill_report(jasper_params, datasource)
    end
Load parseable XML datasource with java component