I know that there are some threads have a similar issue with this thread.
But, I couldn’t find one which solve my problem.
I use Visual Studio 2010 and I create a dataset with one table. I want to show the data in the Crystal Report Viewer.
But when it begins to load, it asks me login information.
I don’t set anything about login information on my dataset. That’s why I’m confused.
This is my code for adding a dummy row in the table:
dataSet = new DummyDS();
dummyTable = dataSet.Tables["Simulation"];
// fill table with random data
Object[] dummyObj = new Object[3];
dummyObj[0] = null;
dummyObj[1] = 1;
dummyObj[2] = 2;
dummyTable.Rows.Add(dummyObj);
This is my code for loading the crystal report viewer:
CrystalReport1 cr = new CrystalReport1();
cr.Load();
crystalReportViewer1.ReportSource = cr;
crystalReportViewer1.Refresh();
I want to show my data in Crystal Report Viewer without being asked for logon information. Could you help me to solve this problem? Thank you in advance.
upgraded to answer status as I assume it was the answer:
You need to set the report data source to the data set you have created. If you dont set the data source for the report to the dataset then you are relying on CR just guessing which dataset to use!