Click here to Skip to main content
12,394,573 members (73,568 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# CrystalReports
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:

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 7-Mar-11 13:21pm
nht2007482
Updated 7-Mar-11 13:40pm
thatraja248.2K
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
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.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

hi
we have same problem do have answer plz tell me
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

My data have 2 table. Can I use
objRpt.SetDataSource(ds);
ds contain 2 table i define

Thanks
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 2 Feb 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100