This content has been marked as final. Show 4 replies
I have found this error in an XDK manual and it says:
XML-23029: FORG0001: invalid value for cast/constructor
Cause: This was an XPath 2.0 F&O specification error.
Action: Check the XPath expression.
However as I said I believe the XSL/XPATH to be correct.
I think it has something to do with the group that I have wrapped this field around because I did a similar thing where I totalled up a column using one of these summary fields but it was just in an empty cell not enclosed within a group and that worked.
So if it was the emp/dept example it would be like breaking on job with deptno and so there would be a repeating group to incorporate the total salaries by job and still needing to create a total of salary by department(deptno) too.
Does anyone know of problems trying to reference aggregates within groups?
Surely someone is creating reports within Excel with subtotals and overall totals.
From an Emp/Dept perspective, all I'm trying to do is create a report by department and the broken up by job within department and I want a subtotal of salary by job and then a total of salary by department.
Currently the work around, it may not be a work around it maybe the way it has to be done, is to create two break groups in the data model, one for the department and one for the job and then use the aggregate functions available there in order to create the summaries in the XML in the first place. What would be nice to know is if that is the only way or the best way to do it or should I not be able to create those summaries in the spreadsheet itself.
You should be able to calculate the subtotal in the spreadsheet itself..1 person found this helpful
Have you tried using: <xsl:value-of select="sum(current-group()/V_CR_MO_IDD)"/> -- assuming that you have declared a group..
There are some sample excel templates under your BI Publisher Desktop folder (I believe these come with the 11g version) that show you how to create the subtotals: \BI Publisher Desktop\Template Builder for Word\samples\Excel templates
I went back to basics and created reports (via EXCEL templates) like I was asking based on good old EMP and DEPT and I found exactly the same problems I was mentioning. I looked at the templates provided but they were not calculating totals, like me they were selecting them and then just displaying them on the page.
Anyway, I have narrowed it down to the fact that when you do aggregates like sum(.//SAL) this works if you have a salary for every value. I did an outer join with DEPT so I did have empty rows and why I still experienced the problems.
Basically XSL does not like adding (including using the sum function) values that effectively have nulls in them which is why I get the cast/constructor errors because it is trying to turn a NaN value to a number and does not (or cannot) do it.
You need to either have a value in every row of your column (maybe possible by selecting nvl in your query) and make sure that you check the "create empty nodes" checkbox in the data model of BI Publisher.,
the other solution is an xsl solution where you would have to make sure that you only added non null values and for that you would have to investigate xsl blogs.
It is, by the way, why my count worked because it is just counting that the record exists it does not care what the element content is or isn't.