net.sf.jasperreports.engine.data

## Class JRXlsDataSource

- java.lang.Object
- - net.sf.jasperreports.engine.data.JRAbstractTextDataSource
  - - net.sf.jasperreports.engine.data.AbstractXlsDataSource
    - - net.sf.jasperreports.engine.data.JRXlsDataSource

- All Implemented Interfaces:
    JRDataSource, JRRewindableDataSource

  Deprecated.
  Replaced by `XlsDataSource`.

      public class JRXlsDataSource
      extends AbstractXlsDataSource

  This data source implementation reads an XLS stream.

  The default naming convention is to name report fields COLUMN_x and map each column with the field found at index x in each row (these indices start with 0). To avoid this situation, users can either specify a collection of column names or set a flag to read the column names from the first row of the CSV file.

  Version:
    $Id: JRXlsDataSource.java 6986 2014-03-26 09:50:48Z teodord $
  Author:
    Teodor Danciu (teodord@users.sourceforge.net)

- - ### Field Summary

    - ### Fields inherited from class net.sf.jasperreports.engine.data.AbstractXlsDataSource

      `columnNames, dateFormat, numberFormat, sheetSelection, useFirstRowAsHeader`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JRXlsDataSource(java.io.File file)` Deprecated. Creates a data source instance from an XLS file.
    `JRXlsDataSource(java.io.InputStream is)` Deprecated. Creates a data source instance from an XLS data input stream.
    `JRXlsDataSource(JasperReportsContext jasperReportsContext, java.lang.String location)` Deprecated. Creates a datasource instance that reads XLS data from a given location.
    `JRXlsDataSource(java.lang.String location)` Deprecated.
    `JRXlsDataSource(jxl.Workbook workbook)` Deprecated. Creates a data source instance from a workbook.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `checkReadStarted()` Deprecated.
    `void` | `close()` Deprecated. Closes the reader.
    `java.lang.Object` | `getFieldValue(JRField jrField)` Deprecated. Gets the field value for the current position.
    `void` | `moveFirst()` Deprecated. Moves back to the first element in the data source.
    `boolean` | `next()` Deprecated. Tries to position the cursor on the next element in the data source.

    - ### Methods inherited from class net.sf.jasperreports.engine.data.AbstractXlsDataSource

      `getColumnNames, getDateFormat, getNumberFormat, getSheetSelection, setColumnIndexes, setColumnNames, setColumnNames, setDateFormat, setNumberFormat, setSheetSelection, setUseFirstRowAsHeader`

    - ### Methods inherited from class net.sf.jasperreports.engine.data.JRAbstractTextDataSource

      `convertNumber, convertStringValue, getConvertBean, getDatePattern, getFormattedDate, getFormattedNumber, getLocale, getNumberPattern, getTimeZone, setDatePattern, setLocale, setLocale, setNumberPattern, setTextAttributes, setTimeZone, setTimeZone`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JRXlsDataSource

          public JRXlsDataSource(jxl.Workbook workbook)

      Deprecated.
      Creates a data source instance from a workbook.
      Parameters:
        `workbook` - the workbook

    - #### JRXlsDataSource

          public JRXlsDataSource(java.io.InputStream is)
                          throws JRException,
                                 java.io.IOException

      Deprecated.
      Creates a data source instance from an XLS data input stream.
      Parameters:
        `is` - an input stream containing XLS data
      Throws:
        `JRException`
        `java.io.IOException`

    - #### JRXlsDataSource

          public JRXlsDataSource(java.io.File file)
                          throws JRException,
                                 java.io.FileNotFoundException,
                                 java.io.IOException

      Deprecated.
      Creates a data source instance from an XLS file.
      Parameters:
        `file` - a file containing XLS data
      Throws:
        `JRException`
        `java.io.FileNotFoundException`
        `java.io.IOException`

    - #### JRXlsDataSource

          public JRXlsDataSource(JasperReportsContext jasperReportsContext,
                         java.lang.String location)
                          throws JRException,
                                 java.io.IOException

      Deprecated.
      Creates a datasource instance that reads XLS data from a given location.
      Parameters:
        `jasperReportsContext` - the JasperReportsContext
        `location` - a String representing XLS data source
      Throws:
        `java.io.IOException`
        `JRException`

    - #### JRXlsDataSource

          public JRXlsDataSource(java.lang.String location)
                          throws JRException,
                                 java.io.IOException

      Deprecated.
      Throws:
        `JRException`
        `java.io.IOException`
      See Also:
        `JRXlsDataSource(JasperReportsContext, String)`

  - ### Method Detail

    - #### next

          public boolean next()
                       throws JRException

      Deprecated.
      Description copied from interface: `JRDataSource`
      Tries to position the cursor on the next element in the data source.
      Returns:
        true if there is a next record, false otherwise
      Throws:
        `JRException` - if any error occurs while trying to move to the next element

    - #### moveFirst

          public void moveFirst()

      Deprecated.
      Description copied from interface: `JRRewindableDataSource`
      Moves back to the first element in the data source.

    - #### getFieldValue

          public java.lang.Object getFieldValue(JRField jrField)
                                         throws JRException

      Deprecated.
      Description copied from interface: `JRDataSource`
      Gets the field value for the current position.
      Returns:
        an object containing the field value. The object type must be the field object type.
      Throws:
        `JRException`

    - #### close

          public void close()

      Deprecated.
      Closes the reader. Users of this data source should close it after usage.
      Specified by:
        `close` in class `AbstractXlsDataSource`

    - #### checkReadStarted

          protected void checkReadStarted()

      Deprecated.
      Specified by:
        `checkReadStarted` in class `AbstractXlsDataSource`

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com