How to create a relation between data?

Hello everyone,

I am using XML files as my data source and still struggling a bit with the learning curve...

Looking at the Master-Detail report sample, I saw that the data has a parent / child relationship (See attached pictures).

How do I do this?

My XML file has parent and child nodes, but this seems to be ignored completely by Fast Reports... Do I have to specify this explicitly in some way?

Thank you for your help, I really appreciate it.
-Matt-

Comments

  • edited 3:54PM

    Thank you for your help, but I still have not been able to get Fast Reports to work, so I was trying to try a different solution. No matter what I do, once Fast Reports has my data it strips it of any structure that it had previously (which can't possibly be the goal...).

    I contacted Fast Reports and they told me that I need to add a Summary_ID property in the "Rooms" table, but I can't get an answer as to what that means or what that property should actually be...

    It seems to me that when you're generating a report based on structured XML Data, that the report engine should honor the structure you have in place. I'm really confused as to why Fast Reports disregards all of this, and at a complete loss as to how to use Fast Reports to generate this report.

    I still haven't even been able to get the footer to print on my other report...

    I don't mean to vent, but it is incredibly frustrating to have data that is structured and organized only to have it treated as a flat file by Fast Reports and then be unable to get answers to questions from support.

    How are other people able to get reports working?
  • edited September 2017
    i really dont get it, where is your problem, you may download a full demo about 'deserialize xml to business object' :
    https://dl.dropboxusercontent.com/1/view/x8...inessobject.rar

    it is completely from my previous answer > .... http://www.fast-report.com/en/forum/?p=/discussion/14027


    note: i use the same method to parse json data from web, the difference is : newtonsoft json library, in your case, for xml, is using system.xml.serialization library from microsoft.
    you must know data structure in order to convert to class (business object)
  • edited 3:54PM
    Thank you very much. I have to apologize for my prior post, I'm just a bit frustrated... I am sorry if too much frustration came through in my post...

    I was able to find the issue (I'm pretty sure).

    I had an error in the suggestion you made (not yours, an error I created when I was copying it over). This resulted in that not working. Try as a might, I just couldn't find this error previously.

    Then I contacted Fast Reports support and they made a number of recommendations that looked nothing like yours, so in my effort to try those, I made a bit of a mess of all of the conflicting code (again, my own fault) that resulted in more issues.

    I have cleaned everything up and recreated your solution and was able to get most of the data over.

    I've attached a picture showing the data organized in Fast Reports. Thank you!

    One last question, because I don't fully understand the code (I'm working on that), but how would I add more parent level datatables (such as Rooms in the example here)?

    I also send over a group of data called Software and one called Summary.

    I would like those to appear like this:

    Software
    Summary
    Rooms
    -Offsets
    -Openings
    -Items

    I was going to add them to Rooms, but since they contain data that prints on the first page of the report (before the Room info, etc.), I assumed that that would cause it to print the first page over and over again as well?

    Thank you again for your help. I apologize for the confusion I created.
  • edited 3:54PM
    Sorry, I forgot to hit the "upload" button.
  • edited 3:54PM
    ipong wrote: »

    Thank you, I will take a look at that this weekend.

    I appreciate your help with this.

    I have never worked with reporting before, and it is definitely a very different way of thinking for sure. I'm doing my best to understand it though.

    Thanks again!
  • edited 3:54PM
    Thank you very much, that works perfectly. I spent much of the weekend going through the code that you provided, and I feel that I understand it much better now as well. I really appreciate all of your help with this and your patience with me.

    I really, really appreciate it.
  • edited 3:54PM
    Excellent Tips. I think it will be very helpful for me.
    actual test 300 075

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.