Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing values to subreport 1

Status
Not open for further replies.

Cagliostro

Programmer
Sep 13, 2000
4,226
GB
I've seen already a thread about passing values, but this does not seem to be right one for my sityation.

I have a main report what have fields A,B,C...
and I have a subreport what have a stored procedure as a source, for example MyProc.
I want the subreport to use field A as a parameter for MyProc.
The subreport have a query or a stored procedure as source
I want to call the procedure like this:
exec MyProc @A, @B, @C...
Or the query like this
select .... from XXXXX where A=@A and B=@B and C=@C...
Anyway, parameters @A, @B, @C have to be initialized with values from the main report fielts A, B, C.
Is that possible?

I'm using CrystalReport what comes with VisualStudio2005 (a reduced version)and the database MSSQL 2005

Ion Filipski
1c.bmp
 
In Crystal, it's best to try something and see if it works, rather than working out in advance if it's possible.

For a subreport, most fields from the main report can be passed using Edit > Subreport Links. I think it won't pass fields based on several records. You also have to associate it with a subreport field, even if you don't want to keep the connection.

Whatever you define as a link will be posted as a selection line in the subreport's record selection. You can then change it.

Does this help?

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top