COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: OIT_Nate on 06 May 2022 11:58:20 AM

Title: ReportOutput() is always HTML on the prompt page
Post by: OIT_Nate on 06 May 2022 11:58:20 AM
I am working on a report in Cognos Analytics 11.1.7 that produces an aggregate-level summary page, but because many of my users want to be able to dig into the underlying data themselves I like to include the option to produce an additional page in the output containing a detailed list of everything that went into the summary. The detail list is not always necessary though, and since it makes the report take much longer to run I make it optional by adding a prompt to the prompt page and then making a Boolean variable such as ?P_LIST? = 'Y' to use as the render variable for the page.

The list is really only useful if the report is run to Excel though, so I do not want the user to even have the option if the output format is HTML or PDF. I have accomplished this in several previous reports by making a string variable using ReportOutput() and then setting it as the render variable for the prompt (with HTML and PDF unchecked). But for some reason this is no longer working on new reports. Every time I open the prompt page the list prompt does not render because the prompt page itself is in HTML. I have confirmed this by putting a text item on the prompt page with the report expression ReportOutput() and it always says HTML no matter what format it will ultimately be running to. I can put the same text item into one of my older reports and run it to PDF or Excel and it will say so when the prompt page loads. I keep trying to find some difference between the older reports and this new one to explain it but I just can't figure it out.

Any suggestions?
Title: Re: ReportOutput() is always HTML on the prompt page
Post by: dougp on 06 May 2022 12:07:04 PM
ReportOption('outputFormat')
Title: Re: ReportOutput() is always HTML on the prompt page
Post by: OIT_Nate on 06 May 2022 12:15:54 PM
Wow my headache is cured! Thank you so much dougp!
Title: Re: ReportOutput() is always HTML on the prompt page
Post by: OIT_Nate on 06 May 2022 02:27:37 PM
I am still baffled as to why ReportOutput() would function differently between reports. If anyone has an explanation for this I would greatly appreciate it.