Winforms & Crystal Reports: Push model problem

  • Thread starter Thread starter Karine Proot
  • Start date Start date
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
 
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.
 
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.
 
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.
 
Back
Top