Click here to Skip to main content
11,701,948 members (64,516 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Multi 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
Edited 7-Mar-11 13:40pm
thatraja246.4K
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 at 7-Mar-11 19:46pm
   
I tried this way but I want to insert a query to my report.
Please help me
thatraja at 7-Mar-11 19:49pm
   
Check my updated answer
nht2007 at 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 at 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
0 Maciej Los 420
1 Sergey Alexandrovich Kryukov 355
2 OriginalGriff 314
3 Mika Wendelius 119
4 CHill60 105
0 OriginalGriff 8,344
1 Sergey Alexandrovich Kryukov 7,507
2 CPallini 4,922
3 Maciej Los 4,371
4 Mika Wendelius 3,556


Advertise | Privacy | Mobile
Web04 | 2.8.150819.1 | Last Updated 2 Feb 2013
Copyright © CodeProject, 1999-2015
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