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

idrinkjava

Members
  • Posts

    5
  • Joined

  • Last visited

idrinkjava'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. I have two dates, one the current date and one which is passed in from an XML document. I need to know if the current date is past/greater than the passed in date. So for example: current date = 06/22/2011 passed in date = 06/01/2011 I need to be able to do something like this: currentDate.compareTo(passedDate) and figure out which date is the most recent. From my research I have seen nothing as far as how to accomplish this. Thanks for your help.
  2. I don't believe that you are going to be able to run the subreport and see the resulting data. I know that when I do this iReport says that it can't find the data source. Basically, the sub report is displaying the data that it is passed and cannot find that data without the extension that is passed through the subDataSource parameter.
  3. Aitor, You need to link the master report to the sub reports. Assume this XML tree structure: /document/user/enrollments/enrollment/assignments If I wanted to create a subreport to output the enrollment items I would set the data source of the main report to something like /document/user because I want to access information on the user level. I would then create a new subreport and tell it to use the same data source as the master, ect. You then need to go back to the main report and under the properties for that sub report you need to set the connection type to Use a datasource expression and enter something like the following for that Data Source Expression ((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("/user/enrollments/enrollment") In the sub report you would then set the root to be enrollment and then select the data items in that enrollment sub level. You want to make sure that they don't have an extension if you want the sub report to loop through like data. I guess the most important thing to remember is that the subreports know where they are in the XML tree because as you go down levels the extensions of the tree overlap. So in the example above the overlapping would look like this. /document/user /user/enrollments/enrollment /enrollment/*
  4. Code:Sorry about posting in the code window, the creation page wouldn't let me enter a message. With that being said, is there a way to pick and output just the first element from an XML list? From my research I have seen a getFirstChild() and getLastChild(). Thanks in advance for your help.
  5. I just started using iReport 4.0.2 and am trying to iterate through a nested XML file. I realize that this is probably elementary so excuse me if this is a stupid question. From all of the information that I have read on the web, in order to get at the nested information, I need to create subreports that return that data. I have a master report that pulls the header data and a subreport that gathers a list of data from one of these nested XML trees. For each heading that I generate on the master form, I would like to display it's children, the items nested under it. The problem that I am having is finding the correct way to link the forms together, i.e. telling the master form to display the information of the subreport on its page. Any help would be appreciated and thanks in advance for your help. Code: Post Edited by idrinkjava at 06/17/2011 13:10
×
×
  • Create New...