COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Topic started by: bpetty on 29 Sep 2010 10:53:32 AM

Title: Adding custom elements to report spec
Post by: bpetty on 29 Sep 2010 10:53:32 AM
I am having trouble figuring out if you can add custom elements to a report spec.
I essentially want to add meta data to the report but can't figure out how to do it.

Example:

    <report xmlns='http://developer.cognos.com/schemas/report/6.0/' expressionLocale='en-us'>

        <custom>
            <refID>012456433_000001</refID>
            <refCategory>1</refCategory>
        </custom>

        <modelPath>/content/folder[@name='Packages']/package[@name='Data Source View']/model[@name='']</modelPath>
        <drillBehavior modelBasedDrillThru='true'/>
            <layouts>


I can not get it to pass validation when I try to add my "custom" bock.
Does anyone know how to do this?
Title: Re: Adding custom elements to report spec
Post by: technomorph on 29 Sep 2010 11:21:21 AM
Unless there is a feature I'm not aware of, I don't think this will be possible because the XSLT code used for parsing the XML won't recognise the tag.

Could you just use the standard comment syntax?

<!-- This is a comment -->

I've tested this and the comments persist in the XML when the report is saved and reopened.
Title: Re: Adding custom elements to report spec
Post by: bpetty on 30 Sep 2010 03:36:25 PM
Thanks, that is what we have resorted to.

One note:  You must put the comment inside the <report> block, and not outside, or it will be removed.