0

ZK Spreadsheet

asked 2009-02-01 10:33:47 +0800

syamat gravatar image syamat
21 1

Is it possible to have an api to get the last cell (with value) using ZK Spreadsheet.

delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2009-02-02 06:45:36 +0800

kindalu gravatar image kindalu
255

Currently, there is no such api.
And it sounds pretty reasonable to have it, not hard to implement also.
Please post it to feature request.
(http://sourceforge.net/projects/zss/)

link publish delete flag offensive edit

answered 2009-02-04 09:01:41 +0800

kindalu gravatar image kindalu
255

updated 2009-02-04 09:05:25 +0800

btw, you may want to try this
int rowSize = ((SheetImpl)sheet).getMaxRowIndex();
int colSize = ((SheetImpl)sheet).getMaxColumnIndex();
this will give you the last cell been edited or with value

link publish delete flag offensive edit

answered 2009-02-09 12:35:46 +0800

syamat gravatar image syamat
21 1

There is a compile error id u use ((SheetImpl)sheet).getMaxRowIndex();, it says no such method getMaxRowIndex() in SheetImpl

link publish delete flag offensive edit

answered 2009-02-09 12:41:18 +0800

syamat gravatar image syamat
21 1

Need some help in reloading the date in tab, the content is an excel sheet whose value comes from mysql db, whenever there is an update in db the data has to be loaded again from the db to the excel sheet when the respective tab is clicked.

link publish delete flag offensive edit

answered 2009-02-11 03:33:44 +0800

kindalu gravatar image kindalu
255

updated 2009-02-11 03:43:10 +0800

sorry for that wrong information...
That function will be release for next version.
(I'm using it now and it was implemented by another man, so I thought it was released in previous version)

The reason of invaildate() won't work here is we check the filename and selected sheet name.
If they're both unchanged, it will not reload data.

One way to do the db update is keeping a boolean field like "isModified" in database.
So you could select the modified data from db and update current spreadsheet when tab is clicked.

Another way you have to add a function in the spreadsheet.java like this function

	public void setBookFromStream(InputStream is, String src){
		_selectedSheet=null;
		_selectedSheetId=null;
		setRowfreeze(-1);
		setColumnfreeze(-1);
		_importer = new ExcelImporter();
		_src=src;
		_book = ((ExcelImporter)_importer).importFromStream(is, src);
		_book.addSSDataListener(_dataListener);
		_book.addVariableResolver(_variableResolver);
		_book.addFunctionMapper(_functionMapper);
	}

Then call from application with
spreadsheet.setBookFromStream(iStream, src);
spreadsheet.setSelectedSheet(sheetTB.getSelectedTab().getLabel());

key is "_selectedSheet=null;" & "_selectedSheetId=null;"

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-02-01 10:33:47 +0800

Seen: 264 times

Last updated: Feb 11 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More