Crystal reports question - expounded

  • Thread starter Thread starter Brad Allison
  • Start date Start date
B

Brad Allison

Okay, after spending the past 4 1/2 hours trying to figure this out I am
getting some answers but I am also getting very frustrated. And again, if
this is the wrong forum to post to I apologize.

Why can I not use Crystal Reports to show data from a simple dataset?

The problem I have is that when the report tries to access the data, I get a
database login screen. It was suggested I use ODBC instead of OleDB (as I
have been using - it is an Access db). I converted all connections,
adapters and the dataset to ODBC. I still am getting the database login.

I tried connecting the report to a view (query) in Access and lo and behold,
that does work. However, I do not want the user to have to actually open up
Access, change the parameters in the Access query and then go back and run
the report.

What I want this to do is have the report use a dataset that is filled by
one of three parameterized adapters (the adapter is selected using a select
case statement). Doesn't this sound simple enough?

Maybe I am missing a step somewhere?

Thanks for any help.

Brad
 
I feel you pain. :^)

http://support.businessobjects.com/...Papers/rtm_reportingoffadonetdatasets.pdf.asp

This how-to looks like it only for ASP.NET and Access database but it shows
some basics.

I just struggled through this myself last night.

Here is what I have found:

First you need to a typed dataset, an .XSD file. You can either make this
manually, by doing Add->Add New Item->Dataset Or if you already have a
dataset populated in code, add some code to write it to disk as an XSD file
(WriteXML method of dataset?). You use this as your schema definition when
designing the report.

Second, Add a new Crystal Report to project (for example CrystalReport1).

Now use that typed datset as the datasource when designing your Report.
When picking your datasouce, look under Project Data->ADO.NET Datasets. You
should see your just created XSD file (if you saved it to disk, don't forget
to inlcude it in project, show all files->Inlucde In Project)

Then use this code to display it:

Dim ds As DataSet ' or you Type Dataset class name here if you want

' fill your dataset

Dim oCrystalReport As New CrystalReport1
oCrystalReport.SetDataSource(ds)

ReportViewer.ReportSource = oCrystalReport


HTH,
Greg
 
Back
Top