Jump to content

nao921

Members
  • Posts

    9
  • Joined

  • Last visited

nao921's Achievements

Rookie

Rookie (2/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. the above code acutally works already. somehow when you are in the viewer within ireport, the background is just in plain grey. However it looks great when you export it to PDF, the gradient background is independent to each chart no matter where the subreport chart is on the main report.
  2. great! exactly what i missed on! thank you very much madhlman!
  3. 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!");
  4. 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);
  5. look under *Subreport properties*, there is a field named *Return Values* use that to link subreport variables to variables in main report, which supposedly would allow you to use return values from subreport in main report
  6. 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()
  7. ok i am having the same problem.. no matter what expression i put, i still get today's current date. i have tried new Date((new Date()).getTime()-24*60*60*1000) Calendar.getInstance().add(Calendar.DATE, -1).getTime() none of these works. =( please advise
  8. ok as for the problem with creating new document, it's actually a permission issue with windows xp sp3. somehow i don't have permission right to the default home path @ c:\documents and settings\_user_\ changing to a different path solved the problem
×
×
  • Create New...