COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: melee on 18 Jan 2011 04:55:31 PM

Title: Copying a query and its filter to multiple reports
Post by: melee on 18 Jan 2011 04:55:31 PM
This is pretty straightforward, I have a query and some filters that I need to move to other reports - is this as easy as copying the XML and merging it with the other report's XML? Seems like it...
Title: Re: Copying a query and its filter to multiple reports
Post by: JGirl on 18 Jan 2011 08:17:46 PM
If it is one entire query, and all the filters/slicers/query properties within that query, you can just copy/paste the entire query into other reports (Click on the queries folder in the query explorer, then right-click the query you want to copy, and choose copy.  Then open the target report, go into the query explorer and paste)

If you want specific data items and specific filters (but not all of them) then you will need to modify the XML (or you can copy/paste the data items and filters individually)
Title: Re: Copying a query and its filter to multiple reports
Post by: melee on 19 Jan 2011 10:03:54 AM
Thanks JGirl. I know about copying them directly into the report, but I was hoping to save time by editing the XML spec. Once I got it properly formatted, the XML doesn't seem so bad.

I'm trying to get a policy in place where the XML of all of our reports is saved in a repository - I think that might save us a little time when editing en masse.
Title: Re: Copying a query and its filter to multiple reports
Post by: Arsenal on 20 Jan 2011 12:04:05 PM
IMHO, playing with the XML of reports causes issues frequently if you know what you're doing. It could be something as simple as a missing tag (>) and boom, report is corrupted. Sometimes, it's less time consuming and less issue creating to just do it the old fashioned as suggested by JGirl.

If you must have a repository of XML specs of your reports, then do so but perhaps you may consider a policy where developers are using the XML specs fromthe repository to initially open the reports in RS but still copy pasting the query/queries manually.
Title: Re: Copying a query and its filter to multiple reports
Post by: melee on 20 Jan 2011 12:37:37 PM
Quote from: Arsenal on 20 Jan 2011 12:04:05 PM
IMHO, playing with the XML of reports causes issues frequently if you know what you're doing. It could be something as simple as a missing tag (>) and boom, report is corrupted. Sometimes, it's less time consuming and less issue creating to just do it the old fashioned as suggested by JGirl.

If you must have a repository of XML specs of your reports, then do so but perhaps you may consider a policy where developers are using the XML specs fromthe repository to initially open the reports in RS but still copy pasting the query/queries manually.

I come from a heavy webdev background, so my IDE takes care of validating the XML and checking for unclosed tags or poor syntax. Luckily, I'm an apprentice to another developer that couldn't care less about XML, so it is more for me than anything else :)