Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone!
I'm a newbie, I'm having a problem with Crystal Report in C# (VS2010)
In my Form, I have a Crystal Report file with many tables, but when connected, it requires password to view my report.
Please help me.
This is my code:

C#
SqlConnection cnn;
string connectionString = null;
string sql = null;
connectionString = "connectring to sql server";
cnn = new SqlConnection(connectionString);
cnn.Open();
sql = "SELECT multi table WHERE condition";
SqlDataAdapter dscmd = new SqlDataAdapter(sql, cnn);
DataSet ds = new DataSet();
dscmd.Fill(ds, "Productandlist");
objRpt.SetDataSource(ds.Tables[0]);
crystalReportViewer1.ReportSource = objRpt;
crystalReportViewer1.Refresh();


Please help me, sorry about my English
Posted
Updated 7-Mar-11 13:40pm
v2

Here you go man....but here after please mention the error message properly in your question.

C# Crystal Reports Dynamic Logon parameters[^]

EDIT
--------------------------------------

C# Crystal Reports from multiple tables[^]

Also look at the other examples in C# Crystal Reports - Related Contents section in the same page.
 
Share this answer
 
v2
Comments
nht2007 7-Mar-11 19:46pm    
I tried this way but I want to insert a query to my report.
Please help me
thatraja 7-Mar-11 19:49pm    
Check my updated answer
nht2007 7-Mar-11 19:55pm    
thank you so much for your help.
I'm using sql to connect report, my app connect through ip, it require password if i change ip.
and i tried to do in "http://csharp.net-informations.com/crystal-reports"
but all not working
thatraja 7-Mar-11 20:11pm    
Did you applied the code from the link
C# Crystal Reports Dynamic Logon parameters
? If you did then the the password box won't appear at run time.
hi we have same problem do have answer plz tell me
 
Share this answer
 
My data have 2 table. Can I use
C#
objRpt.SetDataSource(ds);

ds contain 2 table i define

Thanks
 
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