To retrieve data from an Essbase database, either for reporting or for subsequent updating, your program needs to use a report specification. Report specifications can be in the form of a single text string (if it is less than 32 KB in length), a series of text strings, or a file. Report files can reside either on the client machine, or on the Essbase Server.
Sending a report specification as a single string—To send a report specification as a single string, have the program call EssReport() passing the entire report string, not greater than 32 KB long, as an argument. If the Output flag is set to TRUE in the call to EssReport(), the program must also read the returned report data by calling EssGetString() repeatedly until a NULL string is returned. The returned data can then be displayed, written to a file, or printed, as required.
Sending a report specification as a series of strings—To send a report specification as a series of strings, first call EssBeginReport(), then call EssSendString() repeatedly to send each string in the report specification (note that in Windows, each individual string must not be greater than 32 KB long). Finally, terminate the report specification by calling EssEndReport(). If the Output flag is set to TRUE in the call to EssBeginReport(). The program must also read the returned report data by calling EssGetString() repeatedly until a NULL string is returned. The returned data can then be displayed, written to a file, or printed, as required.
Sending a file as a report specification—To send a file as a report specification, use the EssReportFile() function, passing the report file name. If the Output flag is set to TRUE in the call to EssReportFile(), the program must also read the returned report data by calling EssGetString() repeatedly until a NULL string is returned. The returned data can then be displayed, written to a file, or printed, as required.
To update data in the database, you should first lock the blocks in the database which you are going to update.
To lock database blocks, select one method:
Send a report specification as described above, with the Output flag set to TRUE and Lock flag also set to TRUE. The data output by this report can be modified, then sent back to the database as an update.
Alternatively, if there is new or modified data ready to be loaded, a program can first use it as a report specification to lock the data blocks by setting the Output flag to FALSE and setting the Lock flag to TRUE when calling the appropriate report function.
The database can be updated either from a single string, a series of strings, or a file. Update data files can reside either on the client machine, or on the Essbase Server:
Sending update data as a single string—To send an update as a single string, call EssUpdate() passing the entire string as an argument. (Note that in MS-Windows, the string must not be greater than 32 KB long). Set the Store flag to TRUE in the call to EssUpdate() so that the database will be updated. If the Unlock flag is also set to TRUE, any locked data blocks in the database will be unlocked once the data is updated, to allow other users to update those blocks.
Sending update data as a series of strings—To send an update as a series of strings, first call EssBeginUpdate(), then call EssSendString() repeatedly to send all the data (note that in MS-Windows, each individual data string must not be greater than 32 KB long). Finally, terminate the update by calling EssEndUpdate(). Set the Store flag to TRUE in the call to EssUpdate() so that the database will be updated. If the Unlock flag is also set to TRUE, any locked data blocks in the database will be unlocked once the data is updated.
Sending update data as a file—To send an update as a file, use the EssUpdateFile() function, passing the data file name. Set the Store flag to TRUE in the call to EssUpdate() so that the database will be updated. If the Unlock flag is also set to TRUE, any locked data blocks in the database will be unlocked once the data is updated.