Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Customizing the Interactive Viewer
al91206
We are currently trying to explode the dropdown functionality onto the top toolbar on the interactive viewer.
For the print button we used:
<TD>
<SCRIPT TYPE="text/javascript">
function printmode()
{
var viewer = actuate.getViewer("container");
if (viewer)
{
viewer.enablePrint(function () {
document.getElementById("enableprintlink").innerHTML = "";
});
}
}
</SCRIPT>
<A HREF="javascript:void(0)" ONCLICK="printmode()" id="enableprintlink">Print</A>
</TD>
</SCRIPT>
<A HREF="javascript:void(0)" ONCLICK="printmode()" id="enableprintlink">Print</A>
</TD>
We are getting a javascript error: Object [object Object] has no method 'enablePrint'
Any help is appreciated.
Thanks,
Al in SoCal
Find more posts tagged with
Comments
averma
Hi Al,<br />
<br />
enablePrint method does not take a callback function as an input argument, it only takes boolean value and is available with UIOptions class. Here is a link to documentation on Javascript API:<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/documentation/Manuals10SP1/programming-jsapi.pdf'>http://www.birt-exchange.org/documentation/Manuals10SP1/programming-jsapi.pdf</a><br
/>
<br />
Change you printmode function as follows to make it work:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
function printmode()
{
var viewer = actuate.getViewer("container");
if (viewer)
{
var ui = new actuate.viewer.UIOptions();
ui.enablePrint(true);
viewer.setUIOptions(ui);
document.getElementById("enableprintlink").innerHTML = "";
}
}
</pre>
<br />
<br />
Ashwini
al91206
We got “Enable Interactivity”, “Print” and “Export Content” exploded onto the tool bar from the drop down but we are struggling to get “Parameters” options up there as well. This is how we accomplished those 3 :
/////////// Code to put Print On the Tool bar //////////////////////////////
function printmode()
{
var viewer = actuate.getViewer("container");
if (viewer)
{
viewer.showPrintDialog(function () {
});
}
}
///////////////////////////////////////////////////////////////////////////
///////// Code to put Export Content on the tool bar /////////////////////
function exportmode()
{
var viewer = actuate.getViewer("container");
if (viewer)
{
viewer.showExportReportDialog(function () {
});
}
}
/////////////////////////////////////////////////////////////////////
Similarly, we got “Enable Interactivity” working as well. But “Parameters” does not work the same way. We also tried the following code for “Parameters” :
function parametermode()
{
var viewer = actuate.getViewer("container");
if (viewer)
{
var ui = new actuate.viewer.UIOptions();
ui.enableParameterPage(true);
viewer.setUIOptions(ui);
alert("complete");
}
}
In the code above, I think enableParameterPage() function executes fine because the alert(“complete”) shows up but it does not open the Parameters page.
Any help will be appreciated.
Thanks!
averma
Hi Al,<br />
UIOptions.enableParameterPage only display's or hides Parameters menu option. At the moment actuate.viewer class does not provide a JSAPI function to display parameter panel in the Information Console Viewer. However you can call<br />
actuate.Parameters methods to prepare a parameters page and display parameters in the assigned <div> element. You can find more information and samples codes in "Using and submitting report parameters" section of the JSAPI documentation:<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/documentation/Manuals10SP1/programming-jsapi.pdf'>http://www.birt-exchange.org/documentation/Manuals10SP1/programming-jsapi.pdf</a><br
/>
<br />
<br />
Ashwini