Creating a Custom Toolbar

Create a new HTML file and save it as MyToolbar.html. Place it in the same directory as the other files. You may completely customize this page by adding links graphics or other web content, and use these objects to control the report viewer. Bear in mind two things when using functions in the API:

Example

An example of a custom Toolbar page follows.


<HTML>

<head>

<META content="text/html; charset=unicode" http-equiv=Content-Type>

<SCRIPT src="htmlviewer.js"></SCRIPT>

<SCRIPT language="Javascript">


var currentPage = 1;

var numPages;


function Next()

{

    if (currentPage+1 > numPages && numPages != 0)

    {

        alert ("This is the last page");

    } else

    {

        currentPage=currentPage+1;

        parent.gotoPage (currentPage);

    }

}


function Prev()

{

    if (currentPage-1 == 0)

        alert("This is the first page");

    else

    {

    currentPage=currentPage-1;

    parent.gotoPage (currentPage);

    }

}


function onReportPageLoad ( PageN, TPageN, brch, drillName, subrpt )

{

    numPages = TPageN;

    currentPage= PageN;

}


</SCRIPT>


</head>

<BODY>

    <A href="javascript:Prev();"  onMouseClick="Prev();">&lt;&lt; Previous</a>&nbsp;|

    <A href="javascript:Next();"  onMouseClick="Next();"> Next &gt;&gt; </a>



</BODY>

</HTML>



End of lesson

This is all you need to create your own viewer. For a description of the functions and features in the HTML Frame API, see DHTML with Frames.



Crystal Decisions, Inc.
http://www.crystaldecisions.com
Support services:
http://support.crystaldecisions.com