Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Mysql dynamic query,java and japer report

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I have been working on Jasper report. I am using ireport. I have a database in mysql. I am connecting the database to the report in java. Working principle is as follows.

database connectivity-->java file-->export to .pdf file as front end japer report.

Earlier I used to design a static structure of the report. (coulmn names,title etc)Now, I wish to do the same within java itself dynamically. I have been thinking that one can't create columns dynamically without designing on ireport. Now, I want to know, whether there is any mechanism to create new columns and corresponding values as parameters(as arguments) while running the java file. This is what I am trying to implement. Let's take an example.

I have many tables like profile,describtion,schema etc from the database sample. I am selecting name,address, accountNo from these 3 tables respectively. I might be having more tables and correspondning values in the columns. I might select 2 tables and 3 columns or 3 tables 4 columns or many other valid combinations. I want to know, is it possible to achieve such mechanim of dynamic mysql query within jasper report if I have not designed these columns in the .jrxml file. I have many tables. I can not design each and every table on .jrxml file. I believe I am explaning the problem apporpriatly. Pleae do let me know if you know any possible solution.

e.g.

select
name,address,accountNo

from
profile,describtion,schema,

where
....
....
;

Thank you in advance. I would welcome your suggestions.
I will edit this post tomorrow and upload whatever I have been trying ASAP.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!