Data Connectivity
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Data Connectivity
Message Icon Topic: CR with dataset -- prompt pasw Post Reply Post New Topic
Author Message
avihu
Newbie
Newbie


Joined: 05 Oct 2011
Online Status: Offline
Posts: 1
Quote avihu Replybullet Topic: CR with dataset -- prompt pasw
    Posted: 05 Oct 2011 at 8:48am
Hi All,
 

 

I'm working with VS2010 using the CR and selected Dataset that I created programmatically in the for load event.

 

I dragged the dataset fields to the report design and run the program.

 

For whatever reason I'm prompted with Database login window each time I run the report. When I build the dataset I didn't set any password so I'm not sure what password the report is looking for.

 

I'm new to CR.

 

Thanks

 

Avihu
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 05 Oct 2011 at 7:06pm
Hi Avihu,

Creating a report from a dataset is completely different than using a regular database. In a normal database, Crystal queries it with your user credentials, extracts the data, and prints the report. But this won't work with a dataset and you get the Database Login prompt b/c CR doesn't know how to handle it.

Here is a summary of what to do.
1. Create your dataset in memory and save it as an .XSD file using Dataset.WriteXmlSchema().
2. Create a new report, add a new connection and use the ADO.NET option and point it to your .XSD file. CR will read this file to get the record layout.
3. In your code, create the dataset file and assign it to the ReportDocument object using the SetDataSource() method.
4. Now your report has the data and you can preview it.

HTH,

Brian
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.