Hello Community!
I need help with my code to create an excel file output with more than one table.
Take a look on my piece of code:
// ************************************************************************************************
var num = Context.getSelectedLanguage();
var oFile= Context.createOutputObject();
var c_nBlue = new java.awt.Color(0.5, 0.6, 0.9).getRGB();
var c_nGreen = new java.awt.Color(0.5, 0.9, 0.7).getRGB();
var c_nRed = new java.awt.Color(1, 0.3, 0.4).getRGB();
var c_nYellow = new java.awt.Color(1, 0.7, 0).getRGB();
oFile.DefineF("HEAD", getString("TEXT_1"), 10, Constants.C_BLACK, c_nGreen, Constants.FMT_BOLD | Constants.FMT_CENTER | Constants.FMT_VCENTER, 0, 0, 0, 0, 0, 1);
oFile.DefineF("HEAD2", getString("TEXT_1"), 10, Constants.C_BLACK, c_nBlue, Constants.FMT_CENTER | Constants.FMT_VCENTER, 0, 0, 0, 0, 0, 1);
oFile.DefineF("FORM", getString("TEXT_1"), 10, Constants.C_BLACK, c_nYellow, Constants.FMT_CENTER | Constants.FMT_VCENTER, 0, 0, 0, 0, 0, 1);
oFile.DefineF("CELL", getString("TEXT_1"), 10, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_CENTER | Constants.FMT_VCENTER, 0, 0, 0, 0, 0, 1);
main();
function main(){
var aSelModels = ArisData.getSelectedModels();
if(aSelModels.length != 0){
oModel = aSelModels[0];
oFile.BeginTable(100, Constants.C_BLACK, Constants.C_WHITE, Constants.FMT_LEFT, 0); // In Excel output format, this creates a new worksheet.
oFile.TableRow();
oFile.TableCellF("Funcion", 30, "HEAD");
oFile.TableCellF("Funcion", 30, "HEAD");
}
oFile.WriteReport();
}
// ************************************************************************************************
This creates an excel file with only one table "Table 1" (img_Actual_Output)
My question is, how can I have more tables (sheets)? (img_Desired_Output) - If you guys can tell me the functions will be great!
Also, the main function to add a model image to my excel... I tried aris help but without success xD
Thanks in advance!!
Regards,
Dilcarina
Michael Wieczorek on
Hello,
you can create multiple tables via
oFile.BeginTable(...)
....
oFile.EndTable(...)
oFile.BeginTable(...)
...
oFile.EndTable(...)
...
BR, Michael