× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Kent,

Can't you put in the logic

Loop until EOF
A) Read a record,
B) If detail record - output previous accumulated comments (if any)
then parse detail to spreadsheet
C) If comment record accumulate comment records
End Loop
D) Output any remaining comments


John


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Hohlen, Kent
Sent: Friday, September 18, 2009 5:13 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Can I modify an existing Excel cell before saving spreadsheet

I am modifying a program that converts a spool file to a spreadsheet. I
added multiple lines of comments to the report and now I am trying to
get the comments on the spreadsheet. If the comments are for the same
detail line, then the user wants all those comments in the same cell.
We read one line from the report and determine what kind of line it is
on the report and then create the cell or a new row.



The report looks sort of like this



Page Headings

Selection Criteria

Column headings

Detail Line

Comment

Comment



Detail line

Comment



And so on...



The program's logic goes sort of like this.



If this is a detail line, break each column into a cell.

If this is a comment line, put comment into next cell after last column
cell.



If a second comment line is read, I would like to append what is in the
cell with the comment line just read. Can I use the following
procedures to get an existing cell and update it?



// Do this to get the cell object and get the cell's value.

Cell = HSSFRow_GetCell( Rw : CellNumber ) - to get the comment cell

String = String_getBytes( HSSFCell_getStringCellValue( Cell ) - get the
string in the cell



// build new string here.



// Update the ccell

NewString = Create_String( String ) - convert the new string to a java
string

HSSFCell_setCellValueStr( Cell : NewString ) - update the cell with the
new string





I am trying to update a cell in a spreadsheet before the book has been
saved. Is this possible? The JVM fails at String = String_getBytes(
HSSFCell_getStringCellValue( Cell ). When I put it into debug Cell = 0.
Cell is defined like HSSFCell. I don't have all the error messages in
the job log when it fails right now, but the one that sticks out is the
"pointer not set" error. It almost looks to me like it can't find the
cell and fails.



Any help would be greatly appreciated.



Thanks,



Kent Hohlen


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.