COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: ry1633 on 19 Aug 2015 10:01:18 AM

Title: Footer question - page numbering format
Post by: ry1633 on 19 Aug 2015 10:01:18 AM
Hi all this might be a simple question but I've been clicking around trying to figure this out for a couple of hours now.

I want to change the format of the page number in a report footer.  And I want to use either one of these formats in Report Studio from the list of options:


But those look a bit clunky - I'd like to put a space separator in there so it reads easier like:  1 of 3 or 1 (1 of 3).     I can't seem to figure out how/where to do that; there aren't any options in the Properties pane that would do the trick.
Title: Re: Footer question - page numbering format
Post by: BigChris on 19 Aug 2015 10:32:03 AM
This is possibly not the most refined way of doing, but it does work...

In you page footer you need to drop in three layout calculations. In the first one you need the report function PageNumber(), in the second add the text string ' of ' and in the third you need the report function PageCount()

Note that this will only work in the way you expect it in PDF format...it won't give you the total number of pages in HTML format.
Title: Re: Footer question - page numbering format
Post by: BigChris on 19 Aug 2015 10:34:55 AM
Just another thought, once you've got this sorted out in the way that you want to use it, consider saving into a generic report that you can use as reference...that way you can use it as a Layout Component Reference so that you don't have to copy the formula each time.
Title: Re: Footer question - page numbering format
Post by: ry1633 on 19 Aug 2015 11:00:34 AM
there isn't any way to get that to work in the HTML view?  It'd be nice to get it to work across the multiple formats HTML, and PDF/Excel, etc.

Title: Re: Footer question - page numbering format
Post by: MFGF on 19 Aug 2015 11:20:24 AM
Quote from: ry1633 on 19 Aug 2015 11:00:34 AM
there isn't any way to get that to work in the HTML view?  It'd be nice to get it to work across the multiple formats HTML, and PDF/Excel, etc.

Look at FAQ number 1:

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

MF.
Title: Re: Footer question - page numbering format
Post by: ry1633 on 19 Aug 2015 03:11:51 PM
I put in the Functions that BigChris said to do and then I ran with these steps from the FAQ:

"Run with options" button for your report from Cognos Connection, select "Save the report" and choose HTML as the rendering type, the entire output will be generated as HTML pages, with correct page numbering

But the report fails and doesn't give me any output to look at. Attached is a screenshot of the error.
Title: Re: Footer question - page numbering format
Post by: MFGF on 20 Aug 2015 02:12:53 AM
Quote from: ry1633 on 19 Aug 2015 03:11:51 PM
I put in the Functions that BigChris said to do and then I ran with these steps from the FAQ:

"Run with options" button for your report from Cognos Connection, select "Save the report" and choose HTML as the rendering type, the entire output will be generated as HTML pages, with correct page numbering

But the report fails and doesn't give me any output to look at. Attached is a screenshot of the error.

What happens when you run interactively? Do you see the same error? Sounds like you have a syntax error somewhere...

MF.
Title: Re: Footer question - page numbering format
Post by: BigChris on 20 Aug 2015 02:34:25 AM
You've used ParamCount() instead of PageCount()...
Title: Re: Footer question - page numbering format
Post by: ry1633 on 20 Aug 2015 10:10:11 AM
sorry I missed that.  Here's the new shot of when I ran it.  What should I be seeing?  The status stayed at 'pending' for a few minutes and didn't change.
Title: Re: Footer question - page numbering format
Post by: MFGF on 20 Aug 2015 10:51:11 AM
Quote from: ry1633 on 20 Aug 2015 10:10:11 AM
sorry I missed that.  Here's the new shot of when I ran it.  What should I be seeing?  The status stayed at 'pending' for a few minutes and didn't change.

Did you press the Refresh link in the top right corner periodically? If you return to Cognos Connection, is there now a saved output for the report? What do you see if you select More > View Run History?

MF.
Title: Re: Footer question - page numbering format
Post by: ry1633 on 24 Aug 2015 04:16:49 PM
Can I apply this change to a report template?       I'd like to build this into a Template, but in a template I don't think I can do any kind of query or layout calculations from the Toolbox in Report Studio.
Title: Re: Footer question - page numbering format
Post by: Michael75 on 25 Aug 2015 11:42:47 AM
Hi,

Whilst trawling through some old notes, I came across the attached doc from the cognos.com BA Supportlink days. OK, it's for C8.4, but I don't see anything there which won't work under C10.x. Maybe it'll be helpful to you?
Title: Re: Footer question - page numbering format
Post by: ry1633 on 25 Aug 2015 12:16:31 PM
Michael, thanks for that.  I tried it and it worked ok but it still display right in HTML.   It must not be possible for the pageCount to ever display in HTML, and that's OK.  I'll just have to tell my users that it's not possible in the HTML view.


What I notice is that if I try to build a Report Template from scratch in Report Studio (by choosing 'Report Template' from the very first menu),  then I have no access to anything in the Toolbox and can't use any Query or Layout calculations.  Can I just open Report Studio,  create a new List report and save it as a template?
Title: Re: Footer question - page numbering format
Post by: bdbits on 25 Aug 2015 04:32:50 PM
I just created a new template and was able to access most if not all toolbox items.  :o

