Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » call birt reports from java(Implement birt reports in java class)
icon7.gif  call birt reports from java [message #728548] Fri, 23 September 2011 13:16 Go to next message
claudia_fichte is currently offline claudia_fichteFriend
Messages: 1
Registered: September 2011
Junior Member
Hello,

can you please help me? How it's possible to start a birt report from a java class.
I'm using struts framwork and want to start different reports inside the action class. How is this possible? Instead of using javascript I want to do this in the action class:

function loadViewerchartViewer(){
var formObj = document.getElementById( "form_reports" );
// plant
var param = document.createElement( "INPUT" );
//find plant param
param.type = "HIDDEN";
param.name = "plant";
param.value = document.getElementById("plantId").options[document.getElementById("plantId").selectedIndex].text;
formObj.appendChild(param);

//find report name
param.type = "HIDDEN";
param.name = "reportId";
param.value = document.getElementById("id").options[document.getElementById("id").selectedIndex].text;
formObj.appendChild(param);

// subfamily
if (document.getElementById("wert1_2") != null && document.getElementById("wert1_2").selectedIndex > -1) {
var param = document.createElement( "INPUT" );
param.type = "HIDDEN";
param.name = "subfamily";
param.value= document.getElementById("wert1_2").options[document.getElementById("wert1_2").selectedIndex].text;
formObj.appendChild(param);
}

formObj.action = "
formObj.target = "_new";
formObj.submit();
}
Can anybody help me?

In the java class I want to start the reports inside this function:
public void go_onClick(FormActionContext ctx) throws InvalidUserException,
ParseException, Exception {
logger.info("go_onclicked Gladius Export action");
}

Thank you
Re: call birt reports from java [message #728559 is a reply to message #728548] Fri, 23 September 2011 13:29 Go to previous messageGo to next message
Jean-Baptiste Guillois is currently offline Jean-Baptiste GuilloisFriend
Messages: 33
Registered: August 2011
Member
Hello Claudia,
If you want to trigger reports rendering from within a struts action, you should have a look on the Task rendering APIs which allow you to schedule the rendering of a report and get the result either as HTML, PDF or any other format supported by BIRT emitters.

You could also forward your action to a BIRT ReportViewer (deployed in servlet container of your choice) to let the user interact with the report parameters...

Regards,

Jean-Baptiste
Re: call birt reports from java [message #728677 is a reply to message #728548] Fri, 23 September 2011 15:58 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Are you wanting to call the BIRT engine API or a URL to the deployed
BIRT Viewer? What version of BIRT are you using?

Jason

On 9/23/2011 9:16 AM, claudia_fichte wrote:
> Hello,
>
> can you please help me? How it's possible to start a birt report from a
> java class.
> I'm using struts framwork and want to start different reports inside the
> action class. How is this possible? Instead of using javascript I want
> to do this in the action class:
> function loadViewerchartViewer(){
> var formObj = document.getElementById( "form_reports" );
> // plant
> var param = document.createElement( "INPUT" ); //find plant param
> param.type = "HIDDEN";
> param.name = "plant";
> param.value =
> document.getElementById("plantId").options[document.getElementById("plantId").selectedIndex].text;
>
> formObj.appendChild(param);
> //find report name
> param.type = "HIDDEN";
> param.name = "reportId";
> param.value =
> document.getElementById("id").options[document.getElementById("id").selectedIndex].text;
>
> formObj.appendChild(param);
>
> // subfamily
> if (document.getElementById("wert1_2") != null &&
> document.getElementById("wert1_2").selectedIndex > -1) { var param =
> document.createElement( "INPUT" );
> param.type = "HIDDEN";
> param.name = "subfamily";
> param.value=
> document.getElementById("wert1_2").options[document.getElementById("wert1_2").selectedIndex].text;
>
> formObj.appendChild(param);
> }
>
> formObj.action = "
> formObj.target = "_new";
> formObj.submit();
> }
> Can anybody help me?
>
> In the java class I want to start the reports inside this function:
> public void go_onClick(FormActionContext ctx) throws InvalidUserException,
> ParseException, Exception {
> logger.info("go_onclicked Gladius Export action");
> }
>
> Thank you
Previous Topic:Why aren't all the data set columns in the 'Available Column Bindings' list?
Next Topic:Deploying the latest BIRT-viewer on JBoss 5.1.0 fails
Goto Forum:
  


Current Time: Fri Dec 19 04:53:06 GMT 2014

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

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