Skip to Content
0
Former Member
Sep 04, 2013 at 08:36 AM

The report you requested requires further information.

31 Views

Hi

I created report in asp.net,c#

every time when i run the report it asks

" The report you requested requires further information.

Server Name,Database Name,User Name,Password"

I have written the code given below

SqlConnection con = new SqlConnection(GetConnectionString());

con.Open();

try

{

string statement = " select a.CustomerNo,"

+ " CASE WHEN cd1.ContactType =1 "

+ " THEN cd1.CustomerName "

+ " ELSE cd1.CustomerName + ' / ' + cd1.CompanyName end as ContactDetails,"

+ " a.customerno,a.subject,a.mailto,cd1.companyname,"

+ " a.MeetingDate,a.MeetingType,a.subject,a.minutesofdiscussion,a.actiontaken ,"

+ " a.result,a.FollowupDate,a.FollowupAction,a.attendies,a.Isactive,a.EmployeeName"

+ " from ( select customerno ,mailto,convert(varchar,fu.MeetingDate,105) as MeetingDate,"

+ " MeetingType,Subject,MinutesofDiscussion, Actiontaken,Result,FollowupDate,FollowupAction,"

+ " attendies,fu.Isactive,ud.EmployeeName from followup fu left outer join"

+ " userdetails ud on fu.mailto=ud.UNo) a,customerdetails cd1 where a.customerno= cd1.customerno";

string whereConcatenator = " And ";

if (Request.QueryString["prmCustomerNo"] != "0")

{

statement += whereConcatenator;

statement += "cd1.RelatedTo= " + Request.QueryString["prmCustomerNo"] + " ";

whereConcatenator = "AND ";

}

if (Request.QueryString["prmCustomerNo"] != "0")

{

statement += whereConcatenator;

statement += " a.CustomerNo = " + Request.QueryString["prmCustomerNo"] + " ";

whereConcatenator = "AND ";

}

if (Request.QueryString["prmCompanyNo"] != "0")

{

statement += whereConcatenator;

statement += " a.MailTo = " + Request.QueryString["prmCompanyNo"] + " ";

whereConcatenator = "AND ";

}

statement += " order by a.EmployeeName ";

SqlCommand cmd = new SqlCommand(statement, con);

SqlDataAdapter sda = new SqlDataAdapter(cmd);

DataTable dt = new DataTable();

sda.Fill(dt);

if (dt.Rows.Count > 0)

{

TableLogOnInfo crTableLogOnInfo = new TableLogOnInfo();

ConnectionInfo crConnectionInfo = new ConnectionInfo();

CrystalDecisions.CrystalReports.Engine.Database crDatabase;

CrystalDecisions.CrystalReports.Engine.Tables crTables;

ReportDocument doc = new ReportDocument();

doc.Load(Server.MapPath("CrystalReport.rpt"));

var connectionInfo = new ConnectionInfo();

connectionInfo.ServerName = "ccc.com";

connectionInfo.DatabaseName = "xxx";

connectionInfo.Password = "ssss";

connectionInfo.UserID = "ttt";

connectionInfo.Type = ConnectionInfoType.SQL;

connectionInfo.IntegratedSecurity = true;

for (int i = 0; i < CrystalReportViewer1.LogOnInfo.Count; i++)

{

CrystalReportViewer1.LogOnInfo[i].ConnectionInfo = connectionInfo;

}

doc.SetDataSource(dt);

CrystalReportViewer1.ReportSource = doc;

Please help me to avoid the entry of Server Name,Database Name,User Name,Password

Thanks

Chandran