Class StiDataSource

java.lang.Object
com.stimulsoft.base.serializing.StiSerializedObject
com.stimulsoft.report.dictionary.dataSources.StiDataSource
All Implemented Interfaces:
IStiJsonReportObject, IStiSerializable, IStiSerializableRef, IStiName, IStiEnumerator, ICloneable, IStiAlias, IStiInherited, IStiStateSaveRestore, Cloneable
Direct Known Subclasses:
StiDataSourceEmpty, StiDataStoreSource

  • Field Details

  • Constructor Details

    • StiDataSource

      public StiDataSource()
    • StiDataSource

      public StiDataSource(String name, String alias)
      Creates a new Data Source.
      Parameters:
      name - Data Source name.
      alias - Data Source alias.
  • Method Details

    • getKey

      public String getKey()
      Returns:
      the key
    • setKey

      public void setKey(String key)
      Parameters:
      key - the key to set
    • getInherited

      public final boolean getInherited()
      Specified by:
      getInherited in interface IStiInherited
    • setInherited

      public final void setInherited(boolean value)
      Specified by:
      setInherited in interface IStiInherited
    • getDatabaseClass

      public abstract Class<? extends StiDatabase> getDatabaseClass()
    • getName

      public final String getName()
      Gets or sets of the Data Source name.
      Specified by:
      getName in interface IStiName
    • setName

      public final void setName(String value)
      Specified by:
      setName in interface IStiName
    • setCorrectName

      public void setCorrectName(String correctName)
    • getPosition

      public int getPosition()
      Gets the current position.
      Specified by:
      getPosition in interface IStiEnumerator
    • setPosition

      public void setPosition(int value)
      Specified by:
      setPosition in interface IStiEnumerator
    • getRealCount

      public final int getRealCount()
    • getCount

      public final int getCount()
      Gets count of elements.
      Specified by:
      getCount in interface IStiEnumerator
    • getIsBof

      public boolean getIsBof()
      Gets value indicates that this position specifies to the beginning of data.
      Specified by:
      getIsBof in interface IStiEnumerator
    • setIsBof

      public void setIsBof(boolean value)
      Specified by:
      setIsBof in interface IStiEnumerator
    • getIsEof

      public boolean getIsEof()
      Gets value indicates that this position specifies to the data end.
      Specified by:
      getIsEof in interface IStiEnumerator
    • setIsEof

      public void setIsEof(boolean value)
      Specified by:
      setIsEof in interface IStiEnumerator
    • getIsEmpty

      public boolean getIsEmpty()
      Gets value indicates that no data.
      Specified by:
      getIsEmpty in interface IStiEnumerator
    • First

      public void First()
      Sets a position at the beginning.
      Specified by:
      First in interface IStiEnumerator
    • Prior

      public void Prior()
      Sets a position on the previous element.
      Specified by:
      Prior in interface IStiEnumerator
    • Next

      public void Next()
      Sets a position on the next element.
      Specified by:
      Next in interface IStiEnumerator
    • Last

      public void Last()
      Sets a position on the last element.
      Specified by:
      Last in interface IStiEnumerator
    • getStates

      protected final StiStatesManager getStates()
      Gets the component states manager.
    • saveState

      public void saveState(String stateName)
      Saves the current state of an object.
      Specified by:
      saveState in interface IStiStateSaveRestore
      Parameters:
      stateName - A name of the state being saved.
    • ClearAllStates

      public void ClearAllStates()
      Clear all earlier saved object states.
    • SetData

      public final void SetData(StiDataBand dataBand, String relationName, Object filterMethod, ArrayList<String> sortColumns, boolean reinit, StiComponent component)
    • GetConditions

      public final Object[][][] GetConditions(StiDataBand dataBand)
    • SetDetails

      public final void SetDetails(String relationName)
      Set the details data for Data Source.
      Parameters:
      relationName - Relation to find Parent of the Data Source.
    • getRelations

      public StiDataRelation getRelations(String relationName)
    • SetFilter

      public final void SetFilter(Object filterMethod)
      Apply filter to data.
      Parameters:
      filterMethod -
    • SetSort

      public final void SetSort(Object[][][] conditions, ArrayList<String> sortColumns, StiComponent component, StiDataBand databand, ArrayList<StiGroupHeaderBand> groupHeaders)
      Sorts data. If data source is not able to sort data then this command is ignored.
      Parameters:
      sortColumns - Array with group conditions. 0 dimension - data rows, 1 dimension - group condition, 2 dimension - sort direction
      columns - Parameters of sorting. Example: new string[] {"ASC", "Company", "DESC", "ParentRelation", "DATE"}
    • ResetDetailsRows

      public final void ResetDetailsRows()
    • ResetData

      public final void ResetData()
    • GetDataRow

      public final DataRow GetDataRow(int index)
    • GetParentData

      public final StiDataRow GetParentData(String relationName)
      Returns the parent row with data for the indicated relation.
      Parameters:
      relationName - Relation name.
      Returns:
      Relation string.
    • GetParentRelations

      public StiDataRelationsCollection GetParentRelations()
      Returns the colection of Parent relations.
      Returns:
      Collection.
    • fetchParentRelations

      public List<StiDataRelation> fetchParentRelations(boolean activePreferred)
    • GetChildRelations

      public StiDataRelationsCollection GetChildRelations()
      Returns a collection of Child relations.
      Returns:
      Collection.
    • GetParentDataSource

      public StiDataSource GetParentDataSource(String relationName)
      Returns the parent Data Source by the relation name.
      Parameters:
      relationName - Relation name.
      Returns:
      Data Source.
    • GetChildDataSource

      public StiDataSource GetChildDataSource(String relationName)
      Returns the child Data Source by the relation name.
      Parameters:
      relationName - Relation name.
      Returns:
      Data Source.
    • prepareData

      public void prepareData()
    • InvokeConnecting

      protected final void InvokeConnecting()
    • InvokeDisconnecting

      protected final void InvokeDisconnecting()
    • getDatabase

      protected StiDatabase getDatabase()
    • disconnect

      public void disconnect()
    • getIsConnected

      public final boolean getIsConnected()
      Gets value indicates which Data Source is connected with data.
    • getParameters

      public StiDataParametersCollection getParameters()
      Gets or sets the parameter collection.
    • setParameters

      public void setParameters(StiDataParametersCollection value)
    • getItem

      public Object getItem(String columnName)
      Indexer to work with the current row of data. Returns the value by the column name and the current position in the Data Source. Indexer calls the method GetData. ColumnName - name of column.
    • GetData

      public final Object GetData(String columnName)
      Returns the value by the column name and the current position in the Data Source.
      Parameters:
      columnName - Column name.
      Returns:
      Value.
    • GetData

      public final Object GetData(String columnName, int rowIndex)
      Returns the value by the column name and index of row in the Data Source.
      Parameters:
      columnName - Column name.
      rowIndex - Index of row in the Data Source.
      Returns:
      Value.
    • GetColumnIndex

      public final int GetColumnIndex(String columnName)
      Returns the index of a column in the data source.
      Parameters:
      columnName - Column name.
      Returns:
      Index.
    • getRows

      public final StiRowsCollection getRows()
      Gets or sets rows collection.
    • setRows

      public final void setRows(StiRowsCollection value)
    • CheckColumnsIndexs

      public final void CheckColumnsIndexs()
      Internal use only.
    • toString

      public String toString()
      Returns the text view of the Data Source.
      Overrides:
      toString in class Object
      Returns:
    • GetLevel

      public final int GetLevel()
      Returns level of data in hierarchical band.
      Returns:
    • GetCategoryName

      public String GetCategoryName()
      Returns the name to categories of the Data Source.
    • getConnectOnStart

      public boolean getConnectOnStart()
      Gets or sets value which indicates that datasource not connect to the data automatically.
    • setConnectOnStart

      public void setConnectOnStart(boolean value)
    • getDataTable

      public final DataTable getDataTable()
      Gets DataTable.
    • connect

      public abstract void connect() throws StiException
      Throws:
      StiException
    • connect

      public abstract void connect(Boolean fillTable) throws StiException
      Throws:
      StiException
    • setDataTable

      public final void setDataTable(DataTable value)
    • getDictionary

      public final StiDictionary getDictionary()
      Gets or sets the dictionary in which this Data Source is located.
    • setDictionary

      public final void setDictionary(StiDictionary value)
    • getAlias

      public final String getAlias()
      Gets or sets of the Data Source alias.
      Specified by:
      getAlias in interface IStiAlias
    • setAlias

      public final void setAlias(String value)
      Specified by:
      setAlias in interface IStiAlias
    • getColumns

      public StiDataColumnsCollection getColumns()
      Gets or sets the column collection.
    • setColumns

      public void setColumns(StiDataColumnsCollection value)
    • getData

      public Object getData(String columnName, int rowIndex)
    • restoreState

      public void restoreState(String stateName)
      Description copied from interface: IStiStateSaveRestore
      Restores the earlier saved object state.
      Specified by:
      restoreState in interface IStiStateSaveRestore
      Parameters:
      stateName - A name of the state being restored.
    • RestoreState

      public void RestoreState(String stateName)
      Restores the earlier saved object state.
      Parameters:
      stateName - A name of the state being restored.
    • clearAllStates

      public void clearAllStates()
      Description copied from interface: IStiStateSaveRestore
      Clear all states.
      Specified by:
      clearAllStates in interface IStiStateSaveRestore
    • isEmpty

      public boolean isEmpty()
    • get

      public Object get(String columnName)
    • setPositionValue

      public void setPositionValue(int positionValue)
    • getPositionValue

      public int getPositionValue()
    • size

      public int size()
    • clone

      public Object clone()
      Specified by:
      clone in interface ICloneable
      Overrides:
      clone in class Object
    • SaveToJsonObject

      public JSONObject SaveToJsonObject(StiJsonSaveMode mode) throws JSONException
      Specified by:
      SaveToJsonObject in interface IStiJsonReportObject
      Throws:
      JSONException
    • LoadFromJsonObject

      public void LoadFromJsonObject(JSONObject jObject) throws JSONException
      Specified by:
      LoadFromJsonObject in interface IStiJsonReportObject
      Throws:
      JSONException
    • getVariableParameters

      public List<StiDataParameter> getVariableParameters()
      Returns:
      the variableParameters
    • setVariableParameters

      public void setVariableParameters(List<StiDataParameter> variableParameters)
      Parameters:
      variableParameters - the variableParameters to set
    • getVariableParameterByName

      public StiDataParameter getVariableParameterByName(String name)
    • get

      public Object get(int index)