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

  • SEARCH
  • Home
  • 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 8742395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:29:34+00:00 2026-06-13T11:29:34+00:00

I am trying to add a subreport and pass the parameters from my main

  • 0

I am trying to add a subreport and pass the parameters from my main report to the subreport. When I link everything up the subreport runs through thousands of records looking for insurance information on my test subject but there is no record.

If I go to a query tool and run the query with the WHERE clause that I expect to be added on the Crystal report query it takes milliseconds to return no rows.

When i run the preview in Crystal reports it takes minutes to run through all the records. Why doesn’t the query return no records like it should? Or just the one specific one I am looking for if there is a record? I don’t want all 10,000+ records returned to crystal just the ONE or ZERO that I should get based on the parameters I am passing from the main report!!

Thanks for any guidance,
Leslie

Edit: I have a query on the main report that needs PatID and Episode_Number. I have a query on my subreport that I would like to filter on the SAME PatID and Episode_Number. The sub-report query is:

select b.patid, b.episode_number, b.guarantor_name, Trim(b.guar_address_line1|| ' ' || ifNull(b.guar_address_line2, '')) address, b.guar_address_city || ', ' || b.guar_address_state || ' ' || b.guar_address_zip location,
b.guar_phone_number
from billing_guar_data b

I have not added any “extra” parameters onto this Command.
I have these parameters that have been added by this linking:
Pm-Command.PATID and Pm-Command.Episode_Number

which I picked from the Linking page when I created the sub-report

  • 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-06-13T11:29:35+00:00Added an answer on June 13, 2026 at 11:29 am

    I’ve done this before. Took me a while to figure out how to get parameters into an SQL command within a subreport. It’s true, the SQL you have there will fetch all the records because there is no where clause. If you are passing your parameters to get it in the Select Expert, you are filtering after you’ve retrieved the 10,000+ records. From the main report, the parameter has to get into the SQL command of the subreport in order for it to retrieve the specific record. Here’s how to do it.

    You can pass either the oiginal parameter or the field (if available) from the main report. Since your wrote “Pm-Command.PATID and Pm-Command.Episode_Number”, you are passing the field. First, add a where clause to your SQL command

    select 
       b.patid, b.episode_number, b.guarantor_name, Trim(b.guar_address_line1|| ' ' || ifNull(b.guar_address_line2, '')) address, b.guar_address_city || ', ' || b.guar_address_state || ' ' || b.guar_address_zip location, b.guar_phone_number 
    from
       billing_guar_data b
    where
       b.patid = {?Pm-Command.PATID}
       and b.episode_number = {?Pm-Command.Episode_Number}
    

    Next, in the same window on the side parameter list, create 2 parameter

    • Pm-Command.PATID
    • Pm-Command.Episode_Number

    Then in the main report bring up the Change Subreport links… The 2 parameters you are sending should still be there. Make sure the “Select data in subreport based on field” is unchecked on both parameters. If this is checked, it will send the parameter to the Select Expert. Because it’s going to be in the SQL Command, it should be unchecked.

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

Sidebar

Related Questions

i'm trying to add subreport to report. I have setted connection type to use
I have a report with a subreport to add a logo to the main
Trying to add a custom header item to a Lotus Notes email item, from
Trying to add a view that combines data from two tables with a right
Trying to add a controller from my EF model, not sure what I'm doing
I'm trying add data triggers to the default combobox style so each text item
I am trying add picture boxes dynamically. My code is as PictureBox picture =
Im new to asp.net mvc. I'm trying add new model class but it got
Trying to add init parameter names to a list in init(ServletConfig) method. public void
Trying to add a blank sample app for a rails tutorial to GitHub, but

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.