Making reports run in 2.1.0 and 2.1.3 [message #252080] |
Fri, 10 August 2007 16:59 |
Eclipse User |
|
|
|
Originally posted by: dave.gross.logiclibrary.com
2.1.3 has some incompatible changes that make reports that ran in 2.1.0
fail. I've seen some of the discussion on this already, but simply
modifying the reports to work in 2.1.3 isn't an option--I need to support
both. I wish backward compatibility would be maintained as is prescribed in
your Project Plan.
In the mean time, here are some things I found I needed to do to make my
reports run in both 2.1.0 and 2.1.3. It appears that the javascript runs
differently or uses a different engine in dataset preview vs. report
preview.
Before:
var schema = params["database_schema_name"];
if (schema == null) {
schema = "";
} else {
schema = schema + ".";
}
After:
var schema;
if (params["database_schema_name"] == null ||
params["database_schema_name"].value == null) {
schema = "";
} else {
schema = params["database_schema_name"]+".";
}
Explanation:
If the parameter in the params variable is null, you cannot assign it
directly to another variable (results in a cannot convert null to an object
error). To check for null, you need to add a second check with ".value"
because in the dataset preview, params["xxx"] == null will return true as
expected, but in the report preview it will always return false. The second
check params["xxx"].value == null will work in the report preview. In 2.1.0
".value" will always fail.
Before:
var id = params["libraryID"];
var num = id.substr(id.indexOf(':',0)+1,id.length);
After:
var id = String(params["libraryID"]);
var num = id.substr(id.indexOf(':',0)+1,id.length);
Explanation:
Without the cast to String, id.length will always return 0 in the report
preview in 2.1.3. In the dataset preview, it works fine.
|
|
|
Powered by
FUDForum. Page generated in 0.04237 seconds