Dataset for crystal report

H

Hemang Shah

I have form1 which has the dsDataset which is instance of
dsDataSetClass.xsd

I have a button called "report", which opens up another form, which has the
Crystal Report Viewer.

The datasource of the report is "current connection" dsDataSetClass

But whenever I run the report, it shows up the "Database Login" screen.

Even if I enter the details it doesn't work.

Firstly 1) Why isn't it working?
secondly 2) How can I save that setting ? so that it works smoothly for the
clients.

There isn't much I could find on the net on it.

Thanks

HS
 
K

Kamal Vaghjiani

Hemang

Is the database connection established in Crystal Reports ?
Are you trying to do this via code ?

Example 1 c#
ReportTest rep = new ReportTest ();
rep.SetDatabaseLogon("USERNAME","PASSWORD");

I hope this helps...

Regards

KV
 
H

Hemang Shah

Thanks Kamal

I think I have to set the rep.setdatasource(datasetname)

But my dataset is current in the parent form, how do I reference that?

Thanks.
 
H

Hemang Shah

Hello Sahil

I used the xsd..

but then I need to fill in the .setdatasource property right ?

The report expert doesn't do that for you.

but my dataset is in the parent form, how do I access that ?

Thanks
 
N

news.microsoft.com

Yes Sahil, I set it at design time.

But during runtime, the report needs to see the dataset right ? the dataset
is not running on the form that has the crystal report viewer, the datset is
on the form that is calling another form which has the crystal report viewer
in it.

I can create another dataset and all, in the form that has the crv, but all
data is ther on the parent form, i just want to refer that.

Thanks

HS
 
H

Hemang Shah

That is my problem, how can I reference a dataset which is on the parent
form, from the child form ?

It seems I have to define my dataset initially as static ?... That seems to
mess things up..
 
S

Sahil Malik

And maybe you could invite me for a chai party after I do send the example?
Maybe maybe? :)
 

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