PHPExcel: formula error (IF) - if-statement

I'm trying to insert this formula
=IF(Datenbasis!B3<0;((Datenbasis!K3-Datenbasis!B3)/ABS(Datenbasis!B3))^(1/9)-1;(Datenbasis!$K$3/Datenbasis!$B$3)^(1/9)-1)
into this samplefile1 with this code:
// ....
try
{
$inputFileType = PHPExcel_IOFactory::identify("phpexceltest.xls");
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcel = $objReader->load("phpexceltest.xls");
}
catch(Exception $e)
{
$_loadingerror = TRUE;
}
if ($_loadingerror === TRUE)
{
// Fehler beim Laden der Vorlagen-Datei!
die("Fehler!");
}
$objPHPExcel->setActiveSheetIndex("0");
// ....
$objPHPExcel->getActiveSheet()->setCellValue("J4", "=IF(Datenbasis!B3<0;((Datenbasis!K3-Datenbasis!B3)/ABS(Datenbasis!B3))^(1/9)-1;(Datenbasis!$" . "K$3/Datenbasis!$" . "B$3)^(1/9)-1)");
// ....
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save("ready.xls");
I get this error
Fatal error: Uncaught exception 'Exception' with message 'Results!J4 -> undefined variable ';'' in ...\PHPExcel\Cell.php:288 Stack trace: #0 ...\PHPExcel\Writer\Excel5\Worksheet.php(441): PHPExcel_Cell->getCalculatedValue() #1 ...\PHPExcel\Writer\Excel5.php(171): PHPExcel_Writer_Excel5_Worksheet->close() #2 phpexceltest.php(446): PHPExcel_Writer_Excel5->save('ready.xls') #3 {main} thrown in ...\PHPExcel\Cell.php on line 288
and I have no idea why. When I use this formula in Excel directly, it's working.
Any ideas, what to do?

Rules for writing formulae in PHPExcel (as described in the documentation)
Decimal separator is '.' (period)
Function argument separator is ',' (comma)
Matrix row separator is ';' (semicolon)
English function names must be used
unless you've explicitly set a locale for the calculation engine
You're using a semi-colon (';') as a function argument separator

Related

Why does ocamldebug's install_printer report "Unbound identifier"?

I've written print functions (print_id, for example) for several types in my program, and have loaded them into ocamldebug (with 'load_printer _build/default/print.cma') but when I try to install them (with 'install_printer print_id' or 'install_printer Print.print_id'), it fails (with 'Unbound identifier print_id' or 'Unbound identifier Print.print_id'). What am I missing?
open Error
open Ast
let print_id (Id { name; position }) =
begin
Format.open_box 5;
Format.print_string ("Id { name=" ^ name ^ ";");
Format.print_space ();
Format.print_string ("position=" ^ (string_of_position position) ^ " }");
Format.close_box;
end

