Click here to Skip to main content
15,860,972 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,,,

I am create CrystalReport in asp.net Website.But in CrystalReport Data are not Display.It Display only Colum name..
My coding is here.

I hava table Table1(id,name,place,Mobileno.)

I create Dataset1 for bind data in CrystalReport.

And in Default.aspx.cs

C#
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using System.Data.SqlClient;

ReportDocument report = new ReportDocument();

 SqlConnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\Suresh\My Documents\Visual Studio 2008\WebSites\WebSite1\App_Data\Database.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True");
        string q = "select * from Table1";
        SqlCommand cmd = new SqlCommand(q, con);
        SqlDataAdapter adp = new SqlDataAdapter(cmd);
        DataSet1 user = new DataSet1();
        adp.Fill(user, "users");

        report.FileName = Server.MapPath("CrystalReport.rpt");
        report.SetDataSource(user);
        CrystalReportViewer1.ReportSource = report;


[edit]Code block extended to cove entire code fragment - OriginalGriff[/edit]
Posted
Updated 4-Feb-12 21:37pm
v2

1 solution

I think you have only assigned the data set to report and not used the values of dataset on to report.

Its hard to explain without knowing your database stucture and report formata

but have a look into below article it will help you.

Creating Crystal Reports using C# with Datasets[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900