Error in Crystal Report

Posted by Raja_89 under ASP.NET on 2/20/2013 | Points: 10 | Views : 1020 | Status : [Member] | Replies : 3
Hai Techie
When i try to execute the crystal report it shows the error

The report you requested requires further information

Server name :
Db name:
username:
password:
use intergrated security [with check box]





Code
try
{

SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=Iwens_Database;Integrated Security=True");
SqlCommand command = new SqlCommand("SELECT E_id, E_Name, E_Address, E_Contact_No, E_Email, DOEn, E_noi, E_coursename, E_year, E_companyname, E_others, E_design, E_Selected, E_Followup FROM dbo.Enquiry_table", con);

SqlDataAdapter adapter = new SqlDataAdapter(command);
DataSet dataset = new DataSet();
DataTable dt = dataset.Tables[0];
adapter.Fill(dataset, "Enquids");
ReportDocument reportdoc= new ReportDocument();
reportdoc.Load(Server.MapPath("Enquirybydate.rpt"));
reportdoc.SetDataSource(dataset.Tables["Enquiry_table"]);
reportdoc.SetDataSource (dt);

CrystalReportViewer1.ReportSource = reportdoc ;
CrystalReportViewer1.DataBind();




}
catch (Exception ex )
{
Response.Write(ex.Message);

}

What does it means
and solution


If possible simple step -by step approach to generate crystal report

Thanks and Regards




Responses

Posted by: Vuyiswamb on: 2/22/2013 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
This is basically staight foward , the Error clearly states that you are missing credentials. You have this


SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=Iwens_Database;Integrated Security=True");


and you need this

SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=Iwens_Database;User ID=sa;Password=mypassword");


Thank you for posting at Dotnetfunda
[Administrator]

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raja_89 on: 2/26/2013 [Member] Starter | Points: 25

Up
0
Down
Hai Techie
How can i know my user id


Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raja_89 on: 2/28/2013 [Member] Starter | Points: 25

Up
0
Down
Hai Techie
CrystalReportViewer1.Visible = true;
SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=Iwens_Database;Integrated Security=true");
//SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=Iwens_Database;Integrated Security=true User ID=cc Password=cc");
SqlCommand cmd = new SqlCommand("SELECT eventname, EV_atName, Ev_Contact_No, Ev_Qualification, Ev_Email, Ev_Info, Ev_Nai, Ev_FS, Ev_Canid, CanCmds, Ev_id FROM dbo.event_table", con);


SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataSet ds = new DataSet(); sda.Fill(ds, " event_table ");


ReportDocument report = new ReportDocument();
sda.Fill(ds, "eventreportoverall");
report.Load(Server.MapPath("alleventCrystalReport.rpt"));
report.SetDataSource(ds.Tables["event_table"]);
//report.SetDatabaseLogon("IWENS-PC", "iwens@123");

CrystalReportViewer1.ReportSource = report;
CrystalReportViewer1.EnableDatabaseLogonPrompt = false;
CrystalReportViewer1.RefreshReport();


It asks the following
the report you have requested the following

Server Name:
DB_Name
Username
Password


1.What does it means
2.How can i avoid this
3.Is servername is equivalent to userid in sql
SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=Iwens_Database;Integrated Security=true User ID =cc Password=cc");
If possible write the code from connection creating to display the report separately

Regards

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response