Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
How to set table bookmark?
pooh
Hi,
How do I set bookmark for my table?
I would like to set it "mytable", I went to properties => Advanced => Bookmark and type "mytable" in the Javascript window. However I do get error when I run the report
Find more posts tagged with
Comments
mwilliams
There is a bookmark section in the property editor as well. You don't have to go to the advanced properties. I would think what you put would work. What is the error you're getting? What is your BIRT version?
pooh
hi,<br />
<br />
thanks for the reply.<br />
<br />
ok i used the property editor and label it "mytable"<br />
<br />
however when I do the following, I don't get anything when I try to alert the request.getBookmarkName(). It hangs there <br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
dataService = new actuate.DataService("http://localhost:8900/iportal/" );
request = new actuate.data.Request("mytable");
request.setStartRow( 1 );
request.setMaxRows( 50 );
alert(request.getBookmarkName());
</pre>
mwilliams
Is getBookmarkName() a function of the data request in the JSAPI? I haven't looked in the documentation for it.
pooh
sorry my bad. it's request.getBookmark().<br />
<br />
Btw, do you know how to use the actuate.DataService.downloadResultSet?<br />
<br />
My code stops at displayData - rs.getColumnNames called. I checked the API, getColumnNames() is a function for resultset<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
function displayData(rs)
{
alert("displayData");
var columns = rs.getColumnNames();
alert(columns);
while (rs.next()){
for (var i = 0; i < columns.length; i++){
window.alert(rs.getValue(columns[i]));
}
}
}
callBackError=function(exception){ window.alert('ERROR: ' + exception); };
function createDataService()
{
alert("createDataService");
dataService = new actuate.DataService("http://localhost:8900/iportal/" );
request = new actuate.data.Request("mytable");
request.setStartRow( 1 );
request.setMaxRows( 50 );
dataService.downloadResultSet( "/Home/administrator/ci_reports/table.report.rptdesign", request, displayData(request));
}
</pre>
mwilliams
So, it works now with getBookmark()?
What are you passing through as "rs"?
pooh
Yep, getBookmark works now. I used the wrong function previously.<br />
<br />
I am following the example in the documentation actually : <br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
myDataService.downloadResultSet("Quarterly Sales", mySalesRequest, makeAscendingSales(mySalesRequest),errorCallback(handler);
</pre>
<br />
I have never used this before actually. I just want to get the data using the data service so that I can manipulate the data myself before displaying. Do you have any examples of that? Basically I want to access the data directly without it being displayed as table or chart.
mwilliams
Code like this should allow you to grab the data from your created .rptdocument and pass it to a function in which you manipulate the data:
myDataService.downloadResultSet( ?/public/myReport.rptdocument?, request, downloadeddata );
function downloadeddata(resultSet)
{
//process the downloaded resultset here?
}
This code is from the JSAPI section in the wiki getting started guide.
pooh
hi,
thanks so much for taking time replying me.
I tried, I get these errors :
ERROR: TypeError: this._service.apiInstance._getEventHandlers is not a function
in my error callback function when i run it.
I even tried running this example (
http://www.birt-exchange.org/org/devshare/deploying-birt-reports/1013-executing-a-birt-report-using-javascript/)
and got the same error
mwilliams
After lunch, I'll take a look at the devShare example you attached and see if I can get it running. I see that it was created for A10, so maybe something has changed on this in A11. I'll let you know what I find.
pooh
thanks alot william
pooh
Hi Williams,
Any input on this? Thanks in advanced!
mwilliams
Ok, something had changed from A10 to A11. Prototype.js was removed so that it wouldn't interfere with usage of this in customer applications. To get this example to work, you'll need to create your own XmlHttpRequest to run and save the report. Or you could just make prototype.js available. So, you'll need to make sure the .rptdocument is available for you to use the JSAPI to use the data service.
pooh
Hi Williams,
Do you have any sample application with this working at all with XmlHttpRequest ? Is there any Actuate JSApi personals we can contact for technical help?
pooh
hi,
i have tried including prototype.js, but it still doesn't seem to work.
mwilliams
I emailed one of the sales engineers to see if they could help you out a little more than I can with the commercial software. He should be getting to you soon if he hasn't already. In the meantime, feel free to continue to ask me questions and I'll try to help as much as I can!
Loop
Hi,
I have the same kind of problem.
In the .rptdocument there are only a table with a bookmark new String("Stuff").
When try to get the bookmarked table data with:
var myRequest = new actuate.data.Request("Stuff, 1, 0);
var myDataService = new actuate.DataService( "
http://..........:8900/iportal"
; );
myDataService.downloadResultSet("/stuff/Report Designs/AssetParameter.rptdesign", myRequest,
function(res){
console.log(res.length);
},
function(err){
console.log(err.getDescription());
}
);
it throws a
TypeError: this._service.apiInstance._getEventHandlers is not a function
http://.............:8900/iportal/iv/viewer/viewer.js
Line 1
Do you have any idea, or if it has a solution can you share?
Used version:
Actuate Information Console version: 2 (Build 220A130129)
Actuate BIRT iHub version: 2 (Build 220A130129)
Thanks in advance