locked
Master-Detail report RRS feed

  • Question

  • Hi all!

    I have a custom entity named Budget, and a related custom entity named Budget Details. I managed to build a ISV application to edit the Budget Details inside a tab in the Budget form, using the free WebGrid control. At the end, I have the Header data (master) in the Budget and the Details in Budget Details, related with a 1:N relation.

    I want to know how could I made a master-detail report type, in order to display the two entities in the same report, like this:

    BUDGET:
    =======
    Name: A Budget name             Creation Date: 03/23/2009    Due Date: 04/29/2009
    Att:  Mr. Smith                 Description: A Budget description

         BUDGET DETAILS:
         ===============
         Description                Quantity         Price          Total
         ----------------------------------------------------------------
         Item 1                        5             $ 1.05       $  5.25
         Item 2                       10             $ 2.00       $ 20.00
         ----------------------------------------------------------------
         TOTAL:                                                   $ 25.25


    And so on...

    I was trying with the CRM 4.0 Report Wizard, but I don't think it could help me on this. I then switch to use Visual Studio 2005 and create a Report project, but I don't find any sample, and I'm in a hurry!!!

    Please, any help will be appreciated.

    Regards!
    Monday, March 23, 2009 7:31 PM

Answers

  • ELSICI - 

    In order to accomplish this (it's a common task) - Create a simple report that only contains the budget report, then create a 2nd report that only displays the budget details. - 

    Add a 'subreport' to the budget report (parent) and configure the subreport to use the budget details report (child) - you'll need to pass a parameter from the parent to the child (new_BudgetId?) and filter the budget details subreport based on that parameter.

    Here is some information from Microsoft as to how to configure subreports:  http://msdn.microsoft.com/en-us/library/ms160348(SQL.90).aspx

    Hope that helps -
    Scott Sewell, CustomerEffective | http:\\blog.CustomerEffective.com | Twitter:@ScottSewell
    • Marked as answer by elsici Tuesday, March 24, 2009 3:42 PM
    Tuesday, March 24, 2009 8:52 AM
    Moderator

All replies

  • If you have your sql statement in place; this is rather easy in Visual Studio;

    1. File - New - Project
    2. Select Business Intelligence Project - Report Server Project
    3. ... follow the steps described by Jonas: http://gustafwesterlund.blogspot.com/2008_01_01_archive.html 



    Monday, March 23, 2009 8:00 PM
  • ELSICI - 

    In order to accomplish this (it's a common task) - Create a simple report that only contains the budget report, then create a 2nd report that only displays the budget details. - 

    Add a 'subreport' to the budget report (parent) and configure the subreport to use the budget details report (child) - you'll need to pass a parameter from the parent to the child (new_BudgetId?) and filter the budget details subreport based on that parameter.

    Here is some information from Microsoft as to how to configure subreports:  http://msdn.microsoft.com/en-us/library/ms160348(SQL.90).aspx

    Hope that helps -
    Scott Sewell, CustomerEffective | http:\\blog.CustomerEffective.com | Twitter:@ScottSewell
    • Marked as answer by elsici Tuesday, March 24, 2009 3:42 PM
    Tuesday, March 24, 2009 8:52 AM
    Moderator
  • Hi, Morten and Scott and thanks by your answers.

    I think that the subreport solution is great. Actually, I found a sample in the CRM (Orders report) that looks very similar with my situation. I downloaded the .rdl files and I'm working with them.

    I have MS VS 2008, not 2005, and I found a MS article about how to change the .rdl to .rdlc and viceversa. I hope I'll get the solution. I need VS, due to some customizations to the reports.

    Thanks again!
    Tuesday, March 24, 2009 3:42 PM
  • by the way - if you're looking at the out of the box reports, you may find them to be a little overly complicated. (They're written to try and cover a wide variety of configurations, by some very smart folks.) - If you're trying to learn how to write reports/subreports, don't be intimidated by the style / configuration of those reports. - Your report can be much simpler and work just as well.

    Here are two great introduction to how to edit the out of the box reports 
    This one from the MSDN blog:
    http://blogs.msdn.com/crm/archive/2008/03/20/customizing-report-templates.aspx
    And this one by Ronald Lemmen - 
    http://ronaldlemmen.blogspot.com/2008/12/dynamics-crm-report-modification.html

    Take a look at this series of 3 postings I did last year - they'll give you some insight into how those out of the box reports work and hopefully will steer you in the right direction on the report you're trying to create.
    http://blog.customereffective.com/blog/2008/06/pre-filtered-re.html
    http://blog.customereffective.com/blog/2008/07/dynamic-sql-rep.html
    http://blog.customereffective.com/blog/2008/07/developing-dyna.html

    Let me know if this is helpful.
    Scott Sewell, CustomerEffective | http:\\blog.CustomerEffective.com | Twitter:@ScottSewell
    Tuesday, March 24, 2009 4:16 PM
    Moderator
  • Scott:

    Your links are great! I was able to create my report. I didn't follow the subreport model. Due I only want to show one Budget with it's Budget Detail, I design a single report with 2 Datasets, one for Header and other for Detail.

    It works great! I design header, footer, pagination, and only pass one parameter, the BudgetID.

    Now I need to design a custom button or link or menu to launch it from the Budget Form, passing the BudgetID as parameter. Maybe I'll open another post asking about it...!!!

    Thanks a lot for all the information!
    Thursday, March 26, 2009 10:54 PM
  • I had a similar issue described but couldn`t find much to help me. After a whole day of searching the internet and reading books I discovered the following which has been blogged to help others. It uses Report Builder to create a simple Master Detail report using a single dataset and the List item. It can also be achieved in Visual Studio. It simple and looks great.

    Tony

    http://tnycrm.blogspot.com/2011/08/dynamics-crm-activitypointer-master.html

    • Proposed as answer by TD-CRM Tuesday, August 23, 2011 9:45 AM
    Tuesday, August 23, 2011 9:45 AM