Hi, I am a new user and new to report writing so I apologise for what is probably a silly question. I have searched for the answer for quite a while but am struggling to find it and I know the answer I want would be in the cost time analysis report but am unsure how to view the code for that.
Anyway I am developing my report writing bilities in ARIS and having a lot of success extracting and presenting data from models using ARIS script by following and modifying the very helpful tutorials on this website.
The one thing I am failing to do is work out how to output a formula into an excel sheet so it is read as a formula and not a string of text. All I really want to do is put a sum formula into the bottom of a column.
How can I achieve this? My script works fine and im getting the correct formula in the correct cell but I don't know how to instruct excel to read it correctly from within my script.
Thanks in advace for your help.
Hi,
You have to write your formula in a string like that : var formula = "SUM(" + col + row +":" + col2 + row2 + ")"; your string formula will be instanciate with this value for exeample : "SUM(A2:B5)" and you have to put this formula in your cell : sheet.cell( curRow, curCol ).setCellFormula( formula ); //DO NOT WRITE THE = SIGN IN THE STRING !! and if you want to get a formula already write on a Excel file you can use var formula = sheet.cell( curRow , curCol ).getCellFormula(); //return string without the = sign