I am trying to create a crystal report (Using Crystal Reports for Visual Studio.NET) that uses a formula to decide how to lay out text for a Group on the report.
I have a stored procedure called sp_GetTestSetLevel that takes the ID of a TestSet record, and recursively works out what level it is in the data structure. This level can then be used to indent the name of the group by an appropriate amount.
I have set up my Stored procedure as a data field for the report in the Visual Linking expert.
In the formula editor, I can access the procedure and get it inserted into the formula. It gets inserted as {sp_GetTestSetLevel;1.Expr1000}
However, I have NO idea how to pass the parameter (the ID of the test set, which is also available to me in the formula editor) to the stored procedure. This ID will be different for every Group in the report.
What I want to do in the formula editor is something like this:
Where TestSet.testset_id is the id of the record, that I want to use as a parameter to the stored procedure.
(If I Browse Data for the stored procedure, it allows me to enter a value for the parameter, but it only lets me enter a constant number for this. I need to get the value from the current record for each group in the report).
Can anyone tell me how to do this (or even IF I can do it...?)
Thanks,
Liam
I have a stored procedure called sp_GetTestSetLevel that takes the ID of a TestSet record, and recursively works out what level it is in the data structure. This level can then be used to indent the name of the group by an appropriate amount.
I have set up my Stored procedure as a data field for the report in the Visual Linking expert.
In the formula editor, I can access the procedure and get it inserted into the formula. It gets inserted as {sp_GetTestSetLevel;1.Expr1000}
However, I have NO idea how to pass the parameter (the ID of the test set, which is also available to me in the formula editor) to the stored procedure. This ID will be different for every Group in the report.
What I want to do in the formula editor is something like this:
Code:
numberVar level := sp_GetTestSetLevel( {TestSet.testset_id} );
Where TestSet.testset_id is the id of the record, that I want to use as a parameter to the stored procedure.
(If I Browse Data for the stored procedure, it allows me to enter a value for the parameter, but it only lets me enter a constant number for this. I need to get the value from the current record for each group in the report).
Can anyone tell me how to do this (or even IF I can do it...?)
Thanks,
Liam