Solved

How to apply filters in crystal report through asp or pass parameter value to stored procedure?

Posted on 2004-03-31
5
184 Views
Last Modified: 2008-03-06
Hi,
I have crystal report 8.0, IE 6.0 and database sql server 2000.
I want to develop the following application.
A crystal report is comming from a table A. Through asp the user can select any column of table and then any values of this column, and these values will be applied to report as filter. Either it can be applied directly to report as filter or pass to stored procedure which can use these values into its where clause or any other easy solution. I need only end result, which is filter the reports data.

Table A
---------------------------
C1       C2       C3
1         alex     600
2         john     200
3         ami      700
4         frank     100
5         fred     500

user can select any column and then value for example he selects
C1(2,3) and C2(alex,john)

Now when user will click on report link and report will bring all data from table A
where c1 in (2,3) and C2(alex,john).

I need very urgent help.
Thanks in advance.
0
Comment
Question by:ala
  • 2
  • 2
5 Comments
 
LVL 13

Accepted Solution

by:
EwaldL earned 500 total points
ID: 10728121
create a multi value parameter which has the same data type as c1. then include this parameter into the record selection formula. i believe the syntax is ic equal icparamter.

do the same for the c2 field.

now you should be able to enter the parameter values (2,3 / alex, john) and the report should show up with only the records that match the criteria.
0
 

Author Comment

by:ala
ID: 10728954
Can you send me code please. I am not  programmer of crystal report.
And aslo please tell me how to call crystal report through asp?
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 10729418
0
 

Author Comment

by:ala
ID: 10732306
Thanks,

I got idea from examples. But now I need first how to passing mulitples values to asp and then how stored procedure will handle it.
I am doing like this:

asp:
NewParamValue = "2,3"
NewParamValue2 = "'john','alex'"

'  Save the new value for the Stored Procedure in the Store Procedure

ThisParam.SetCurrentValue cint(NewParamValue), 7
ThisParam2.SetCurrentValue cint(NewParamValue2), 12

and in stored procedure:

CREATE PROC dbo.GetOrderList1
(
      @C1List varchar(500),@C2List varchar(500)

)
AS
BEGIN
      SET NOCOUNT ON

      DECLARE @SQL varchar(600)

      SET @SQL =
      'SELECT proj_ID, ProjectName, PIN, BUDS
      FROM dbo.actcodes
      WHERE C1 IN (' + @C1List + ') and
                 C2 IN (' + @C2List + ')'

      EXEC(@SQL)      
END
GO

------------------
When I run this stored procedure for number value it works but when i run it for string value it gives me error.
Is it right way I am doing.
If you can give me code or some tips I wil be thankful to you.

Thanks
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 10745990
What error are you getting?

CR 8 is limited to character strings of 254 or shorter.  Your procedure is expecting two 500 character parameters.  I don't think Crystal can do that.

mlmcc
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now