Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Master Detail report using Crystal Report in Visual C# 2010

Master Detail report using Crystal Report in Visual C# 2010

Scheduled Pinned Locked Moved C#
csharpdatabasequestionsql-servervisual-studio
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ahmed_one
    wrote on last edited by
    #1

    Hi to All, This is with reference to my earlier post Here. Short Description about project: Tools uses: Ms.Visual Studio 2010 ultimate edition, Sql Server & Crystal report. In earlier post, I was succeed to create N-tier application. Two classes Orders & OrderDetails were used to create new orders and add to database. Data Access Layer was used to establish Database connection and provide Sql base operations. Now I am willing to add reporting feature to my project, for a simple Report I can use following steps: 1-Add Typed DataSet in Visual Studio. 2-Based on that DataSet, create Crystal Report using wizard. 3-Using DAL class, to fetch data, create Report object and and set RecordSource property to Report object. This report was run successfully.. What I couldn't figure out is how I build Master/Detail report using same approach. How can I pass a DataSet which contains 2 DataTable Orders and OrderDetails to Report Object to display complete Order from Northwind Databse.

    T 1 Reply Last reply
    0
    • A ahmed_one

      Hi to All, This is with reference to my earlier post Here. Short Description about project: Tools uses: Ms.Visual Studio 2010 ultimate edition, Sql Server & Crystal report. In earlier post, I was succeed to create N-tier application. Two classes Orders & OrderDetails were used to create new orders and add to database. Data Access Layer was used to establish Database connection and provide Sql base operations. Now I am willing to add reporting feature to my project, for a simple Report I can use following steps: 1-Add Typed DataSet in Visual Studio. 2-Based on that DataSet, create Crystal Report using wizard. 3-Using DAL class, to fetch data, create Report object and and set RecordSource property to Report object. This report was run successfully.. What I couldn't figure out is how I build Master/Detail report using same approach. How can I pass a DataSet which contains 2 DataTable Orders and OrderDetails to Report Object to display complete Order from Northwind Databse.

      T Offline
      T Offline
      thatraja
      wrote on last edited by
      #2

      Two ways Using Groups Creating Crystal Report with Multiple Tables in ASP.NET[^] OR Using Subreports C# Crystal Reports - sub reports[^] C# Crystal Reports - on demand sub reports[^]

      thatraja

      Code converters | Education Needed No thanks, I am all stocked up. - Luc Pattyn When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is - Henry Minute

      A 1 Reply Last reply
      0
      • T thatraja

        Two ways Using Groups Creating Crystal Report with Multiple Tables in ASP.NET[^] OR Using Subreports C# Crystal Reports - sub reports[^] C# Crystal Reports - on demand sub reports[^]

        thatraja

        Code converters | Education Needed No thanks, I am all stocked up. - Luc Pattyn When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is - Henry Minute

        A Offline
        A Offline
        ahmed_one
        wrote on last edited by
        #3

        Thanks for the links...Let me try to clear the problem a little more: InvReport is the main report which contain a subreport. Which is based on DataSet1.xsd contains 2 Tables rptOrders and rptOrderdetails DataSet ds = Ord.GetOrdersByID(int.Parse(this.txtOrdID.text.ToString())); Above line call the GetOrdersByID method of Orders class which return Dataset consist of 2 tables Orders and OrderDetails. Then on a Print Button click event of Invoice form create an instance of InvReport invR, and set SetDataSource of invR to ds.Tables[0]. Lastly I called CrystalReportViewer.Report source to invR. The problem is how can I "tell" SubReport to use ds.Tables[1] as SetDataSource. So that it can pick OrderDetails relevant to Orders data. I hope I didn't make my problem more confusing... Thanks Ahmed

        T 1 Reply Last reply
        0
        • A ahmed_one

          Thanks for the links...Let me try to clear the problem a little more: InvReport is the main report which contain a subreport. Which is based on DataSet1.xsd contains 2 Tables rptOrders and rptOrderdetails DataSet ds = Ord.GetOrdersByID(int.Parse(this.txtOrdID.text.ToString())); Above line call the GetOrdersByID method of Orders class which return Dataset consist of 2 tables Orders and OrderDetails. Then on a Print Button click event of Invoice form create an instance of InvReport invR, and set SetDataSource of invR to ds.Tables[0]. Lastly I called CrystalReportViewer.Report source to invR. The problem is how can I "tell" SubReport to use ds.Tables[1] as SetDataSource. So that it can pick OrderDetails relevant to Orders data. I hope I didn't make my problem more confusing... Thanks Ahmed

          T Offline
          T Offline
          thatraja
          wrote on last edited by
          #4

          You could assign particular datasource for subreport. Check these Crystal Reports SubReport in Asp.Net[^] How to Create a Crystal Report Sub Report in C#.NET[^]

          thatraja

          Code converters | Education Needed No thanks, I am all stocked up. - Luc Pattyn When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is - Henry Minute

          A 1 Reply Last reply
          0
          • T thatraja

            You could assign particular datasource for subreport. Check these Crystal Reports SubReport in Asp.Net[^] How to Create a Crystal Report Sub Report in C#.NET[^]

            thatraja

            Code converters | Education Needed No thanks, I am all stocked up. - Luc Pattyn When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is - Henry Minute

            A Offline
            A Offline
            ahmed_one
            wrote on last edited by
            #5

            Thanks for the links, I will try to follow guidelines from both.. Appreciate your help. regards Ahmed

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups