Great Day :-)
by using begin table method how to export model into image.not by using worksheet.please share some code snippet, it will be great helpfull for me.
Well, if you do not want to use the worksheet functionality, you just create a standard picture.
oOutFile.TableRow();
oOutFile.TableCellF("", 1, 1, sStyle);
oPicture = oModel.Graphic(false, false, g_nLoc);
oOutFile.OutGraphic(oPicture, lZoomFactor, g_oOutFile.getCurrentMaxWidth(), g_oOutFile.GetPageHeight() - oOutFile.GetTopMargin() - g_oOutFile.GetBottomMargin() - lReduceHeight)
Hi Robert,
Thnx for your prompt response .
i used the below code for your referance still facing issue, empty sheet
var g_nLoc = Context.getSelectedLanguage(); var File = Context.createOutputObject(); File.BeginTable(100,Constants.C_BLACK,Constants.C_WHITE,Constants.FMT_LEFT | Constants.FMT_ITALIC,0); File.TableRow(); File.TableCellF("", 1, 1, "sStyle"); var oModel = ArisData.getSelectedModels()[0]; oPicture = oModel.Graphic(false, false, g_nLoc); File.OutGraphic(oPicture, 100, File.getCurrentMaxWidth(), File.GetPageHeight() - File.GetTopMargin() - File.GetBottomMargin() - 15)
Hi
I'm trying to do the same as the above but the graphic is not being exported as expected. Does someone have any tips?
Thanks
Marcus
Code:
var g_nLoc = Context.getSelectedLanguage();
xlsOutObj = Context.createOutputObject(Constants.OutputXLS, "excel.xls");
xlsOutObj.DefineF("Section", "Arial", 12, Constants.C_BLACK, Constants.C_LIGHT_TURQUOISE, Constants.FMT_BOLD|Constants.FMT_JUSTIFY|Constants.FMT_VTOP|Constants.FMT_EXCELMODIFY, 1, 0, 0, 0, 0, 0);
xlsOutObj.DefineF("Title", "Arial", 9, Constants.C_BLACK, Constants.C_LIGHT_BLUE, Constants.FMT_BOLD|Constants.FMT_LEFT|Constants.FMT_VTOP|Constants.FMT_EXCELMODIFY, 1, 0, 0, 0, 0, 0);
xlsOutObj.DefineF("Text", "Arial", 9, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_LEFT|Constants.FMT_VTOP|Constants.FMT_EXCELMODIFY, 1, 0, 0, 0, 0, 0);
xlsOutObj.BeginTable(100, Constants.C_BLACK, Constants.C_WHITE, Constants.FMT_LEFT | Constants.FMT_ITALIC,0);
for(j = 0; j < objArray.length; j++){
xlsOutObj.TableRow();
xlsOutObj.TableCellF(objArray[j].Name(-1), 100, "Section");
xlsOutObj.TableRow();
xlsOutObj.TableCellF(" ", 100, "Text");
xlsOutObj.TableRow();
var modelArray = objArray[j].AssignedModels(new Array(Constants.MT_BPMN_ALLOC_DIAGR, Constants.MT_BPMN_ALLOCATION_DIAGRAM, Constants.MT_BPMN_COLLABORATION_DIAGRAM, Constants.MT_BPMN_CONVERSATION_DIAGRAM, Constants.MT_BPD_BPMN, Constants.MT_BPMN_PROCESS_DIAGRAM, Constants.MT_ENTERPRISE_BPMN_COLLABORATION, Constants.MT_ENTERPRISE_BPMN_PROCESS, Constants.MT_FUNC_ALLOC_DGM, Constants.MT_VAL_ADD_CHN_DGM));
for(m = 0; m < modelArray.length; m++){
xlsOutObj.TableCellF(modelArray[m].Attribute(Constants.AT_NAME, g_nLoc).GetValue(false), 100, "Title");
xlsOutObj.TableRow();
xlsOutObj.TableCellF(" ", 100, "Text");
xlsOutObj.TableRow();
xlsOutObj.TableCellF("===================================================================", 100, "Text");
xlsOutObj.TableRow();
var iModel = modelArray[m].Graphic(false, false, g_nLoc)
xlsOutObj.OutGraphic(iModel, 100, xlsOutObj.getCurrentMaxWidth(), (xlsOutObj.GetPageHeight() - xlsOutObj.GetTopMargin() - xlsOutObj.GetBottomMargin() - 20));
xlsOutObj.TableRow();
xlsOutObj.TableCellF("===================================================================", 100, "Text");
xlsOutObj.TableRow();
}
}
xlsOutObj.EndTable(tableName, 100, "Arial",10, Constants.C_BLACK, Constants.C_BLACK,0, Constants.FMT_LEFT | Constants.FMT_ITALIC,0);
xlsOutObj.WriteReport();
Context.addOutputFileName("excel.xls");