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

Get page numbers in javascript

Started by aravind006, 02 Feb 2016 05:20:09 AM

Previous topic - Next topic

aravind006

Hi,

I want to get the page numbers from the cognos report, using javascript.
please let me know your suggestions.

Thanks ,
Aravind

BigChris

I don't think that's possible, but someone more schooled in JS than me might be able to give you a solution. The page numbers are only rendered when the report is run, based on the number of lines per page etc. which is why in HTML format it doesn't know how many pages there are in the as a whole.

afzaki7

Hi,

you can surround the PageNumber  by a div
put a PageNumber control from toolbox then put two HTML one before the PageNumber and the other after it

then in the first HTML put

<div id="pageNumber">

and in the second HTML put

</div>


then add another HTML wherever you want and put code like that

script>
function showPageNumber()
{
     var pageNumber = document.getElementById("pageNumber").firstChild;
     alert(pageNumber .innerHTML);
}
</script>
<button type="button" onclick="showPageNumber();" > Click Me!</button>


so you can alert the page number
use it as you want after that

" إِذَا مَاتَ ابْنُ آدَمَ انْقَطَعَ عَمَلُهُ إِلا مِنْ ثَلاثٍ : مِنْ صَدَقَةٍ جَارِيَةٍ ، أَوْ عِلْمٍ يُنْتَفَعُ بِهِ ، أَوْ وَلَدٍ صَالِحٍ يَدْعُو لَهُ "