To retrieve a bookmark for relational reports, specify the location, the name of the bookmark, and the “load” operation. In order for the bookmark to be loaded successfully, the underlying data source needs to be available for live data to be retrieved. The following example demonstrates how to generate a list of bookmarks saved in the repository and make each bookmark a link:
<%@ taglib uri="bloxreporttld" prefix="bloxreport"
<%@ page errorPage="error.jsp"
<html>
<head>
<title>List Bookmarks</title>
</head>
<body>
<p>Your bookmarks:</p>
<bloxreport:persistence id="repository" />
<table>
<%
String[] files = repository.list("sales/east",
repository.LIST_TYPE_STATES );
for( int i = 0; i < files.length; i++){
<tr><td><a href="load.jsp?bookmark=<%= files[i] ">
<%= files[i] </td></tr>
<%
}
</table>
</body>
</html>
<%@ taglib uri="bloxreporttld" prefix="bloxreport" <%@ page errorPage="error.jsp"
<html> <head> <title>Loading Bookmark</title> <link rel="stylesheet" href="/AlphabloxServer/theme/report.css"> </head>
<%
String bookmark = request.getParameter( "bookmark" );
<h1>Bookmark: <%= bookmark </h1>
<%
if( bookmark != null ) {
<bloxreport:persistence
location="sales/east"
persistedName="<%= bookmark "
operation="load" />
<%
}
</html>
It’s important to know that when a bookmarked report is loaded, PersistenceBlox creates an instance of the ReportBlox object on the server. If an instance already exists in the session, PersistenceBlox will overwrite the old instance. The Saving and Exporting Data with Dynamic Queries example in Blox Sampler - Relational Reporting demonstrates how you can manage this issue using bloxName.