VS 2005 Dataset question

rcowen00
rcowen00 used Ask the Experts™
on
dataset box
What populates the drop down in the Value field?  I have a parameter that is showing up but isn't reflected in the stored procedure (@Status).  Thank you.
--ReportIndividualsbyState 49, 0,0,0,'0','0'
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[ReportIndividualsbyState]( @CompanyProfileKey int, @LicenseStatusKey int = NULL,@StateKey int = NULL,@BranchProfileKey int = NULL,@TeamID varchar(50)='0' , @GroupID varchar(50)='0', @IndStatusKey int = 2 )
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	-- active individuals
	IF @IndStatusKey = 2
		BEGIN
	SELECT        c.CompanyName, (CASE WHEN @BranchProfileKey IS NULL THEN 'All Branches' ELSE b.BranchName END) AS BranchName, dbo.FormatFullName(lo.FirstName, 
	                         lo.LastName, '') AS FullName, lo.NMLSID, b.BranchNumber, s.StateAbbr, lio.IndividualLicenseName AS LicenseName, lo.GroupID AS Groups, lo.TeamID AS Team, 
	                         (CASE WHEN lol.LicenseStatusKey <> 1 THEN 'N/A' ELSE lol.License_ID END) AS License_ID, 
	                         (CASE WHEN lol.LicenseStatusKey <> 1 THEN 'N/A' ELSE CONVERT(varchar(25), lol.IssueDate, 101) END) AS IssueDate, 
	                         (CASE WHEN lol.LicenseStatusKey <> 1 THEN 'N/A' ELSE CONVERT(varchar(25), dbo.GetLicenseRenewalDate(lol.LicenseKey, 0), 101) END) AS ExpirationDate, 
	                         dbo.GetLicenseStatusText(lol.LicenseKey) AS LicenseStatus, lo.LastName, lol.LastRenewalDate
	FROM            LoanOfficerLicense AS lol INNER JOIN
	                         LoanOfficerProfile AS lo ON lo.LoanOfficerProfileKey = lol.LoanOfficerProfileKey INNER JOIN
	                         LicenseInformationLoanOfficer AS lio ON lio.LicenseInformationLoanOfficerKey = lol.LicenseInformationLoanOfficerKey INNER JOIN
	                         LicenseInformation AS li ON li.LicenseInformationKey = lio.LicenseInformationKey INNER JOIN
	                         State AS s ON s.StateKey = li.StateKey INNER JOIN
	                         BranchProfile AS b ON b.BranchProfileKey = lo.BranchProfileKey INNER JOIN
	                         CompanyProfile AS c ON c.CompanyProfileKey = lo.CompanyProfileKey LEFT OUTER JOIN
	                         Address AS a1 ON a1.AddressKey = lo.ResAddressKey
	WHERE        (li.StateKey = ISNULL(NULLIF (@StateKey, 0), li.StateKey)) AND (lo.CompanyProfileKey = @CompanyProfileKey) AND 
	                         (lo.BranchProfileKey = ISNULL(NULLIF (@BranchProfileKey, 0), lo.BranchProfileKey)) AND (lol.LicenseStatusKey = ISNULL(NULLIF (@LicenseStatusKey, 0), 
	                         lol.LicenseStatusKey)) AND (lo.TeamID = ISNULL(NULLIF (@TeamID, '0'), lo.TeamID)) AND (lo.GroupID = ISNULL(NULLIF (@GroupID, '0'), lo.GroupID)) AND 
	                         (b.DeletedFlag = 0) AND (lo.DeletedFlag = 0) AND (lol.DeletedFlag = 0) AND (lo.InactiveDate IS NULL)
	ORDER BY lo.LastName
END
ELSE
				-- inactive records.
				IF @IndStatusKey = 3
				BEGIN
				SELECT        c.CompanyName, (CASE WHEN @BranchProfileKey IS NULL THEN 'All Branches' ELSE b.BranchName END) AS BranchName, dbo.FormatFullName(lo.FirstName, 
				                         lo.LastName, '') AS FullName, lo.NMLSID, b.BranchNumber, s.StateAbbr, lio.IndividualLicenseName AS LicenseName, lo.GroupID AS Groups, lo.TeamID AS Team, 
				                         (CASE WHEN lol.LicenseStatusKey <> 1 THEN 'N/A' ELSE lol.License_ID END) AS License_ID, 
				                         (CASE WHEN lol.LicenseStatusKey <> 1 THEN 'N/A' ELSE CONVERT(varchar(25), lol.IssueDate, 101) END) AS IssueDate, 
				                         (CASE WHEN lol.LicenseStatusKey <> 1 THEN 'N/A' ELSE CONVERT(varchar(25), dbo.GetLicenseRenewalDate(lol.LicenseKey, 0), 101) END) AS ExpirationDate, 
				                         dbo.GetLicenseStatusText(lol.LicenseKey) AS LicenseStatus, lo.LastName, lol.LastRenewalDate, lo.InactiveDate
				FROM            LoanOfficerLicense AS lol INNER JOIN
				                         LoanOfficerProfile AS lo ON lo.LoanOfficerProfileKey = lol.LoanOfficerProfileKey INNER JOIN
				                         LicenseInformationLoanOfficer AS lio ON lio.LicenseInformationLoanOfficerKey = lol.LicenseInformationLoanOfficerKey INNER JOIN
				                         LicenseInformation AS li ON li.LicenseInformationKey = lio.LicenseInformationKey INNER JOIN
				                         State AS s ON s.StateKey = li.StateKey INNER JOIN
				                         BranchProfile AS b ON b.BranchProfileKey = lo.BranchProfileKey INNER JOIN
				                         CompanyProfile AS c ON c.CompanyProfileKey = lo.CompanyProfileKey LEFT OUTER JOIN
				                         Address AS a1 ON a1.AddressKey = lo.ResAddressKey
				WHERE        (li.StateKey = ISNULL(NULLIF (@StateKey, 0), li.StateKey)) AND (lo.CompanyProfileKey = @CompanyProfileKey) AND 
				                         (lo.BranchProfileKey = ISNULL(NULLIF (@BranchProfileKey, 0), lo.BranchProfileKey)) AND (lol.LicenseStatusKey = ISNULL(NULLIF (@LicenseStatusKey, 0), 
				                         lol.LicenseStatusKey)) AND (lo.TeamID = ISNULL(NULLIF (@TeamID, '0'), lo.TeamID)) AND (lo.GroupID = ISNULL(NULLIF (@GroupID, '0'), lo.GroupID)) AND 
				                         (b.DeletedFlag = 0) AND (lo.DeletedFlag = 0) AND (lol.DeletedFlag = 0) AND (lo.InactiveDate IS NOT NULL)
				ORDER BY lo.LastName
				END
			ELSE
			-- all records.
				IF @IndStatusKey = 1
				BEGIN
