Print Page | Close Window

CR with dataset -- prompt pasw

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=14596
Printed Date: 22 Apr 2025 at 10:02am


Topic: CR with dataset -- prompt pasw
Posted By: avihu
Subject: CR with dataset -- prompt pasw
Date 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



Replies:
Posted By: BrianBischof
Date 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>



Print Page | Close Window