ERROR [IntrusionException] [SECURITY FAILURE Anonymous:null#unknown -> /ExampleApplication/IntrusionException] INTRUSION - Multiple (2x) encoding

I have this line of code in my project :
try {
ESAPI.initialize("org.owasp.esapi.reference.DefaultSecurityConfiguration");
value = ESAPIENCODER.canonicalize(value);
} catch (Throwable e) {
LOG.warn("Invalid parameter value, setting to empty. Value: " + value, e);
value = "";
}
I get the following error:
ERROR [IntrusionException] [SECURITY FAILURE Anonymous:null#unknown ->
/ExampleApplication/IntrusionException] INTRUSION - Multiple (2x)
encoding detected in
http://www.google.co.jp/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&uact=8&ved=0ahUKEwjwscD6ifjbAhVOgK0KHT_DAYsQFggxMAE&url=http%3A%2F%2Fwww.nequipment.eu%2Fassets%2Fimported%2Ftransformations%2Fcontent%2Fproduct-details%2F%257Blanguage%257D_Brochure%2FC061657EB4C64903B6BEB38FBAC03445%2FDX140LC-3_AS8-3_EN.pdf&usg=AOvVaw2923Vp0vsPQHvZ7gDbPFGs
2018-06-29 00:29:31,559 WARN [com.xxxxx.framework.utils.XSSUtil]
Invalid parameter value, setting to empty. Value:
http://www.google.co.jp/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&uact=8&ved=0ahUKEwjwscD6ifjbAhVOgK0KHT_DAYsQFggxMAE&url=http%3A%2F%2Fwww.nequipment.eu%2Fassets%2Fimported%2Ftransformations%2Fcontent%2Fproduct-details%2F%257Blanguage%257D_Brochure%2FC061657EB4C64903B6BEB38FBAC03445%2F140LC-3_X160LC-3_EN.pdf&usg=AOvVaw2923Vp0vsPQHvZ7gDbPFGs
org.owasp.esapi.errors.IntrusionException: Input validation failure
at
org.owasp.esapi.reference.DefaultEncoder.canonicalize(DefaultEncoder.java:181)
at
org.owasp.esapi.reference.DefaultEncoder.canonicalize(DefaultEncoder.java:122)
What does the warning mean and how can I get rid of it?

Script compilation failed at line 19 in procedure 'BusComp_PreWriteRecord':

I am getting the following error, when tries to save the following script.
"Script compilation failed at line 19 in procedure 'BusComp_PreWriteRecord':
Syntax error at Line 31 position 59:Expected ')'
(SBL-SCR-00128)"
function BusComp_PreWriteRecord ()
{
var obj = TheApplication().GetBusObject("Service Request");
var optybc = obj.GetBusComp("Service Request");
optybc.ActivateField("SR Type");
//optybc.ActivateField(“Typeâ€);
optybc.SetViewMode(3);
optybc.ClearToQuery();
optybc.SetSearchSpec("SR Type",this.GetFieldV alue("SR Type"));
//optybc.SetSearchSpec(“Typeâ€,this.GetFieldV alue(“Typeâ€));
optybc.ExecuteQuery(ForwardOnly);
if(optybc.FirstRecord())
{
TheApplication().RaiseErrorText("Duplicate Records");
}
}
Does anyone knows the reason for the above error?
It might be that you are missing brackets in code that is "above" PreWriteRecord()
for example these methods
Siebel compiles all event code as one large code, so missing parentheses in other places will create issue in subsequent events.

Swift Regular Expression error

I create the swift regular expression to detect font.I got the following error "Type of expression is ambiguous without more context"
What wrong in my code???
let regexZG = NSRegularExpression(pattern: "\\s\u{1031}| ေ[က-အ]်|[က-အ]း", options:nil, error:nil)
By 7.3/2.2 all error parameters taking NSErrorPointer had been transitioned to throwable errors. In addition, empty option sets now use the set notation, so try:
do {
let regexZG = try NSRegularExpression(pattern: "\\s\u{1031}| ေ[က-အ]်|[က-အ]း", options:[])
// do some stuff with regexZG here
}
catch error {
print("NSRegularExpression init failed: \(error)")
// do something imaginative here
}

how to modify an exception object in Railo

try {
// some error
} catch (any e) {
e.extendedInfo = 'New extended info';
//throw(e);
//cfcatch.extendedInfo = 'New extended info';
rethrow;
}
When I (re)catch this exception the extendedInfo is not displayed. What I want to happen is the raised exception keeps all of its pre-catch properties including the original tagContext and line numbers etc but gets a new value for extendedInfo.
I've tried copying the attributes of e into a new attributeCollection and throwing that with throw(e) or <cfthrow attributeCollection="#e#" /> but then the context is changed and the error displays the wrong line of source code.
While I'm at it is there a way to to drop the topmost stack object so an exception appears to have been thrown from the calling context. ie:
function myRethrow(e) (
throw(e); // <!-- error is actually throw here BUT ...
)
myRethrow(e); // <-- error should appear to have 'happened' here
Using Railo 3.2
I think you can use throw function like this:
try {
try {
// some error
}
catch (any e) {
e.extendedInfo = 'New extended info';
throw(argumentCollection = e);
}
}
catch (any e) {
WriteDump(e);
}
Works for me.