Link to home
Start Free TrialLog in
Avatar of amitverma12679
amitverma12679

asked on

Problem in Crystal Report

I've using ASP.NET with Crystal Report 8.5 which is included in the ASP.NET.
the report is working ok with the connection of SQL Server 2000. here we write the query in the Crystal Report (.RPT) for executing when we establishing the connection.

can i send a command query from the ASP.NET Page ????
and one more thing how we pass the parameters in the Crystal Report  and how to use for the same.
Please tell me step by step
ASKER CERTIFIED SOLUTION
Avatar of warmach
warmach

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kaleem01_pk
kaleem01_pk

Hi,
I have not used Crystal Reports with ASP. But can give you an idea. U should use Crystal reports Viewer control. It as an active X control. Just embed it on the page and use RDC model  for this. i do this in VB like this
dim myApp as new craxdrt.Application
dim myRpt as new craxdrt.Report

myApp.logonserver(....)
Set myRpt=myApp.Openreport(App.path & "\r.rpt")
myRpt.ParameterFields(1).Addcurrentvale 123    ' for number
myRpt.ParameterFields(2).Addcurrentvale "123" ' for string
myRpt.ParameterFields(3).Addcurrentvale cdate(format(dtpFrom,"yyyy/MM/dd")) ' for date

myRpt.sqlquery = "select * from mytable"
' u can use recordeselection formula as well like
myRpt.recordselectionformula = "{mytable.dated}=?date"

crViewer1.reportsource= myrpt
crviewer1.showreport


you can convert it into ASP syntax
i think you have to use
myApp = server.CreateObjcet(craxdrt.Application)
myrprt=server.CreateObjcet(craxdrt.Report)

..........


regards
kaleem