Winforms & Crystal Reports: Push model problem

K

Karine Proot

Hello,

I created two reports :
- OleDbReport.rpt, with an OLE DB (ADO) data source (took only table
'stores' from database 'pubs')
- DataSetReport.rpt, with an ADO.NET DataSet as a data source (this dataset
contains only tables 'stores' as in 'pubs' database)

I created a winform, with a CrystalReportViewer in it.

I tried to show the two reports in it.

- OleDbReport works great :
OleDbReport report = new OleDbReport ();
crystalReportViewer1.ReportSource = report;

- DataSetReport doesn't :
DataSetReport report = new DataSetReport ();
SqlConnection connection = new SqlConnection (myConnectionString); //
containing Database=pubs;
SqlDataAdapter adapter = new SqlDataAdapter ();
adapter.SelectCommand = new SqlCommand ("SELECT * FROM STORES", connection);
connection.Open ();
DataSet dataset = new DataSet ();
adapter.Fill (dataset);
connection.Close ();
report.SetDataSource (dataset);
crystalReportViewer1.ReportSource = report; // it seems to go wrong here

I get the following error (translated from french, so maybe not exactly that
one) :
Search engine error:
'C:\DOCUME~1\KARINE~1.DEV\LOCALS~1\Temp\temp_[...].rpt'


Karine
 
T

Tian Min Huang

Hello Karine,

Thanks for your post. I strongly recommend you resort to Crystal Decision
(http://www.crystaldecisions.com/) for this issue. Microsoft supports setup
and installation for the Crystal Reports products that are shipped with
Visual Studio .NET. All other support is provided by Crystal Decisions.
Though it ships with Visual Studio, Crystal Reports is supported by Crystal
Decisions. They have a self-help section and they offer phone & e-mail
support. Their web sites states that you get two Crystal incidents with the
purchase of Visual Studio .NET.

You could access their forum at http://support.crystaldecisions.com/forums.

Thanks a lot for your understanding.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
G

G-Fit

Hello Karine,
Thanks for your post. I strongly recommend you resort to Crystal Decision
(http://www.crystaldecisions.com/) for this issue. [...]
You could access their forum at
http://support.crystaldecisions.com/forums.

Thanks for the info.
I didn't find my answer on their forum, but anyway, I found the solution
which was trivial.
So if anyone encouters the problem :

adapter.Fill (dataset); // this is how I filled my datasets so far. It
doesn't work for the Crystal Report push model !
adapter.Fill (dataset, "stores"); // this works for Crystal Report, as long
as you have only one table. For more tables I guess you have to fill several
datasets and call report.Database.Tables.SetDataSource (dataset_i); or
something like that.
 
T

Tian Min Huang

Hello,

Thank you very much for sharing your resolution from which the whole
community will benefit! :)

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

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