CrystalReportViewer in Visual Studio 2005

Greeting,

I used Visual Studio 2005 Pro to create a web app. I want to manually set report source for crystalReportViewer instead of using the autobind value from crystalreport. Please take a look at my code below. My reports runs, but instead of using the data from 'ds', it uses the autobind value from CrystalReport1.rpt.

Dim ds As New system.data.DataSet()
adapter.Fill(ds)

Dim rpt As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
rpt.Load(Server.MapPath("CrystalReport1.rpt")
rpt.SetdataSource(ds)
CrystalReportViewers.ReportSource=rpt


Thanks in advance.

 
mrongAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

frodomanCommented:
Check your report and make sure you don't have 'Save Data With Report' checked.
0
mlmccCommented:
Agree.

One wya to check is to refresh the report when you view it.  If it is correct then you have data saved with the report.

mlmcc
0
mrongAuthor Commented:
how to change  'Save Data With Report' ?

Thanks.
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

mrongAuthor Commented:
I use Visual Studio 2005 Pro. It has CrystalReportViewer and CrystalReport build-in feature.

Thanks.
0
mlmccCommented:
I don't know in the .Net version

In the stand-alone version it is under the FILE menu or FILE --> OPTIONS

mlmcc
0
mlmccCommented:
You can also try this in code

rpt.DiscardSavedData

mlmcc
0
mrongAuthor Commented:
I haven't found the solution yet. It seems the CrystalReportViewer is using the dataset created while creating the report. It doesn't ake my dataset.
0
frodomanCommented:
Have you disabled saving the data with the report as we recommended?
0
mrongAuthor Commented:
I don't think there is 'Save Data With Report' feature in .Net version.
0
frodomanCommented:
Try this.  Rt-click on a blank spot in the report.  Select Designer -> Default Settings -> Reporting.  Check the box that says something like "Discard saved data when report loads".

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mlmccCommented:
Try adding this line before calling the report

rpt.DiscardSavedData

mlmcc
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.