You can create a list report and choose "Convert to Template" from the File menu. When you do that, it will drop all the data items from your list, but leave the list container there.

Title: Re: Footer question - page numbering format
Post by: MFGF on 26 Aug 2015 03:57:21 AM
Quote from: ry1633 on 25 Aug 2015 12:16:31 PM
Michael, thanks for that.  I tried it and it worked ok but it still display right in HTML.   It must not be possible for the pageCount to ever display in HTML, and that's OK.  I'll just have to tell my users that it's not possible in the HTML view.

Hi,

Did you read the FAQ I pointed you to? It describes how when rendering a report interactively, HTML rendering creates one page at a time then stops rendering, and shows a "Page down" link. When you press this the second page is rendered. Press it once more and the third page is rendered. And so on. Because of this there is no up-front visibility of the total number of pages the report spans (since those pages haven't been rendered and the data has not been read). However, you can use the "Run with options" button for a report, choose "Save the report", make sure HTML rendering is selected, and have the Cognos server render the whole report output as HTML and save it to the content store. In doing this (ie running in the background and rendering the complete output at once) the page count is known and is included in the rendered output. Your users can then click to view this saved output and see the page count.

So, in a nutshell, page count is not available when running a report interactively in the browser using HTML rendering. Page count is available when running a report as a background process using HTML rendering and saving the rendered output to the content store.

MF.
Title: Re: Footer question - page numbering format
Post by: ry1633 on 26 Aug 2015 08:44:49 AM
bdbits,

I misspoke slightly.  I can see the toolbox when I create a new blank template in RS, but none of the functions, expressions or anything like that are available when I create a new layout calculation.  see screenshot.
Title: Re: Footer question - page numbering format
Post by: bdbits on 26 Aug 2015 09:04:05 AM
OK, but still, I do see functions that are not data-specific are still available. I am a bit baffled that you do not. What browser and version are you using?
Title: Re: Footer question - page numbering format
Post by: ry1633 on 26 Aug 2015 10:05:31 AM
I'm using Report Studio 10.2.1 with IE 11.0.9600.19759
Title: Re: Footer question - page numbering format
Post by: bdbits on 26 Aug 2015 05:44:10 PM
Is compatibility mode enabled for your Cognos URL?
Title: Re: Footer question - page numbering format
Post by: ry1633 on 28 Aug 2015 08:40:38 AM
I'm not that admin for our Cognos instance, so I'd have to check that.  where can I find that out?
Title: Re: Footer question - page numbering format
Post by: bdbits on 28 Aug 2015 08:56:02 AM
Compatibility mode is a reference to an Internet Explorer setting.
http://windows.microsoft.com/en-us/internet-explorer/use-compatibility-view#ie=ie-11 (http://windows.microsoft.com/en-us/internet-explorer/use-compatibility-view#ie=ie-11)

In IE11 on 10.2.1, you should have compatibility mode enabled for Cognos. Also check any browser add-ons you have that might be interfering; disable them at least temporarily to see if it has any effect. If you have not already, try clearing your cache and cookies. All of these steps are common things to eliminate a browser issue as the root of the problem.

Even better, if you are allowed to install/use other software, try the site with Firefox and see if the problem persists. If so, then you are dealing with a browser issue, if not it would most likely be some kind of configuration issue.

To be honest I am not sure any of this will fix the problem, but I am grasping at straws a bit here. So they are some things to try.
Title: Re: Footer question - page numbering format
Post by: MFGF on 28 Aug 2015 09:22:15 AM
Hmmm. I see the same when creating a new report and choosing the "Report Template" template from the list.

(https://image.ibb.co/e25Qq5/Template_zpspjqtcxe5.png)

An alternative is to use the "Blank" (or any other) template, add your structures and layout calculations, then use File > Convert to Template then save it.

Cheers!

MF.
Title: Re: Footer question - page numbering format
Post by: bdbits on 28 Aug 2015 04:49:48 PM
OK... so after reading MFGF was also seeing this and I was not, I did some further experimentation.

If you launch Report Studio from Cognos Connection and choose to create a report template as the first thing, then there are no functions listed.

But if you either open some existing report first, or choose to create a new report, and then choose File > New and choose report template, the functions DO appear. This is the method I was using, so I was a bit puzzled that the function list was not appearing. I think the key is whether package metadata has loaded even once. It seems that if it has you get the function list when authoring a template, otherwise you do not. To me this is rather odd behavior, but that is what I am seeing.
Title: Re: Footer question - page numbering format
Post by: MFGF on 01 Sep 2015 05:15:53 AM
Quote from: bdbits on 28 Aug 2015 04:49:48 PM
OK... so after reading MFGF was also seeing this and I was not, I did some further experimentation.

If you launch Report Studio from Cognos Connection and choose to create a report template as the first thing, then there are no functions listed.

But if you either open some existing report first, or choose to create a new report, and then choose File > New and choose report template, the functions DO appear. This is the method I was using, so I was a bit puzzled that the function list was not appearing. I think the key is whether package metadata has loaded even once. It seems that if it has you get the function list when authoring a template, otherwise you do not. To me this is rather odd behavior, but that is what I am seeing.

Great spot, Bob! :)