• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

parameter passed from jsp to sql query

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I have a parameter in a jsp page in a Struts application.
I have a JDBC data source and Data set in BIRT reports.
the SQL query is "select Contents from user where Header = ? "
I have a ReportParameter called HeaderParameter. I have a dataset Parameter also which is linked to the ReportParameter.

When I run the application, the parameter from the jsp page should be passed to the BIRT report as the value for ? in the where clause.

I have put the parameter in the application like request.getSession.setAttribute("a1", a1);

in the beforeOpen of the dataset, I have added the following:
var session = reportContext.getHttpServletRequest().getSession();
var myid = session.getAttribute("a[1]");


When I run the application, the parameter from the jsp page should automatically be inserted in the sql query and I want the values
to be displayed on the report.

I am not able to insert the value in the query. When I run the application, I get the Parameter page for the ReportParameter, which defeats
the idea of passing the parameter from jsp.

Can somebody help me?

Thanks
neeti
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Should it not be?



Note I've taken out the '[' and ']'
 
Neeti Raghunath
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an array of parameters... I am just trying to display one right now....

Do you know how to get the attribute values of array of parameters?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic