Results 1 to 6 of 6
- 04-07-2010, 01:23 PM #1
Member
- Join Date
- Mar 2010
- Posts
- 16
- Rep Power
- 0
Mysql dynamic query, Java and Jasper report
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.
- 04-07-2010, 02:20 PM #2
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Cute, you are going to have to drink the schema reference to generate the jrxml files dynamically and then compile them dynamically too. Good luck.
- 04-08-2010, 08:50 AM #3
Member
- Join Date
- Apr 2010
- Posts
- 1
- Rep Power
- 0
Try DynamicReports is open source and based on JasperReports.
You can create reports dynamically without needing to use iReport
- 04-08-2010, 10:56 AM #4
Member
- Join Date
- Mar 2010
- Posts
- 16
- Rep Power
- 0
Thank you very much for your replies and informative link.
- 06-28-2010, 07:41 AM #5
Member
- Join Date
- Jun 2010
- Posts
- 1
- Rep Power
- 0
Same question...
Hello,
I have same problem.
Im generating PDF with jasper report, I can generate rows of table dynamically.
for that im passing arraylist of class to report.
but im not able to generate columns dynamically.
I think topic creater got solution... can you temme??
waiting for reply.. thank you :)
- 06-28-2010, 10:32 AM #6
Member
- Join Date
- Mar 2010
- Posts
- 16
- Rep Power
- 0
@omkarkelkar
I resolved the issue in other way. I started to use grouping concept. Group expression in ireport/jasper report helped me to define a particular criteria and then I was able to extract the data from existing database. Other choice was to use hashmap to put values and arraylist to do work on columns. I had to finish the task asap so I chose the earlier option of grouping. I didn't migrate to the dynamic change. I am picking up columns from existing data now. sorry for disappointment. Thank you.
Similar Threads
-
jasper report ,jasper report jar files and maven dependencies.
By rajuchacha007 in forum Advanced JavaReplies: 1Last Post: 04-09-2010, 08:15 AM -
jasper report
By vidhyaprabu in forum New To JavaReplies: 6Last Post: 11-12-2009, 03:31 AM -
Jasper Report
By sysout in forum New To JavaReplies: 12Last Post: 09-16-2009, 03:37 PM -
jasper report in struts
By saru_2785@rediff.com in forum Advanced JavaReplies: 2Last Post: 03-31-2009, 11:30 AM -
JSP and Jasper Report in Netbeans 6.1
By ShatireAzam in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 11-08-2008, 09:43 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks