public class GridJsWorkbook
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static GridCacheForStream |
CacheImp
Custom implemention for cache storage,If you want to store cache in stream way ,you need to set and implement it.
|
static GridAbstractCalculationEngine |
CalculateEngine
Custom implemention for calculation engine ,If you want to do custom calculation, you need to set and implement it.
|
static java.lang.String |
PICTURE_TYPE
const value for the type of the image
|
static GridUpdateMonitor |
UpdateMonitor
Gets/Sets the update monitor to track update operation
|
| Constructor and Description |
|---|
GridJsWorkbook() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkInCacheForCollaborative(java.lang.String uid)
Check wether workbook instance is in memory cache .this method is apply for Collaborative mode only.
|
java.lang.String |
copyImageOrShape(java.lang.String uid,
java.lang.String p)
Copys image or shape.
|
java.lang.String |
errorJson(java.lang.String msg)
Gets the error message string in JSON format.
|
java.lang.String |
exportToJson()
Gets JSON string from memory data, the default filename in the JSON is: book1.
|
java.lang.String |
exportToJson(java.lang.String filename)
Gets JSON string from memory data,set the output filename in the JSON.
|
java.lang.StringBuilder |
exportToJsonStringBuilder(java.lang.String filename)
Gets JSON string from memory data,set the output filename in the JSON.
|
static int |
getGridLoadFormat(java.lang.String extension)
Gets the load format by file extension
|
static java.io.InputStream |
getImageStream(java.lang.String uid,
java.lang.String picid)
Get Stream of image.
|
static java.lang.String |
getImageUrl(java.lang.String uid,
java.lang.String picid,
java.lang.String delimiter)
Gets the image URL.
|
java.lang.StringBuilder |
getJsonByUid(java.lang.String uid,
java.lang.String filename)
Gets the JSON string of the file from the cache using the specified unique id,set the output filename in the JSON.
|
byte[] |
getOle(java.lang.String uid,
java.lang.String sheetname,
int oleid,
java.lang.String label)
Gets the byte array data of the embedded ole object .
|
GridWorkbookSettings |
getSettings()
Represents the workbook settings.
|
static java.lang.String |
getUidForFile(java.lang.String fileName)
Generates a new unique id for the file cache using the given file name.
|
void |
importExcelFile(java.io.InputStream filestream,
int format)
Imports the excel file from file stream with load format.
|
void |
importExcelFile(java.io.InputStream filestream,
int format,
java.lang.String password)
Imports the excel file from file stream with load format and open password.
|
void |
importExcelFile(java.lang.String fileName)
Imports the excel file from the file path.
|
void |
importExcelFile(java.lang.String uid,
java.io.InputStream filestream,
int format)
Imports the excel file from file stream.
|
void |
importExcelFile(java.lang.String uid,
java.io.InputStream filestream,
int format,
java.lang.String password)
Imports the excel file from file stream with load format and open password.
|
void |
importExcelFile(java.lang.String uid,
java.lang.String fileName)
Imports the excel file from the file path.
|
void |
importExcelFile(java.lang.String uid,
java.lang.String fileName,
java.lang.String password)
Imports the excel file from file path and open password.
|
void |
importExcelFileFromJson(java.lang.String json)
Imports the excel file from JSON format string.
|
java.lang.String |
insertImage(java.lang.String uid,
java.lang.String p,
java.io.InputStream s,
java.lang.String imageUrl)
Inserts image in the worksheet from file stream or the URL,(either the file stream or the URL shall be provided)
or
Inserts shape ,when the p.type is one of AutoShapeType
|
void |
jsonToStream(java.io.OutputStream stream,
java.lang.String filename)
Retrieve the JSON string from memory data,set the output filename in the JSON, and write it to the stream.
|
boolean |
jsonToStreamByUid(java.io.OutputStream stream,
java.lang.String uid,
java.lang.String filename)
Retrieve the JSON string of the file from the cache using the specified unique id,set the output filename in the JSON,and write it to the stream.
|
java.lang.StringBuilder |
lazyLoadingJson(java.lang.String uid,
java.lang.String sheetName)
Gets the JSON string of the specified sheet in the file from the cache using the specified unique id.
|
void |
lazyLoadingStream(java.io.OutputStream stream,
java.lang.String uid,
java.lang.String sheetName)
Retrieve the JSON string of the specified sheet in the file from the cache using the specified unique id, and write it to the stream.
|
void |
mergeExcelFileFromJson(java.lang.String uid,
java.lang.String json)
Applies a batch update to the memory data.
|
void |
saveToCacheWithFileName(java.lang.String uid,
java.lang.String filename,
java.lang.String password)
Saves the memory data to the cache file with the specified filename and also set the open password, the save format is baseed on the file extension of the filename .
|
void |
saveToExcelFile(java.io.OutputStream stream)
Saves the memory data to the sream, baseed on the origin file format.
|
void |
saveToExcelFile(java.lang.String path)
Saves the memory data to the file path,if the file has extension ,save format is baseed on the file extension .
|
void |
saveToHtml(java.io.OutputStream stream)
Saves the memory data to the sream,the save format is html
|
void |
saveToHtml(java.lang.String path)
Saves the memory data to the file path,the save format is html.
|
void |
saveToPdf(java.io.OutputStream stream)
Saves the memory data to the sream,the save format is pdf.
|
void |
saveToPdf(java.lang.String path)
Saves the memory data to the file path,the save format is pdf.
|
void |
saveToXlsx(java.io.OutputStream stream)
Saves the memory data to the sream,the save format is xlsx.
|
void |
saveToXlsx(java.lang.String path)
Saves the memory data to the file path,the save format is xlsx.
|
static void |
setImageUrlBase(java.lang.String baseImageURL)
Set the base image get action URL from controller .
|
void |
setInterruptMonitorForLoad(GridInterruptMonitor monitor,
int calculateTimeoutMilliseconds)
Sets InterruptMonitor for load operation.
|
void |
setInterruptMonitorForSave(GridInterruptMonitor monitor)
Sets InterruptMonitor for save operation.
|
void |
setSettings(GridWorkbookSettings value)
Represents the workbook settings.
|
java.lang.String |
updateCell(java.lang.String p,
java.lang.String uid)
Applies the update operation.
|
public static GridCacheForStream CacheImp
public static GridAbstractCalculationEngine CalculateEngine
public static GridUpdateMonitor UpdateMonitor
public static final java.lang.String PICTURE_TYPE
public GridWorkbookSettings getSettings()
public void setSettings(GridWorkbookSettings value)
public void setInterruptMonitorForLoad(GridInterruptMonitor monitor, int calculateTimeoutMilliseconds)
monitor - The InterruptMonitor instance.calculateTimeoutMilliseconds - The time out in millisecond for load file.public void setInterruptMonitorForSave(GridInterruptMonitor monitor)
monitor - The InterruptMonitor instance.public java.lang.StringBuilder getJsonByUid(java.lang.String uid,
java.lang.String filename)
uid - The unique id for the file cache.filename - Specifies the file name in the JSON. If set to null,the default filename is: book1.public boolean jsonToStreamByUid(java.io.OutputStream stream,
java.lang.String uid,
java.lang.String filename)
stream - The stream that will be writtenuid - The unique id for the file cache.filename - Specifies the file name in the JSON. If set to null,the default filename is: book1.public void jsonToStream(java.io.OutputStream stream,
java.lang.String filename)
stream - The stream that will be writtenfilename - Specifies the file name in the JSON. If set to null,the default filename is: book1.public void lazyLoadingStream(java.io.OutputStream stream,
java.lang.String uid,
java.lang.String sheetName)
stream - The stream that will be writtenuid - The unique id for the file cache.sheetName - the sheet name.public java.lang.StringBuilder lazyLoadingJson(java.lang.String uid,
java.lang.String sheetName)
uid - The unique id for the file cache.sheetName - the sheet name.public void importExcelFile(java.lang.String uid,
java.lang.String fileName,
java.lang.String password)
uid - The unique id for the file cache, if set to null,it will be generated automatically.fileName - The full path of the file.password - The open password of the excel file.The value can be null If no passowrd is set.public void importExcelFile(java.lang.String uid,
java.lang.String fileName)
uid - The unique id for the file cache, if set to null,it will be generated automatically.fileName - The full path of the file.public void importExcelFile(java.lang.String fileName)
fileName - The full path of the file.public static java.lang.String getUidForFile(java.lang.String fileName)
fileName - The file name.public void importExcelFile(java.lang.String uid,
java.io.InputStream filestream,
int format,
java.lang.String password)
uid - The unique id for the file cache, if set to null,it will be generated automatically.filestream - The stream of the excel file .format - GridLoadFormat. The LoadFormat of the excel file.password - The open password of the excel file.The value can be null If no passowrd is setpublic void importExcelFile(java.lang.String uid,
java.io.InputStream filestream,
int format)
uid - The unique id for the file cache, if set to null,it will be generated automatically.filestream - The stream of the excel file .format - GridLoadFormat. The LoadFormat of the excel file.public void importExcelFile(java.io.InputStream filestream,
int format,
java.lang.String password)
filestream - The stream of the excel file .format - GridLoadFormat. The LoadFormat of the excel file.password - The open password of the excel file.The value can be null If no passowrd is set.public void importExcelFile(java.io.InputStream filestream,
int format)
filestream - The stream of the excel file .format - GridLoadFormat. The LoadFormat of the excel file.public void importExcelFileFromJson(java.lang.String json)
json - The JSON format string.public void mergeExcelFileFromJson(java.lang.String uid,
java.lang.String json)
uid - The unique id for the file cache.json - The update JSON format string.public java.lang.String exportToJson(java.lang.String filename)
filename - Specifies the file name in the JSON. If set to null,the default filename is: book1..public java.lang.String exportToJson()
public java.lang.StringBuilder exportToJsonStringBuilder(java.lang.String filename)
filename - Specifies the file name in the JSON. If set to null,the default filename is: book1..public void saveToExcelFile(java.io.OutputStream stream)
stream - The stream to save.public void saveToExcelFile(java.lang.String path)
path - The file path to save.public void saveToCacheWithFileName(java.lang.String uid,
java.lang.String filename,
java.lang.String password)
uid - The unique id for the file cache.filename - The filename to save.password - The excel file's open password. The value can be null If no passowrd is set.public void saveToPdf(java.lang.String path)
path - The file path to save.public void saveToXlsx(java.lang.String path)
path - The file path to save.public void saveToHtml(java.lang.String path)
path - The file path to save.public void saveToPdf(java.io.OutputStream stream)
stream - The stream to save.public void saveToXlsx(java.io.OutputStream stream)
stream - The stream to save.public void saveToHtml(java.io.OutputStream stream)
stream - The stream to save.public static java.io.InputStream getImageStream(java.lang.String uid,
java.lang.String picid)
uid - The unique id for the file cache.picid - The image id.public byte[] getOle(java.lang.String uid,
java.lang.String sheetname,
int oleid,
java.lang.String label)
uid - The unique id for the file cache.sheetname - The worksheet name.oleid - The id for the embedded ole object.label - The display label of the embedded ole object.public boolean checkInCacheForCollaborative(java.lang.String uid)
uid - public java.lang.String updateCell(java.lang.String p,
java.lang.String uid)
p - The JSON format string of update operation.uid - The unique id for the file cache.public java.lang.String insertImage(java.lang.String uid,
java.lang.String p,
java.io.InputStream s,
java.lang.String imageUrl)
uid - The unique id for the file cachep - The JSON format string for the operation which specify the cell location ,the worksheet name,upper left row,upper left column for the image锛宔tc {name:'sheet1',ri:1,ci:1}s - The file stream of the image fileimageUrl - The URL of the image filepublic java.lang.String copyImageOrShape(java.lang.String uid,
java.lang.String p)
uid - The unique id for the file cache.p - The JSON string for the operation which specify the cell location ,it contains the worksheet name,upper left row,upper left column for the image or shape锛宔tc {name:'sheet1',ri:1,ci:1,srcid:2,srcname:'sheet2',isshape:true}public java.lang.String errorJson(java.lang.String msg)
msg - The error message.public static int getGridLoadFormat(java.lang.String extension)
extension - The file extention ,usually start with '.' .GridLoadFormat.public static java.lang.String getImageUrl(java.lang.String uid,
java.lang.String picid,
java.lang.String delimiter)
uid - The unique id for the file cache.picid - The image id.delimiter - The string delimiter.public static void setImageUrlBase(java.lang.String baseImageURL)
Remarks
when CacheImp is null,we need to set this .
baseImageURL - the base image get action URL.See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.