SELECT        c.CompanyName, (CASE WHEN @BranchProfileKey IS NULL THEN 'All Branches' ELSE b.BranchName END) AS BranchName, dbo.FormatFullName(lo.FirstName, 
	                         lo.LastName, '') AS FullName, lo.NMLSID, b.BranchNumber, s.StateAbbr, lio.IndividualLicenseName AS LicenseName, lo.GroupID AS Groups, lo.TeamID AS Team, 
	                         (CASE WHEN lol.LicenseStatusKey <> 1 THEN 'N/A' ELSE lol.License_ID END) AS License_ID, 
	                         (CASE WHEN lol.LicenseStatusKey <> 1 THEN 'N/A' ELSE CONVERT(varchar(25), lol.IssueDate, 101) END) AS IssueDate, 
	                         (CASE WHEN lol.LicenseStatusKey <> 1 THEN 'N/A' ELSE CONVERT(varchar(25), dbo.GetLicenseRenewalDate(lol.LicenseKey, 0), 101) END) AS ExpirationDate, 
	                         dbo.GetLicenseStatusText(lol.LicenseKey) AS LicenseStatus, lo.LastName,lol.LastRenewalDate
	FROM            LoanOfficerLicense AS lol INNER JOIN
	                         LoanOfficerProfile AS lo ON lo.LoanOfficerProfileKey = lol.LoanOfficerProfileKey INNER JOIN
	                         LicenseInformationLoanOfficer AS lio ON lio.LicenseInformationLoanOfficerKey = lol.LicenseInformationLoanOfficerKey INNER JOIN
	                         LicenseInformation AS li ON li.LicenseInformationKey = lio.LicenseInformationKey INNER JOIN
	                         State AS s ON s.StateKey = li.StateKey INNER JOIN
	                         BranchProfile AS b ON b.BranchProfileKey = lo.BranchProfileKey INNER JOIN
	                         CompanyProfile AS c ON c.CompanyProfileKey = lo.CompanyProfileKey LEFT OUTER JOIN
	                         Address AS a1 ON a1.AddressKey = lo.ResAddressKey
	WHERE        (li.StateKey = ISNULL(NULLIF (@StateKey, 0), li.StateKey)) AND (lo.CompanyProfileKey = @CompanyProfileKey) AND 
	                         (lo.BranchProfileKey = ISNULL(NULLIF (@BranchProfileKey, 0), lo.BranchProfileKey)) AND (lol.LicenseStatusKey = ISNULL(NULLIF (@LicenseStatusKey, 0), 
	                         lol.LicenseStatusKey)) AND (lo.TeamID = ISNULL(NULLIF (@TeamID, '0'), lo.TeamID)) AND (lo.GroupID = ISNULL(NULLIF (@GroupID, '0'), lo.GroupID)) AND 
	                         (b.DeletedFlag = 0) AND (lo.DeletedFlag = 0) AND (lol.DeletedFlag = 0) 
	ORDER BY lo.LastName
	

END
END

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Top Expert 2014

Commented:
Do you mean indStatusKey?

Author

Commented:
No, I mean @Status.  When I go to the Preview tab the parameter Status is there but not included in the dataset Parameters.  It is reflecting in the drop down under the Parameter section of the dataset but I don't know where it is coming from

preview screen
Most Valuable Expert 2012
Top Expert 2014

Commented:
Are you sure you are not using any other stored procedures or queries in this report?
OWASP Proactive Controls

Learn the most important control and control categories that every architect and developer should include in their projects.

Author

Commented:
Under the Data tab the only stored procedure listed is the one I included.  
Looks like you may have two of the same parameters just different labels.

Author

Commented:
planocz, can you tell me where to find or look for the "extra" one.
should be able to fine it on the tabs of the report.

Author

Commented:
That's the thing it's not there, see the screen shot from the original question.  It is not listed as a parameter.  
<<What populates the drop down in the Value field?>>
Thats the list with report parameters. Choose Report|Report Parameters in the menu to get the list of report parameters.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial