Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass Value to Crystal via SQL 2000 View

Status
Not open for further replies.

IndyGill

Technical User
Jan 15, 2001
191
GB
Hi, I am building some crystal reports in VS.Net. I am using Views in SQL Server to create the data for my crystal report which seems to be working fine.

However I would like to set parameter on my report but I am unsure how to do this? As I need to set the parameter in my View on SQL Server however I cannot add = @StartDate to the View as it does not see this as a valid syntax. Also how do I tell Crystal about my parameters I cant seem to see any place to set parameters in the report wizards.

Any help would be much appreciated

Thanks in advance
 
I just finished the same project. I use dataset as datasource of CR, use "select...from view where..." as sql sentence to change dataset, use crystalreportviewer to bind to dataset...
 
In this instance im not using a dataset. However when I do use a dataset I keep getting a Logon Failure message. I have read quite a few problems with it and I understand that teh Crysatl Report losses its connection details.

I was wondering did you experience this when you used a dataset?


 
Even though I spent more than two days to do it, but I still do not like CR. I got the same message "logon failed" but I forgot how to fix it. Read this thread796-614266,
I just follow it.
 
When I used the pull data model(coming straight from sql) CR kept losing my connection details. Therefore, I started to use datasets. How is CR losing your connection information? You connection data is stored in the dataadapter. As for the parameter, if you do go with a dataset use this code to pass in your parameter and then bind your report.
In Sql add: WHERE (parameter = @parameter)


Code:
SqlDataAdapter1.SelectCommand.Parameters(1).Value = parameter
SqlDataAdapter1.Fill(dataset)
Dim myReport As CrystalReport = New CrystalReport() myReport.SetDataSource(dataset)
CrystalReportViewer1.ReportSource = myReport
That should do it for you,
If you have any questions, let me know.

chris
 
Thanks for that adonet

I have been working on it for two days aswell and I am really cheesed off with it all. I have managed to get the Push method to work before however I wanted to use the GUI tools that come with VS .Net 2003 to do all the Data Adapters and stuff as I will be creating lots of reports and complex queries. So I thought the GUI would be really helpful in doing it.

I really cant believe that Microsoft could create something so crap. I thought they would have sorted this bug out in the realease of VS .Net 2003

So I guess its back to the drawing board
 
Thanks ceyhorn

I have been tryting the above method for a while but still get the same error. I have a strongly typed dataset but i still keep getting this Logon Failure error message when using the pull method. I have included a sample of what I am doing below:

'Set parameter
daTopServiceTypes.SelectCommand.Parameters(0).Value = FormatDateTime(dStart, DateFormat.LongDate)
'Fill dataset
daTopServiceTypes.Fill(ds.TopServiceTypes)

'Specify crystal report
Dim oRpt As New reportFromDS
'Bind data to report
oRpt.SetDataSource(ds.TopServiceTypes)
CrystalReportViewer1.ReportSource = oRpt

I just can seem to get this working when using the pull method.......... PLEASE HELP im gonna start lossing hair soon

Thanks in advance
 
Have you checked your connection string in your dataadapter to see if your password is included. My connection will not work unless my password is there.

Chris
 
Yep the data adapter is fine as I have put a datagrid on the page and it populates that without any trouble. But as soon as I try and populate the Crysatl Report I get the Logon Failed error message.

I have tried loads of methods but just cant get it to work

I even installed a Patch by Business objects for VS.Net 2003 and that didnt work

Im tempted to scrap Crystal altogether
 
I have even tried the following articles

The below article did not work

Im not to sure about the below article as I couldnt understand where it was directing me in IIS

I cant seem to unsderstand step 2
2. Choose " from the "Master Properties" drop down menu and click "Edit".

Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top