typed vs strong typed dataset

B

Brad Allison

I have been given guidance to create a typed dataset instead of a strongly
typed dataset to be used for a Crystal Report. My strongly-typed dataset is
being filled with the proper information and I need to copy this information
to my typed dataset. I guess maybe I feel stupid, but how do I reference
the typed dataset if a dataset is not being generated? The .xsd file is
listed in the project. I just need to know how to move or copy the data in
the primary dataset to this typed dataset so Crystal Reports can use the
information. Seems to me like Crystal Reports should be able to use the
primary dataset, but I keep getting a login-to-the-database screen.

Thanks for the information.

Brad
 
M

Miha Markic [MVP C#]

Hi Brad,

Brad Allison said:
I have been given guidance to create a typed dataset instead of a strongly
typed dataset to be used for a Crystal Report. My strongly-typed dataset is
being filled with the proper information and I need to copy this information
to my typed dataset.

Errr, typed and strong typed?
Strong typed dataset is just a wrapper (derived class) around untyped
dataset.
Thus, you can cast from strong typed dataset to dataset.

I guess maybe I feel stupid, but how do I reference
the typed dataset if a dataset is not being generated? The .xsd file is
listed in the project. I just need to know how to move or copy the data in
the primary dataset to this typed dataset so Crystal Reports can use the
information.

Crystal Report (as other dataconsumers) doesn't care about strong typed
datasets - they use underlying dataset.

Seems to me like Crystal Reports should be able to use the
primary dataset, but I keep getting a login-to-the-database screen.

You are certainly doing something wrong. Dataset is disconnected and doesn't
hold any reference to database.
Thanks for the information.

Sure.
 
B

Brad Allison

Miha,

I may have mistated the terminology. But essentially I am using Access
(OleDB) as the database backend. I have a dataset that was generated using
the VS IDE that works just fine. Upon designing the Crystal Report I
referenced this dataset. When the report runs, it asks for a login to the
database. There isn't one. I was told in an earlier post that this is an
ongoing bug with Crystal Reports and I was provided with a work around
solution.

The solution essentially is to create a typed dataset where once the
original dataset is filled this can be copied to the typed dataset. So I
create my typed dataset and unchecked the box that says to generate the
dataset. Now if I want reference that dataset in the program, it gives me
an error stating that the dataset is not defined.

Here is the code:

Dim pads As DataSet = New pApps

pads = DsPrintApp1.Copy

Dim rptdoc As New Engine.ReportDocument

rptdoc.Load("c:\...\vbscheduling\AppForm.rpt")

rptdoc.SetDataSource(pads)

If I have a check box next to "generate the dataset" then the first line of
code works fine; however I was told to uncheck that box. How would I
reference pApps? pApps is the dataset that is used in the actually Crystal
Report.

Brad
 
B

Brad Allison

Somehow someway I actually got this to work! I went step by step using
something from the Business Objects website and there is something called
Reporting Off ADO.NET Datasets. I worked through the walkthrough. It is
written for ASP and C# so I converted it to Windows Forms | VB. The small
sample application worked fine so I retraced these exact same steps in the
program that I am working on and it seems to have worked.

Thanks to everyone that did help me including Miha, Greg and Jim!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top