Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » To load the report in the same page
To load the report in the same page [message #529215] Fri, 23 April 2010 13:35 Go to next message
sen K is currently offline sen KFriend
Messages: 28
Registered: April 2010
Junior Member
Hi,

Can I have some input - to achieve this one.
For example my window has two different <div> tag.
In the first DIV tag i am getting my report parameters and in the second DIV tag itself I have to load the reportviewer.

Somebody post any idea,please.

My jsp page, like this -

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/birt.tld" prefix="birt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>
<h1> Cascade Parameter </h1>
<birt:parameterPage id="CasecadeReport" name="page1" reportDesign="Report_Cascade_Param_new.rptdesign"
isCustom="true" pattern="frameset">
<div style="border: 2px solid rgb(0, 0, 0); width: 1240px; height: 90px; overflow: auto;">
<table>
<tr><td>
Domain Code: <birt:paramDef id="1" name="domain_Code" /></td><td></td>
<td>Project Code: <birt:paramDef id="2" name="project_Code"/></td><td></td>
<td></td><td>
<input type="submit" name="submit" value="View Report"/></td>
<br><br>
</tr>
</table>
</div>
</birt:parameterPage>
<br>
</form>
</body>
</html>

Thanks
sen




Re: To load the report in the same page [message #529228 is a reply to message #529215] Fri, 23 April 2010 14:08 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

You can get the parameterPage tag to call some JavaScript like:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>
<script>
function runReport(form){
alert(form.innerHTML);
form.submit();
}
</script>

<birt:parameterPage id="birtParmPage" reportDesign="TopNPercent.rptdesign"
name="my form"
pattern="frameset"
height="600"
width="800"
format="html"
title="My Viewer Tag"
isCustom="true"
showTitle="true"
showToolBar="true"
showNavigationBar="true"
>
TOP COUNT PARAMETER
<input type="Text" name="Top Count">
<br><br>
TOP PERCENT PARAMETER
<input type="Text" name="Top Percentage">
<br><br>
<input type="BUTTON" value="Run Report" OnClick="runReport(this.form)">
</birt:parameterPage>
</body>
</html>



Maybe use some script similar to:
function loadIframe(iframeName) {
if ( window.frames[iframeName] ) {
window.frames[iframeName].location =
window.frames[iframeName].location + "&__overwrite=true";
return false;
}else{
return true;
}
}

Where iframeName is the id of the birtviewer tag. The &__overwrite=true
just makes the report re-run. You might want to first check to see if
the __overwrite parameter exists first.

Jason


On 4/23/2010 9:35 AM, sen K wrote:
> Hi,
>
> Can I have some input - to achieve this one.
> For example my window has two different <div> tag.
> In the first DIV tag i am getting my report parameters and in the second
> DIV tag itself I have to load the reportviewer.
>
> Somebody post any idea,please.
>
> My jsp page, like this -
> <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
> pageEncoding="ISO-8859-1"%>
> <%@ taglib uri="/birt.tld" prefix="birt" %>
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
> </head>
> <body>
> <h1> Cascade Parameter </h1>
> <birt:parameterPage id="CasecadeReport" name="page1"
> reportDesign="Report_Cascade_Param_new.rptdesign"
> isCustom="true" pattern="frameset">
> <div style="border: 2px solid rgb(0, 0, 0); width: 1240px; height: 90px;
> overflow: auto;">
> <table>
> <tr><td>
> Domain Code: <birt:paramDef id="1" name="domain_Code" /></td><td></td>
> <td>Project Code: <birt:paramDef id="2" name="project_Code"/></td><td></td>
> <td></td><td>
> <input type="submit" name="submit" value="View Report"/></td>
> <br><br>
> </tr>
> </table>
> </div></birt:parameterPage>
> <br>
> </form>
> </body>
> </html>
>
> Thanks
> sen
>
>
>
>
>
Re: To load the report in the same page [message #529248 is a reply to message #529228] Fri, 23 April 2010 15:12 Go to previous messageGo to next message
sen K is currently offline sen KFriend
Messages: 28
Registered: April 2010
Junior Member
I included the script in my jsp as follows -

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/birt.tld" prefix="birt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>
<script>
function runReport(form){
//alert(form.innerHTML);
form.submit();
}
</script>

<h1> Cascade Parameter </h1>
<birt:parameterPage id="CasecadeReport" name="page1" reportDesign="Report_Cascade_Param_new.rptdesign"
isCustom="true" pattern="frameset">
<div style="border: 2px solid rgb(0, 0, 0); width: 1240px; height: 90px; overflow: auto;">
<table>
<tr><td>
Domain Code: <birt:paramDef id="1" name="domain_Code" /></td><td></td>
<td>Project Code: <birt:paramDef id="2" name="project_Code"/></td><td></td>
<td></td><td>
<input type="submit" name="submit" value="View Report" OnClick="runReport(this.form)"/></td>
<br><br>
</tr>
</table>
</div>
</birt:parameterPage>
<br>
</body>
</html>

But I am not clear, where to make script you mentioned

function loadIframe(iframeName) {
if ( window.frames[iframeName] ) {
window.frames[iframeName].location =
window.frames[iframeName].location + "&__overwrite=true";
return false;
}else{
return true;
}
}

plear clear me

Sen
Re: To load the report in the same page [message #529270 is a reply to message #529248] Fri, 23 April 2010 16:24 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

What I meant was to change the runReport script to use the second
script. The JSP page should also have the viewer tag included as well.

Jason

On 4/23/2010 11:12 AM, sen K wrote:
> I included the script in my jsp as follows -
>
> <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
> pageEncoding="ISO-8859-1"%>
> <%@ taglib uri="/birt.tld" prefix="birt" %>
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
> </head>
> <body>
> <script>
> function runReport(form){
> //alert(form.innerHTML);
> form.submit();
> }
> </script>
>
> <h1> Cascade Parameter </h1>
> <birt:parameterPage id="CasecadeReport" name="page1"
> reportDesign="Report_Cascade_Param_new.rptdesign"
> isCustom="true" pattern="frameset">
> <div style="border: 2px solid rgb(0, 0, 0); width: 1240px; height: 90px;
> overflow: auto;">
> <table>
> <tr><td>
> Domain Code: <birt:paramDef id="1" name="domain_Code" /></td><td></td>
> <td>Project Code: <birt:paramDef id="2" name="project_Code"/></td><td></td>
> <td></td><td>
> <input type="submit" name="submit" value="View Report"
> OnClick="runReport(this.form)"/></td>
> <br><br>
> </tr>
> </table>
> </div>
> </birt:parameterPage>
> <br>
> </body>
> </html>
>
> But I am not clear, where to make script you mentioned
> function loadIframe(iframeName) {
> if ( window.frames[iframeName] ) {
> window.frames[iframeName].location = window.frames[iframeName].location
> + "&__overwrite=true";
> return false;
> }else{
> return true;
> }
> }
>
> plear clear me
>
> Sen
Re: To load the report in the same page [message #529632 is a reply to message #529270] Mon, 26 April 2010 15:18 Go to previous message
sen K is currently offline sen KFriend
Messages: 28
Registered: April 2010
Junior Member
Hi,

can you please give some input to produce the output in the same window, without showing the window titlebar.

my code snippet is here -

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/birt.tld" prefix="birt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>

<script>

function runReport(){
alert("AAA");
//alert(form.innerHTML);
//window.open("about:blank", "", "width=500,height=500,toolbar=no");
//window.toolbar="no"


//window.open(" http://localhost:8081/birt-viewer/frameset?__id=CasecadeRepo rt&__title=Project+Tracking&__report=Report_Cascade_ Param_new.rp

tdesign");
return false;
form.submit();
}


</script>



<h1> Cascade Parameter </h1>
<p>

<birt:parameterPage id="CasecadeReport" name="page1" reportDesign="Report_Cascade_Param_new.rptdesign"
isCustom="true" pattern="frameset" position="fixed" title="Project Tracking" ></p>
<div style="border: 2px solid rgb(0, 0, 0); width: 1240px; height: 90px; overflow: auto;">
<table>
<tr><td>
Domain Code: <birt:paramDef id="1" name="domain_Code" /></td><td></td>
<td>Project Code: <birt:paramDef id="2" name="project_Code"/></td><td></td>
<td></td><td>
<input type="submit" name="submit" value="View Report" OnClick="runReport()" /></td>
<br><br>
</tr>
</table>
</div>
<br>
</birt:parameterPage>


<iframe name="CasecadeReport" frameborder="1" scrolling="auto" width="1245" height="620" marginwidth="5" marginheight="5" title="none"

></iframe>


</body>
</html>

I appreciate.

sen
Previous Topic:Cannot connect to datasource in deployed report
Next Topic:Set data set programatically
Goto Forum:
  


Current Time: Sat Apr 20 06:06:05 GMT 2024

Powered by FUDForum. Page generated in 0.04333 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top