Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Please Help... Subreport issues!
Krelek1000
Hi,
I am working on a details report that has many "possible" sub reports. What I mean by Possible is that they might return data or they might now.
Well I created a subreport and in it I added a Data Field. In the data field I need to return a string value and the value of a Database field.
Well When I run the report, if the sql statement returns nothing, then the data field gets a null error to it. Is there a way to create a value for the row name of the database field if the sql returns false?
Let me know if you have any ideas!
Thanks
Ben Compton
Find more posts tagged with
Comments
JasonW
Ben,
What version are you using? You should not be getting a null error.
Jason
Krelek1000
I am using V 2.1.2 of BIRT because it is part of the IBM Tivoli/Maximo suite. I do not think that I can upgrade to a newer verision though...
Thanks
Ben
JasonW
Ben,
If you cant upgrade, can you try to check for null in the expression?
Like:
if( dataSetRow["myval"] == null ){
"no value";
}else{
dataSetRow["myval"];
}
Jason
Krelek1000
Jason,
Here is the formula that I have used:
if (dataSetRow["dname"]==null || dataSetRow["dname"] == undefined ) {
"no value";
}
else
{
dataSetRow["dname"];
}
I get the following error:
Result iterator has no current row. It either has not started or has ended.
The original formula that I used is very similar:
if (dataSetRow["dname"]==null || dataSetRow["dname"] == undefined ) {
"no value";
}
else
{
"Electronically Signed by: " + dataSetRow["dname"];
}
But returns a different error:
See next exception for more information.
Error evaluating Javascript expression. Script engine error: TypeError: Cannot find default value for object.
Script source: null, line: 5, text:
<compiled script>
Unfortunately, none of the scripts return a value because they error out. I found it is because I reference the dataSetRow["dname"]. The SQL statement does not return any values so when the Fetch() is done, there object, "dname", does not have a value or is not even defined. But the undefined property doesn't even return a value either...
Any help will be appreciated,
Ben
JasonW
Ben,
I just tried this with 2.1.2 and I can not reproduce the error.
What data source are you using? Any chance of creating a report off the sample db that has the issue?
Jason
Krelek1000
Well I think the problem is that I have the Data in the Footer of the subreport. Here is the problem...
I need to show a set of format labels that show:
___________________ ______________
Specify Date
Well the problem is that many folks can "sign or approve" on this line. I can have many different auths in other words for the same approval. However, I only want to return the latest one. I put the data in the footer because when it does the Order By clause in the SQL statement, it will return the last time the approval was reached.
I think because I have the data in the Footer, it does not like it.
I am using an ORACLE Database with a Oracle JDBC Thin client.
Might there be a way to return only the last record in a series in the Details row? If I can do that then this error might go way...
Thanks
Ben
JasonW
Ben,
I am trying to recreate the error but I am not able to. I am using MySQL with a table that has no rows. I put the value in the footer, but I still did not get the issue. What kind of element are you using in the footer?
Jason
Krelek1000
I am using a Data element because I need to bring in a string with some data.
I do not know if I can separate them... I can give it a shot and report back what happens. The only problem that I have is it might error out anyways because it is the sequence before the string:
"Electronically Signed By: "
That is making it error out for some reason...
Krelek1000
Okay this is getting weird...
if (dataSetRow["dname"]==null || dataSetRow["dname"] === undefined ) {
"no vaule";
}
else
{
"has value";
}
Ok I know for a fact that dataSetRow["dname"] does not have a value... It should be null...
But it is putting the has value in the printout!
When I try to put the dataSetRow["dname"] in the else statement to see its value this error pops up...
Result iterator has no current row. It either has not started or has ended.
This is wierd...
JasonW
I wish I could reproduce the problem.
Try a text element with this expression
<VALUE-OF>if( row["dname"]== null ){
"value was null";
}else{
row["dname"];
}</VALUE-OF>
You will need to bind the text element to your dataset.