If you are unable to create a new account, please email support@bspsoftware.com

 

Dynamic Report Specification Updater - How to change Report Expression

Started by TheBrenda, 07 Apr 2015 09:20:06 PM

Previous topic - Next topic

TheBrenda

I am trying to use the Dynamic Report Specification Updater Diagnostic to change some reports. I have it launched and I am signed in. I have an expression that I want to change. I can get it to work if I don't use the brackets, but I need the brackets to make sure that I am changing the correct report field.  Is there any way to use brackets in CDATA or within the Dynamic Report Specification Updater?

change this
[Demand Deposits / Savings].[Account Attributes].[Short Name]

to this
[Demand Deposits / Savings].[Account Attributes].[Short NameXX]

I set up my transformation file as below, but it does not work. Something about the embedded brackets  [] make it go off the rails. It replaces

<?xml version="1.0" encoding="UTF-8"?>
<Transformations>
<Transformation id="Convert 'Short Name' to 'Short Name2'">
<Search><![CDATA[Demand Deposits / Savings].[Account Attributes].[Short Name]]></Search>
<Replace><![CDATA[Demand Deposits / Savings].[Account Attributes].[Short NameXX]]></Replace>
</Transformation>
</Transformations>


Just as a small example, this is what my output looks like after the transform with brackets. That is the report header

<r[Demand Deposits / Savings].[Account Attributes].[Short Name2] xmlns="http:/[Demand Deposits / Savings].[Account Attributes].[Short Name2]  - and repeated over and over again

That is the first line
<report xmlns="http://developer.cognos.com/schemas/report/8.0/" useStyleVersion="10" expressionLocale="en-us">

TheBrenda

The DRU uses Regex in the SEARCH FOR. So brackets, parenthesand periods need to be escaped with a forward slash.  My transformation file needed to look like this.

<?xml version="1.0" encoding="UTF-8"?>
<Transformations>
<Transformation id="Convert 'Short Name' to 'Short Name2'">
<Search><![CDATA[\[Demand Deposits / Savings\]\.\[Account Attributes\]\.\[Short Name\]]]></Search>
<Replace><![CDATA[[Demand Deposits / Savings].[Account Attributes].[Short Name2]]]></Replace>
</Transformation>
</Transformations>


bdbits

Thanks for posting back your solution for this. It will likely prove valuable in the future for some poor soul having the same problem.