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

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Ibm cognos 10 Problem PDF format

Started by Enrique, 21 Oct 2015 05:02:51 AM

Previous topic - Next topic

Enrique

Hi Everybody!!

I have a Problem with the pdf Format and is really weird.

I m using a Html element in the prompt page with the differents formats I m using that code and work.

<html>
<head>
<script language="javascript">
function gotoUrl()
{var obj=document.all['OutputFormat'];
window.onload(gCognosViewer.getRV().viewReport(obj.options[obj.selectedIndex].value));
}
</script>
</head>
<body>
<select name="OutputFormat" OnBlur="javascript:gotoUrl()">
<option value="HTML">HTML</option>
<option value="PDF">PDF</option>
<option value="singleXLS">Excel 2000 Single Sheet</option>
<option value="spreadsheetML">Excel 2007</option>
<option value="XLWA">Excel 2002</option>
<option value="XLS">Excel 2000</option>
<-- Bellow will not required most of times -->
<option value="CSV">Delimited text (CSV)</option>
<option value="XML">XML</option>
</select>
</body>
</html>

The Problem is that
My pdf Format just  work  when i open first  the same Report in HTML .

- So if I open the Report directly the first time in pdf form it doesnt work. ( is not a really big Problem if it would be a Report for me.. but you can not send it to Production with that Problem )


Does anyone know something about that??



Thanks in Advantage!!

bdbits

If all of your sample code is inside an HTML item including <head>, <body>, etc. you are not understanding how Cognos pages are generated. It is already a page, and including everything you have there is going to lead to horribly malformed HTML as you will have an entire HTML page nested inside the <body> of the Cognos page.

PDF is not HTML. And depending on the PDF viewer and configuration, it may or may not support javascript. Anything you put inside the HTML items is basically outside of Cognos and although what you include can reach out and manipulate the enveloping page, Cognos does not attempt to interpret or otherwise manage anything you have put in there.


Enrique

Hallo bdbits!


Yes that is all my code and yes I don't understand how Cognos page are generated.  I m relative new in Cognos , I work for less than a year (i m not a expert) thats why I ask.

- What I find extrange is that pdf work if i previous opened the Report in HTML , what is the meaning of that ?

- Do you have any suggestion about , how could I fix it ?


Thank you very much

Lynn

I can't answer the scripting question but it looks like you want to provide a prompt option so the user can select an output format. There are a couple of threads that address this question so perhaps you can find more information as well as alternative approaches by perusing the links below.

http://www.cognoise.com/index.php/topic,26856.msg85831.html#msg85831

http://www.cognoise.com/index.php/topic,12546.0.html

Enrique

Thanks Lynn i found some usefull Information there :))

thanks

bdbits

Thanks Lynn, I forgot to point out a solution.  :o

FYI Enrique so you know... your report is actually just a big set of HTML inside the <body> tags. So if you drop an HTML item in there, you don't need or want to put <head> and <body> tags. Just the little snippets of HTML or javascript you need. It leads to a little bit of weirdness because your final page ends up with some stuff in the body that you would probably normally put in the <head> but the browsers all seem to deal with it fine. So now you know.

If you are familiar with web development, it can be illuminating to take a simple report and open your favorite browser dev tools and poke around. You can learn a lot that way, at least I did.