Hello,

Is any one know how to display a crystl report in C# windows application and bak end is SQL Server 2005

Recommended Answers

All 6 Replies

Yes, I am sure there are lots of people who know how to do that.
However, generelly, vague request like yours do not get many replies.
If you have any specific questions please ask and someone is sure to help.

hi,

I have develop a program in Windows aplication C# and its backend is SQL server2005

I dont know what is going wrong if u find any wrong procedure please tell me:

1. Select a new crystal report

2. Crystal report gallary opens - select for standerd report.

3. Standerd report wizard is open. - project data - ADO.net dataset - select
dataset (ex. shop.bookdataset)

4. from the database field - select a field - design a crystal report.

5. Add new form - on that select crystal report viewer - on report sourse
property select crystal report.

after i run the program and save a data. and clock on form where the crystal report is display it shows only the text object that it and other is blanck no data.

I remember having a similar issue when I first used crystal reports.

Adding the connection in the report is not enough. It seems that this is only used to identify the fields and allow you to place the fields on your report. The connection is not opened when the report is used in a program.

You need to pass in a DataSet with the data you want to show in the report using the ReportClass.SetDataSource method.
E.G.

report.SetDataSource(MyData);

thank


hosDataSet ds = new hosDataSet ();
CrystalReport2 cr = new CrystalReport2();
cr.SetDataSource(ds.Tables["acc"]);
crystalReportViewer1.ReportSource = cr;
crystalReportViewer1.Refresh();

I use this code to display crystal report but its not working.
Its still blank. If i make the mistake in coding please correct me.

virusisfound

Try cr.SetDataSource(ds);

Its Still not working.

There is any other way to slove this problem Please

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.