Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 622477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:59:19+00:00 2026-05-13T18:59:19+00:00

I have a crystal report with a bunch of parameterized fields that are being

  • 0

I have a crystal report with a bunch of parameterized fields that are being filled by code and displayed through CRViewer. I need to add a few sections in here to execute a query to return a dataset and display this in the same report. I am not sure if the best way to do this with a subreport. I am trying to add a subreport and then set the datasource of the subreport to my dataset, but I cannot get it to work.

Is this even the proper way or I am just doing something wrong?

Any help would be appreciated.

EDIT:

Example of what I am looking to do.

Lets say there is a customers table. I have FirstName LastName as parametirized fields displayed on the form along with address and basic customer information.

I want to place a subreport showing all orders this customer has made on the SAME report. The is an association table with multiple orders possible.

The report is being placed in a class that can be called by a VB.NET app. Therefore I cannot create the dataconnection for the subreport in the UI (or maybe I can and pass params later).

I am successfully populating the parameterized field by doing the following:

Dim myRpt As New RunReport.RunReport

myRpt.Load("myReport.rpt")

'Set Labels
 myRpt.SetParameterValue("@FirstName", strFirstName)

 CrystalReportViewer1.ReportSource = myRpt

A customerID would be available as well on to bind if needed to the association rows.

This will be one report I just need to display the subreport section to handle all possible orders. This is the part I am having the issue with.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T18:59:19+00:00Added an answer on May 13, 2026 at 6:59 pm

    Are you setting your main report’s datasource like this?

    Dim ds as new Dataset
    sqlAdapter.Fill(ds, "Whatever");
    oRpt.SetDataSource (ds)
    

    If so, setting it on the subreport might look like this:

    Dim oSubReport As ReportDocument
    For Each oReportObject As SubreportObject In oRpt.ReportDefinition.ReportObjects  
      If oReportObject.Kind = ReportObjectKind.SubreportObject Then  
        oSubReportObject = CType(oReportObject, SubreportObject)  
        oSubReport = oRpt.OpenSubreport(oSubReportObject.SubreportName)  
        oSubReport.SetDataSource (ds)
      End If  
    Next
    

    I’ve read your update above and think I understand what you are going for. See if this works for you:

    1) Create the main report. Give is whatever selection criteria you want (ex. CustName or CustID)
    2) Create the sub report. Give it the selection selection criteria you want (ex. CustID)
    3) Once you have inserted the subreport into the main report, right-click on the subreport object/box in the designer and pick “Change Subreport Links”
    4) In the “Fields to link to” box, pick the value from the main report that will drive the subreport. (Ex. CustID)
    5) In the “Subreport parameter field to use” dropdown, select the subreport parameter field that you want to link to the main report (Ex. CustID)

    When you run the report, the subreport should only show data for the record that is displayed in the main report.

    If those steps don’t get you what you are looking for, please describe what functionality is missing.

    P.S.: If you are trying to pull data only once (instead of once for main and again for sub), my question would be: why?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.