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

Footer question - page numbering format

Started by ry1633, 19 Aug 2015 10:01:18 AM

Previous topic - Next topic

ry1633

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:


  • 1of3
    1 (1of3)

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.

BigChris

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.

BigChris

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.

ry1633

#3
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.


MFGF

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.
Meep!

ry1633

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.

MFGF

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.
Meep!

BigChris

You've used ParamCount() instead of PageCount()...

ry1633

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.

MFGF

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.
Meep!

ry1633

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.

Michael75

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?

ry1633

#12
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?

bdbits

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.


MFGF

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.
Meep!

ry1633

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.

bdbits

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?

ry1633

I'm using Report Studio 10.2.1 with IE 11.0.9600.19759

bdbits

Is compatibility mode enabled for your Cognos URL?

ry1633

I'm not that admin for our Cognos instance, so I'd have to check that.  where can I find that out?

bdbits

Compatibility mode is a reference to an Internet Explorer setting.
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.

MFGF

#21
Hmmm. I see the same when creating a new report and choosing the "Report Template" template from the list.



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.
Meep!

bdbits

#22
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.

MFGF

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! :)
Meep!