• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Jasper Reports from a written query of Java

 
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds like a font issue.
Check out http://mdahlman.wordpress.com/2010/05/28/jaspersoft-v3-7-font-extensions/
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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]
 
I was her plaything! And so was this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic