Click here to Skip to main content
15,890,973 members
Home / Discussions / C#
   

C#

 
GeneralRude Pin
pmarfleet7-Feb-08 2:30
pmarfleet7-Feb-08 2:30 
Generalimage display on window form Pin
RajeevKumarSharma6-Feb-08 22:53
RajeevKumarSharma6-Feb-08 22:53 
GeneralRe: image display on window form Pin
J a a n s6-Feb-08 23:02
professionalJ a a n s6-Feb-08 23:02 
GeneralRe: image display on window form Pin
RajeevKumarSharma6-Feb-08 23:13
RajeevKumarSharma6-Feb-08 23:13 
GeneralRe: image display on window form Pin
Vikram A Punathambekar7-Feb-08 0:16
Vikram A Punathambekar7-Feb-08 0:16 
GeneralRe: image display on window form Pin
Gareth H6-Feb-08 23:10
Gareth H6-Feb-08 23:10 
GeneralRe: image display on window form Pin
electriac7-Feb-08 4:25
electriac7-Feb-08 4:25 
GeneralCrystal_Report PRoblem Pin
simworld6-Feb-08 22:51
simworld6-Feb-08 22:51 
I have a dropdownlist that contains items ,
each item points to the each tablename of a fixed database.


I simply added a blank CrystalReport1 without adding any table, any logon informatio while creating Crystal Report.
and also added CrystalReportViewer Control.


private void Page_Load(object sender, System.EventArgs e)
{


if(dropdownlist1.Selectedvalue=="Table1")
{

SqlConnection con=new SqlConnection();
con.ConnectionString="Server=.;uid=sa;pwd=abc;database=db";
con.Open();
SqlDataAdapter da = new SqlDataAdapter("select * from table1",con);
DataSet ds=new DataSet();
da.Fill(ds);
//ds.Tables.Add();

CrystalReport1 report2=new CrystalReport1();
//report2.SetDatabaseLogon("userid","pwd");
report2.SetDataSource(ds);
//CrystalReportViewer1.DisplayGroupTree = false;
CrystalReportViewer1.ReportSource =report2;
CrystalReportViewer1.RefreshReport();

}

else if(dropdownlist1.Selectedvalue=="Table2")
{

SqlConnection con=new SqlConnection();
con.ConnectionString="Server=.;uid=sa;pwd=abc;database=db";
con.Open();
SqlDataAdapter da = new SqlDataAdapter("select * from table2",con);
DataSet ds=new DataSet();
da.Fill(ds);
//ds.Tables.Add();

CrystalReport1 report2=new CrystalReport1();
//report2.SetDatabaseLogon("userid","pwd");
report2.SetDataSource(ds);
//CrystalReportViewer1.DisplayGroupTree = false;
CrystalReportViewer1.ReportSource =report2;
CrystalReportViewer1.RefreshReport();

}
}
and so on.........



=====================================================
crystal Reprt is coming without data and columns of the table,(Ensuring the table contains data),i think the dataset is not attached ,

How can i attach database and dataset dynamically

Please solve this.....
QuestionC# Office 2003 interop Drag & Drop Pin
dnaycxxx6-Feb-08 22:20
dnaycxxx6-Feb-08 22:20 
QuestionNDoc and C# 2.0 templates Pin
Chesnokov Yuriy6-Feb-08 21:45
professionalChesnokov Yuriy6-Feb-08 21:45 
GeneralRe: NDoc and C# 2.0 templates Pin
Pete O'Hanlon6-Feb-08 23:14
mvePete O'Hanlon6-Feb-08 23:14 
AnswerRe: NDoc and C# 2.0 templates Pin
Chesnokov Yuriy7-Feb-08 0:42
professionalChesnokov Yuriy7-Feb-08 0:42 
GeneralRe: NDoc and C# 2.0 templates Pin
Pete O'Hanlon7-Feb-08 2:59
mvePete O'Hanlon7-Feb-08 2:59 
AnswerRe: NDoc and C# 2.0 templates Pin
Chesnokov Yuriy7-Feb-08 3:26
professionalChesnokov Yuriy7-Feb-08 3:26 
GeneralRe: NDoc and C# 2.0 templates Pin
Pete O'Hanlon7-Feb-08 4:05
mvePete O'Hanlon7-Feb-08 4:05 
AnswerRe: NDoc and C# 2.0 templates Pin
Chesnokov Yuriy7-Feb-08 18:57
professionalChesnokov Yuriy7-Feb-08 18:57 
Generalsetting DPI in Printing Pin
Xmen Real 6-Feb-08 20:42
professional Xmen Real 6-Feb-08 20:42 
GeneralRe: setting DPI in Printing Pin
Christian Graus6-Feb-08 21:32
protectorChristian Graus6-Feb-08 21:32 
GeneralRe: setting DPI in Printing Pin
Xmen Real 6-Feb-08 23:51
professional Xmen Real 6-Feb-08 23:51 
QuestionSet the count of number after the decimal point in a column with expression Pin
Noemi Katinka6-Feb-08 20:04
Noemi Katinka6-Feb-08 20:04 
GeneralRe: Set the count of number after the decimal point in a column with expression Pin
That's Aragon6-Feb-08 20:18
That's Aragon6-Feb-08 20:18 
GeneralRe: Set the count of number after the decimal point in a column with expression [modified] Pin
DaveyM696-Feb-08 22:22
professionalDaveyM696-Feb-08 22:22 
GeneralRe: Set the count of number after the decimal point in a column with expression Pin
Herman<T>.Instance7-Feb-08 1:37
Herman<T>.Instance7-Feb-08 1:37 
GeneralRe: Set the count of number after the decimal point in a column with expression Pin
Noemi Katinka7-Feb-08 4:36
Noemi Katinka7-Feb-08 4:36 
QuestionReading output from the barcode reader Pin
Haj6-Feb-08 20:03
Haj6-Feb-08 20:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.