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

SOLVED - Does PageNumber() not work in PDFs and/or XLS?

Started by squish88, 17 Dec 2013 10:49:49 AM

Previous topic - Next topic

squish88

Hey guys,
   I put a render variable on a conditional block in a bunch of my reports to show a "report description" the users requested at the top of the first page of output only.  That variable was a simple PageNumber() = 1.  Though it doesn't seem to want to work for PDF's, and Excel outputs...  (ie. no description is coming out on the first page when output to those formats).  It works great in HTML though.   Am I missing something?  Is this just a rookie mistake?  Should I be using something else to accomplish this, or is it possibly a Cognos (10.2.0 FP1) bug?
  Thanks in advance for the help!!

MFGF

What happens if you include a layout calculation in the page header with an expression of Pagenumber() - does it display the expected number when you render as html / pdf / excel? Showing this might give you a clue as to whether or not it's returning what you expect while you figure out what the issue is.

MF.
Meep!

squish88


navissar

Hi,
This is a really weird behaviour, I was able to recreate it and do some further testing on 10.2. It seems that Cognos doesn't calculate the variable value when exporting the report.
It may be worth while to involve IBM support. Maybe there's a defect logged in deep in the stomach of IBM systems, or they can open one if there isn't.
In the meantime, here's a workaround: Since the report expression "PageNumber()" does work, you can set the description text like this:
create a layout calculation and in it put the following expression:
if(PageNumber ()=1) then ('This is a description text') else ('')
Replace 'This is a description text' with your description. This will actually work.

squish88

That's an excellent workaround!!   Thank you very much for the help!!!

pirx

Hey!

I am facing the same problem, just I have to show a list in the header only the first page. The list is different is than the list which is in the page body and the layout calculation does not work for me. The report contains page set with along some id-s, thats why does not work for me tha pagination settings, because the list repeat every new pagebreak...
But maybe I am just missing some point.
Do you have any idea?

Thanks!

Lynn

If you can create a query calculation that resolves to the first value your page set will deliver then you can conditionally render based on that.

For example, let's say your page set is based on product name and sorted alphabetically. Your products are called 'Alpha', 'Bravo', and 'Charlie'.

Create a query calculation called 'First Product Name' and find the first one:


minimum ( [Product Name] for report )


Now you can use [First Product Name] compared to [Product Name] and only render your object when they match, which is only going to be true for the first page.

maurizio.pavan-ext

Hello,
Sorry to reply on this "solved" thread, but I'm new and not able to create new posts.
Here is my problem:
I need to create a bursting PDF report having an introduction as (Rich text item) on the first page only.
I've tried different ways bot none of them works
Report have 3 sections
1) Header
2) Introduction block
3) List

Looking forwards for any help
Thanks