Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning 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
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

Jasper Reports from a written query of Java

 
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have simply created an empty report (jrxml) file and put some headers, I am not sure if I need
to put fields into my report. But I guess jasper reports will generate the rest for me.
Here this coding, I just can see the headers without details.
Do you know if I actually have to produce something when I worked on the report.
I don't want to dead set the query in iReport
Thanks
Jack
 
Bartender
Posts: 3648
16
Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's wrong with setting the query inside IReport? In fact weighing maintenance issue, changing the report itself vs changing java code and recompiling and deploying. Which one would you prefer.

Besides having the query in IReport can cater for requirement change such as add in a new field or remove one field, add a summary section or whatever you or the client can think of.

The java side for all report generation is basically the same. The only difference is the number of parameters (from your app) you need to pass into the report if any.
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

K. Tsang wrote:What's wrong with setting the query inside IReport? In fact weighing maintenance issue, changing the report itself vs changing java code and recompiling and deploying. Which one would you prefer.

Besides having the query in IReport can cater for requirement change such as add in a new field or remove one field, add a summary section or whatever you or the client can think of.

The java side for all report generation is basically the same. The only difference is the number of parameters (from your app) you need to pass into the report if any.



Actually I would like to run some queries like this, so that the customerID would be different each time
the parameter is fed into iReport.
String sql = "select * from customers where customers.CustomerID = " + customerID;
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello K Tsang,
I managed to get it work now.
But the problem is the render of text in Simplified/Traditional Chinese.
When I save the report to a pdf, the Chinese characters are gone.
The English words are okay.
https://coderanch.com/t/63485/open-source/Referencing-image-Jasper-Report

I had another issue, when I placed my report image in the same folder as the jrxml, there is error saying
Byte data not found at : ICJB.png

Thanks
Jack
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Maneesh Godbole wrote:Sounds like a font issue.
Check out http://mdahlman.wordpress.com/2010/05/28/jaspersoft-v3-7-font-extensions/



I want to know another thing, is that how do you set the $V{REPORT_NAME}
once I put into the report, also like labels with name like "G1Label"

http://www.youtube.com/watch?v=-UJylgZHLK4
Thanks
Jack
report-name-1.png
[Thumbnail for report-name-1.png]
report-name-2.png
[Thumbnail for report-name-2.png]
report-name-3.png
[Thumbnail for report-name-3.png]
 
When I was younger I felt like a man trapped inside a woman’s body. Then I was born. My twin is a tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic