Spreadsheet Management How To's

From Pengower
Jump to: navigation, search

Occasionally there is need to create or manipulate a spreadsheet at such a level that it is outside the scope of .csv. The following functionality allows for the creation and manipulation of a spreadsheet that is compatible with Microsoft Excel

Do Run Module Commands

Spreadsheet management is handled using Do Run Module calls, the syntax and use of these calls are listed below.

Set_Spreadsheet

Purpose:

  • Sets the spreadsheet and adds it to the cache. If the specified path points to a existing file, this action will load the data into the spreadsheet (unformatted)

Parameters:

  • file location - location of the spreadsheet to be loaded

Returns:

  • 'Ok'


Clear_Spreadsheet

Purpose:

  • Clears the spreadsheet from the cache

Parameters:

  • none

Returns:


Save_Spreadsheet

Purpose:

  • saves the spreadsheet to the path provided

Parameters:

  • filelocation - path to where the spreadsheet should be stored

Returns:

  • 'Ok'


Spreadsheet_Values

Purpose:

  • Gets the values for a range of cells

Parameters:

  • row - row number
  • fromcol - starting column number
  • tocol - ending column number
  • types - array of types (one item for each column included in the range)
    • number/numeric
    • string/text
    • date/datetime

Returns:

  • String containing the values


Spreadsheet_HasValue

Purpose:

  • Check if the specified cell contains a value

Parameters:

  • row - row number
  • col - column number

Returns:

  • 'Yes' if contains value or 'No' if not


Spreadsheet_Value

Purpose:

  • Gets the value of the specified cell

Parameters:

  • row - row number
  • col - column number
  • type - type expected:
    • number/numeric
    • string/text
    • date/datetime

Returns:

  • Value of cell as a String


Spreadsheet_SetValue

Purpose:

  • Set the value of a cell

Parameters:

  • row - row number
  • col - column number
  • type - type of value:
    • number/numeric
    • string/text
    • date/datetime
  • value - value to be set

Returns:

  • 'Ok'


Open_Spreadsheet_In_Template

Purpose:

  • Opens csv file in preset template and saves as a .xls or .xlsx file

Parameters:

  • template - path to template
  • input - path to input file
  • output - path to where to store output file

Returns:

  • 'Ok'