Jump to content
We've recently updated our Privacy Statement, available here ×

nao921

Members
  • Posts

    9
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Downloads

Posts posted by nao921

  1.  I have a report that contains a pie chart within it. I would want the chart to be shown no matter if the query returns results or nothing at all. typically you just need to do the plot.setNoDataMessage() function, however since this is not exposed within iReport, i did it within the Customizer class (attached code)

    however when i run it with no data returning, it is giving me a blank page and iReport pops up with "the document has no pages"

    Please advise.

    Code:
    CategoryPlot plot = (CategoryPlot)chart.getPlot();    plot.setNoDataMessage("No data available so we go into this really "            + "long spiel about what that means and it runs off the end of the "            + "line but what can you do about that!");
  2.  I have a dashboard-like report that shows several charts on one single page; these charts are divided into subreports.

     

    i managed to put gradient background on charts using customized render class in ireport. i have attached the code i am using.

    the problem that i am having is that the gradientbackground is shared among all subreports, which means the charts higher up on the page will have light shade of gradient paint while the charts lower down will have a darker shade of gradient.

    how do i have the gradient background painted independently in each of the subreport chart?

    Code:
    public void customize(JFreeChart chart, JRChart jasperChart) {    int offset_x = jasperChart.getX();    int offset_y = jasperChart.getY();    Paint p = new GradientPaint(offset_x, offset_y, Color.WHITE, offset_x, offset_y+1500, Color.BLACK);    chart.setBackgroundPaint(p);
  3.  ok just figured things out

    this expression works:

     

    new Date((new Date()).getTime()-24*60*60*1000)

     

    did work for me at first coz i set the default value for my date prompt $P{reportDate} to 'new Date()', and whenever i blank the prompt, the current date is used instead of the expression i used in $V{reportDate} that is supposed to generate the yesterday's date

     

    the following expression doesn't work coz the function Calendar.add() returns void

     

    Calendar.getInstance().add(Calendar.DATE, -1).getTime()

     

     

×
×
  • Create New...