Print Page | Close Window

Formula - Parameter filter (Help)

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=3586
Printed Date: 05 May 2024 at 9:33pm


Topic: Formula - Parameter filter (Help)
Posted By: RavensAngel
Subject: Formula - Parameter filter (Help)
Date Posted: 02 Jul 2008 at 11:21pm
Hi all,
 
i was wondering whether someone has some experience in crystal reports to make the following happen:
 
i have a table in my database with ID, NAME and DESC
 
i was able to make a filter based on a parameter ID...
something like
 
if {Param_ID} > 0
then
{db.NAME} = {Param_ID}
 
but now i want to have a filter that allows me to filter on name?!
Example:
     Show all items where NAME begins with {Param_Name}
 
Is this possible? And how?
 
 
Already thank you!



Replies:
Posted By: RavensAngel
Date Posted: 08 Jul 2008 at 4:01am
Ok,
 
i figured it out but i still have a question!
 
so i created a stored procedure within MySql which takes a parameter
 
something like this:
 
CREATE mailto:DEFINER=`root`@`localhost - DEFINER=`root`@`localhost ` PROCEDURE `GetAllItems`(in p_Name varchar(50) )
BEGIN
SELECT *
FROM item
WHERE Name like p_Name;
END $$
 
 
Now when i try to connect via the database expert to my SP, it fails giving me an error like:
Query Engine Error: 'HY000:[MySql][....] Incorrect number of arguments for Procedure dbgeluid.GetAllItems; expected 1, got 0
 
so i tried via another way, using the Add Command functionality.
So i tried to add a new Sql Query typing:
call GetAllItems( {?sp_Name} )  
where sp_Name is a parameter i made in the "Parameter List".
When i try to apply this (by clicking "OK"), the system asks me for a discrete Value. I fill in a correct value and all is well...
 
So now the question:
 
Why can't i add the Stored procedure directly? Is this normal or am i doing something wrong?
 
 



Print Page | Close Window