We help IT Professionals succeed at work.

Data Report Using Parameters

bmaster
bmaster asked
on
Medium Priority
183 Views
Last Modified: 2008-02-01
I am trying to create a data report using a command object from the dataenvironment.  In my dataenvironment I have a command object, and a child command object set up.  The parent object will contain header information, and the child object detail information for my report.
Both of these commands are linked to stored procedures, each with a single parameter that will be the same value when I run the report.  My relation between the two commands is between the parent ID and the child parameter.  When I try to show the report in my application I get an error that just says "General Error".

I got it to work when I had just one command object, so I know I had everything set up right.  It also worked when I used the full table for the child instead of a stored procedure.  But, the table is too big, and it takes too long to look up just one claim for this to work.

The problem is just when I try to create the child command as a stored procedure with a parameter.  I need to know how to set the parameter for the child command so that it is the same as the parent's parameter?  Any help would be greatly appreciated.

Thanks,
Brian
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2012

Commented:
You don't need the data environment to use Data Reports.  All you need is something like:

Set DataReport1.DataSource = rs ' This is the recordset returned by your Stored Procedure.
DataReport1.Refresh

Also, don't forget to clear the datasource from the data report design.

Anthony

Author

Commented:
Yes, I could set it up that way too, but it doesn't solve my problem.  Is there any way to link two stored procedures that both take parameters so that they are both run with the same parameter?  One returns header level information, and the other detail information.

Author

Commented:
Yes, I could set it up that way too, but it doesn't solve my problem.  Is there any way to link two stored procedures that both take parameters so that they are both run with the same parameter?  One returns header level information, and the other detail information.
CERTIFIED EXPERT
Top Expert 2012
Commented:
No.  The Data Report only uses one recordset at a time.

Anthony

Author

Commented:
I didn't think so.  I have since set it up differntly to use just one stored procedure, and grouped all the header level information.

Thanks,
Brian
CERTIFIED EXPERT
Top Expert 2012

Commented:
Brian,

If you feel I did not give you the answer you were looking for, there is no need to award me the points.  You can always give it to someone more deserving or delete the question entirely.

Also, I would very much like to know how you can use more than one recordset at the SAME time with a Data Report.  Trust me, I learn much more from these questions than I answer.

Anthony

Explore More ContentExplore courses, solutions, and other research materials related to this topic.