I have a linked sub report that uses a stored procedure but the parameter being passed to stored procedure is always NULL even though it should contain a value.
To pass a parameter to a subreport, you should use Edit > Subreport Links. Have you done that?
Does the parameter display OK in the subreport?
As for use in a 'stored procedure', do you mean an SQL Command? Code you add yourself to do the selection etc.? If so, you might have difficulty adding the parameter to that code. It would probably depend on the version. It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options.
One possibility is for the SQL Command to select evertyhing and the parameter to do the selection in Record Selection.
Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP
dwooten is working with me on this problem and posted this for me. So here is more information.
I am using a stored procedure in a crystal report subreport as a datasource. In other words, it looks just like a table.
I have one parameter ?@StudentID in the subreport which is automatically added to the subreport from the stored procedure in crystal. I have linked the StudentID field from the appropriate table in the main report to the ?@StudentID parameter in the subreport.
When I run the report on my developer machine in CR 10, 2008 or 2011 developer, I get results as I should. But when I put the report on my production machine the subreport is blank.
I ran a sql trace to find out why and discovered that the crystal runtime engine is executing the stored procedure with a null parameter.
I don't understand why I am having this issue. I started with the problem of not being able to verify database on the stored procedure in crystal 10. I later found out that this was caused by using the wrong version (2008) of odbc drivers.
Before I discovered that I was recommended to update crystal. I installed 2011 and then started having the null parameter issue. I uninstalled 2011 and reinstalled v10 but still had the null issue. I uninstalled v10 and installed 2008 but same issue remained.
I don't think the issue is with the runtime crystal engine (10.2) on the production server because I haven't changed anything there and crystal v10 used to work.
Hoping for a guru who can tell me what the answer is. It's been almost a month of working on this problem.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.