Win a copy of Emmy in the Key of Code this week in the General Computing 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 ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

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.





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 count your weasels before they've popped. And now for a mulberry bush related tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!