none
about a serious shortcoming of the reporting tools in VS (2008 included) RRS feed

  • Question

  •  

    Hello to the developer team of VS !

     

    As I started to discuss in my threat on the ASP.NET forum, I have an important wish for the future of VS reporting. (http://forums.asp.net/t/1202561.aspx)

     

    The .NET programming world is deeply oo ... but not its reporting tools !

     

    As explained in the mentioned thread I do not see any straight forward solution to solve the following scenario with an object data source:

     

    Lets have some imaginary classes to illustrate :

     

     

    Code Snippet

    Public Class Parent

    Public Property Name() As String

    Get

    '...

    End Get

    Set(ByVal value As String)

    '...

    End Set

    End Property

     

    Public Property ChildList() As List(Of Child)

    Get

    '...

    End Get

    Set(ByVal value As List(Of Child))

    '...

    End Set

    End Property

    End Class

     

    Public Class Child

    Public Property Name() As String

    Get

    '...

    End Get

    Set(ByVal value As String)

    '...

    End Set

    End Property

    End Class

     

     

    Now lets say that I have a list of objects of the Type Parent (each one having some child objects in the property ChildList). I want to build a report that prints all the Parent objects (in the case their Name) end beneath the names of the Child objects.

    Now this is not possible to do with an object data source ! You may not feed a subreport with a list that is a property of the object that figures in the "Parent" report.

     

    Isn't that something ? But it is one of the most common scenarios that you may meet when it comes to reporting with object data sources.

     

    I would be so happy if somebody could show me that I am wrong and how to do it ... and if not, that one of the makers of .NET comes and says  - Fabian, don't worry, I'll take that into may todo list.

     

    Thanks a lot for reading my post.

     

    Regards,
    Fabian

    Monday, March 3, 2008 10:09 PM

All replies

  • Ok, I'm not completely sure what your trying to accomplish here.  The thread you linked refers to crystal reports, which I have little experience with. 

     

    The reportviewer control and it's associated rdl/rdlc files can handle a lot of different scenarios.  I think with a full understanding of what your trying to accomplish we could possibly present you with a valid solution using the reportviewer control.

     

    referencing your other thread, but considering the MS reportviwer,  You can hand a datasource to the main report programmaticallly, which I think is what you'll need,  and then bind a seperate datasource to a subreport, and using a parameter in the subreport, pass a value from the main report to the subreport and filter off that value.

     

    The only issue I see you having is considering the format your data will be in, and how you want to hand it to the report viewer.

    Tuesday, March 4, 2008 3:22 PM
  • Hello Blast2hell,

     

     

    thanks for your interest.

     

    >>The thread you linked refers to crystal reports, which I have little experience with.

     

    I was talking about Cristal Reports as one of the two solutions in VS to produce reports. I do not mind about the tool, I just need a solution.

     

    >>I think with a full understanding of what your trying to accomplish we could possibly present you with a valid solution using the reportviewer control.

     

    What do you mean by "full understanding", what is missing in my first post?

     

    >>You can hand a datasource to the main report programmaticallly

     

    That's not a problem for me.

     

    >>and then bind a seperate datasource to a subreport, and using a parameter in the subreport, pass a value from the main report to the subreport and filter off that value.

     

    That's where is the problem: I want to set the datasource of the subreport to be the List object which is a property of my Parent object. There is no parameter that I could pass to link the child objects to the parent object because the attribution of the child objects to their parent objects is done with complex criteria.

     

    >>The only issue I see you having is considering the format your data will be in

    The data is in the form of objects - an object data source ...

     

    Thanks for any further help !

    Regards,

    Fabian

    Tuesday, March 4, 2008 6:10 PM
  • Ok,, now I think I understand your problem,  You know how to bind everything, trigger the subreport event and all, the problem is in passing a parameter to the subreport since your using objects.

     

    Ok, so, ignoring the reports all together, what's the relationship between the parent object and the child object?  In other words, how would the parent object call something in the child object if we weren't using reports?

     

    Oh, duh...I just read the code again....like you said it's just a property.  Hmmm, well let me think on this.

     

     

    Tuesday, March 4, 2008 6:17 PM
  • Dear Blast2hell,

    I appreciate a lot your concerne !

     

    Thanks for any further conciderations!

     

    Best regards,
    Fabianus

    Wednesday, March 5, 2008 11:53 AM
  • Well, I'm not sure how much help I could be, I don't have time to mess with what you are trying to accomplish, and currently I employ datatables as my datasource for my reports.

     

    my best solution would be to consider using LINQ to organize your data into something more managable for the report, but I don't feel this is a very "cool" considering what you want.

     

    Or modify your object to be more "Key" dependant, that way you'd have something to pass to the subreport. but this may not be an option for you.

     

    Wednesday, March 5, 2008 4:35 PM
  •  

    dear Rajeev,

     

    Thanks so much for this interesting link. I may not download the AuthorBooks.zip (password required).

     

    Do you have any official Link?

     

    Regards,

    Fabianus

    Friday, March 7, 2008 10:09 PM