GithubHelp home page GithubHelp logo

cy2_spreadsheet's Introduction

CY2 SpreadSheet

Read and write Excel spreadsheets from PeopleSoft.

This is a PeopleCode wrapper around Apache POI library that ships with PeopleSoft. Works with PeopleTools 8.55 or later.

The code is in a two files CY2_SPREADSHEET:Workbook.pcode and CY2_SPREADSHEET:StreamingWorkbook.pcode, or you can import the Application Designer package in the CY2_SPREADSHEET directory. Note: The StreamingWorkbork is only for creating Excel files (usually large ones), and the API is the same except the read methods have been removed. Feel free to change the application package name to suite your naming conventions, but please keep the copyright notice in the code.

Examples

Creating a spreadsheet

import CY2_SPREADSHEET:Workbook;

Local CY2_SPREADSHEET:Workbook &workbook = create CY2_SPREADSHEET:Workbook(&fullPath);
&workbook.SetCellString(1, 1, "test");
&workbook.SetCellNumber(1, 2, 1);
&workbook.SetCellNumber(1, 3, 2.2);
&workbook.SetCellNumberFormat(1, 4, 3.3, "00.000");
&workbook.SetCellFormula(2, 1, "=b1+c1");
&workbook.SetCellFormula(2, 2, "c1+d1");
....
&workbook.Save();

Reading data from a spreadsheet

import CY2_SPREADSHEET:Workbook;

Local CY2_SPREADSHEET:Workbook &workbook = create CY2_SPREADSHEET:Workbook(&fullPath);

Local string &string = &workbook.GetCellString(1, 1);

Local number &number;
Local boolean &success = &workbook.GetCellNumber(1, 2, &number);

Local boolean &boolean;
&success = &workbook.GetCellBoolean(2, 3, &boolean);

Local DateTime &datetime;
&success = &workbook.GetCellDateTime(4, 1, &datetime);

cy2_spreadsheet's People

Contributors

cuda avatar ernstlahaye avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cy2_spreadsheet's Issues

What version of POI class have you been testing with ?

I have POI version 3.17 and can't get the classes

136      11:17:48.335     0.000132        4:    Local JavaObject &workbookFactory = GetJavaClass("org.apache.poi.ss.usermodel.WorkbookFactory");
137      11:17:48.336     0.000133                Str[43]=org.apache.poi.ss.usermodel.Wo
138      11:17:52.721     4.385333 ErrorReturn-> 725 - Java Exception: java.lang.OutOfMemoryError: GC overhead limit exceeded: finding class PeopleSoft/PeopleCode/Func (2,725) CY2_SPREADSHEET.Workbook.OnExecute  Name:Workbook  PCPC:175  Statement:4

Version 3.17 does not include WorkbookFactory as far as I can see.

  • PeopleTools: 8.58
  • PeopleSoft Version: 9.2

Thanks; George

GetCellType not working within methods.

Hi;

Recently loaded this app package and it is working great. Except I just ran into an issue where the GetCellType that used to return a constant (ie. NUMERIC, STRING) know returns a CellType object. In this version the logic that compares a cell type fails with a TYPE issue. I was wondering if there is a newer version that works with the new POI version of javascript? I tried the suggested GetCellTypeEnum but it is also deprecated.

Scott

example from current version:
method GetCellNumber
/+ &row as Integer, +/
/+ &column as Integer, +/
/+ &value as Number out +/
/+ Returns Boolean +/
Local JavaObject &cell = %This.GetCell(&row, &column);
If &cell = Null Then
Return False;
End-If;

Local boolean &success = False;
Evaluate &cell.getCellType()
When &NumericCell

&value = &cell.getNumericCellValue();
&success = True;
Break;

When &StringCell
try
&value = Value(&cell.getStringCellValue());
&success = True;
catch Exception &exp

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.