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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. SubReport in Win Form (RDLC)

SubReport in Win Form (RDLC)

Scheduled Pinned Locked Moved C#
databasehelpquestion
2 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
    Abdul Rahman Hamidy
    wrote on last edited by
    #1

    Dear All, I have parent and subreport in win form which uses Report Viewer and RDLC as Reporting Tool. Every thing is fine as I can pass parms to both Parent and child, the only problem I face is that suppose that i am getting two records from parent with ID 1 and 2 and each of them has children with 5 records. What i want is the Main and Subpreport should follow the following rule. Parent Details Id Code Discription 1 01 One // this is the first Record from Sql Statement passed Child Details ChildId Description //SubpReport 1 One 2 Two . . . . . . 2 01 Two // this is the second Record from Sql Statement passed Child Details ChildId Description //SubReport 1 One 2 Two . . If i select single record from parent and get the child records, it shows ok but getting more than one records from parent and the same whith child, it shows a very messy report. while i want above format any ideas please?

    Abdul Rahaman Hamidy Database Developer Kabul, Afghanistan

    C 1 Reply Last reply
    0
    • A Abdul Rahman Hamidy

      Dear All, I have parent and subreport in win form which uses Report Viewer and RDLC as Reporting Tool. Every thing is fine as I can pass parms to both Parent and child, the only problem I face is that suppose that i am getting two records from parent with ID 1 and 2 and each of them has children with 5 records. What i want is the Main and Subpreport should follow the following rule. Parent Details Id Code Discription 1 01 One // this is the first Record from Sql Statement passed Child Details ChildId Description //SubpReport 1 One 2 Two . . . . . . 2 01 Two // this is the second Record from Sql Statement passed Child Details ChildId Description //SubReport 1 One 2 Two . . If i select single record from parent and get the child records, it shows ok but getting more than one records from parent and the same whith child, it shows a very messy report. while i want above format any ideas please?

      Abdul Rahaman Hamidy Database Developer Kabul, Afghanistan

      C Offline
      C Offline
      Christopher Stratmann
      wrote on last edited by
      #2

      The only thing that I could think of is that you may want to pass the IDs through a single parameter to the child report. When you build your SQL Query for the parent report, one of the columns that are returned could contain ALL the child IDs (separated by a comma). Then through a subreport parameter you could transfer this parameter that contains all the child IDs into the query for the subreport. I think this could be accomplished a lot easier if you use the RDLReportViewer[^] control instead of having to write all that .NET code to accomplish this. With using the RDLReportViewer[^] control you can just simply create a parent and child RDL file and the RDLReportViewer[^] control could easily show the RDL reports by telling the RDLReportViewer[^] control what report to show. It will automatically run all the queries and display the user parameters[^]. Check it out...

      Chris

      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