Click here to Skip to main content
16,004,806 members
Home / Discussions / Database
   

Database

 
AnswerRe: ADO.Net Example Pin
anant iyer18-Mar-06 20:55
anant iyer18-Mar-06 20:55 
QuestionRow intervall Pin
nixter99918-Mar-06 1:53
nixter99918-Mar-06 1:53 
AnswerRe: Row intervall Pin
goyal manish19-Mar-06 17:44
goyal manish19-Mar-06 17:44 
QuestionHow do you import a CSV file into MS SQL? Pin
mcljava17-Mar-06 18:47
mcljava17-Mar-06 18:47 
AnswerRe: How do you import a CSV file into MS SQL? Pin
Mike Dimmick18-Mar-06 11:17
Mike Dimmick18-Mar-06 11:17 
AnswerRe: How do you import a CSV file into MS SQL? Pin
Jorge Novo18-Mar-06 15:19
Jorge Novo18-Mar-06 15:19 
GeneralRe: How do you import a CSV file into MS SQL? Pin
mcljava19-Mar-06 18:02
mcljava19-Mar-06 18:02 
QuestionCrystal Reports.NET, Push method, Login failed Pin
Glenn E. Lanier II17-Mar-06 9:27
Glenn E. Lanier II17-Mar-06 9:27 
I want to display a simple Crystal Report (already, I think this is an oxymoron) in a Windows Form using a dataset (I'd prefer to do all the database work in my code, rather than letting CR do it).

All of my C# code is using Oracle.DataAccess.Client, but when I tried to create a new DataSet, VS said I had to use the Microsoft Oracle object. I did, created a DataSet with one table, EMPLOYEE. I then created my report that lists four items from the table -- no grouping, no counting, just a list.

Then, I created a Windows Form that gathers the required parameters for my query, and using those parameters, build the SQL. I use the SQL to fill the EMPLOYEE table in the DataSet created earlier. If I look, the table has 700+ rows after filling.

Then, I create a report object, set the datasource to the filled dataset, and set the Crystal Reports Viewer's ReportSource to the report. Seems straightforward, no errors. However, when I try to display the new form (that contains the crystalReportViewer), I am presented with a logon dialog box, asking for server, database, username, password. Even if I supply all of these items, it fails to logon. The form containing the viewer is shown, but there is no report.

I tried filling the dataset with the MS Oracle connection/command/dataadapter, but it made no difference. I also tried setting the username/password for each table in the report after the report object was created, but no luck either.

I read http://support.businessobjects.com/forums/message.asp?fid=251&sk=5&ps=25&pn=1&mid=152400#m152400, and a couple of other articles as well (http://www.codeproject.com/aspnet/crystal_report.asp#xx852522xx, http://aspalliance.com/265, and http://www.dotnetjunkies.com/Article/790775A0-C493-46D8-ABE0-40CA588D33D3.dcik).

Any thoughts on how to make this work, and/or a better place to ask?

// Create the dataset
DatasetReportPositiveEmployees ds = new DatasetReportPositiveEmployees();
string sSQL = "SELECT DISTINCT empID, empFName, empLName, empAcctNum from Employee " +
"LEFT INNER JOIN TestResult ON empID = testEmployeeID " +
"WHERE (testResult IN (SELECT resultID FROM Result WHERE resultTreatAsPositive=1))";

System.Data.OracleClient.OracleConnection localConn = new System.Data.OracleClient.OracleConnection(settings.ConnectionString);
localConn.Open();

System.Data.OracleClient.OracleCommand localCmd = new System.Data.OracleClient.OracleCommand();
localCmd.Connection = localConn;
localCmd.CommandText = sSQL;
localCmd.CommandType = CommandType.Text;

System.Data.OracleClient.OracleDataAdapter adapter = new System.Data.OracleClient.OracleDataAdapter();
adapter.SelectCommand = localCmd;
adapter.Fill(ds, "EMPLOYEE"); // Name must match name in Dataset

// Create Report
CrystalReportPositiveEmployees report = new CrystalReportPositiveEmployees();

Tried with/without this section
CrystalDecisions.Shared.TableLogOnInfo login = new CrystalDecisions.Shared.TableLogOnInfo();
foreach (CrystalDecisions.CrystalReports.Engine.Table tbl in report.Database.Tables)
{
login = tbl.LogOnInfo;
login.ConnectionInfo.ServerName = "myComputer";
login.ConnectionInfo.UserID = "myUser";
login.ConnectionInfo.Password = "myPass";
tbl.ApplyLogOnInfo(login);
}

// Tell report to use dataset
report.SetDataSource(ds);

// Create new form, report viewer has been declared public
formReportViewer dlg = new formReportViewer();
dlg.crystalReportViewer1.ReportSource = report;

// No errors, until next command executes
dlg.ShowDialog();


Thanks,
Glenn
QuestionBLOB image data conversion Pin
marianguru17-Mar-06 8:45
marianguru17-Mar-06 8:45 
QuestionADO.NET 2.0 best online comprehensive source for information Pin
LuluSailor17-Mar-06 7:03
LuluSailor17-Mar-06 7:03 
AnswerRe: ADO.NET 2.0 best online comprehensive source for information Pin
Dave Kreskowiak17-Mar-06 16:45
mveDave Kreskowiak17-Mar-06 16:45 
QuestionOleDbConnection & Network drive Pin
hasanali0017-Mar-06 4:10
hasanali0017-Mar-06 4:10 
AnswerRe: OleDbConnection & Network drive Pin
jonathan1517-Mar-06 5:24
jonathan1517-Mar-06 5:24 
GeneralRe: OleDbConnection & Network drive Pin
hasanali0017-Mar-06 6:03
hasanali0017-Mar-06 6:03 
GeneralRe: OleDbConnection & Network drive Pin
Colin Angus Mackay17-Mar-06 7:04
Colin Angus Mackay17-Mar-06 7:04 
QuestionHow Large Can SQL Server 2005 Database Be? Pin
Mike Puddephat17-Mar-06 3:26
Mike Puddephat17-Mar-06 3:26 
AnswerRe: How Large Can SQL Server 2005 Database Be? Pin
Colin Angus Mackay17-Mar-06 7:01
Colin Angus Mackay17-Mar-06 7:01 
GeneralRe: How Large Can SQL Server 2005 Database Be? Pin
Mike Puddephat18-Mar-06 5:08
Mike Puddephat18-Mar-06 5:08 
QuestionSQL compatibility Pin
tanpanjang16-Mar-06 21:29
tanpanjang16-Mar-06 21:29 
AnswerRe: SQL compatibility Pin
Colin Angus Mackay17-Mar-06 1:40
Colin Angus Mackay17-Mar-06 1:40 
Questionstoring the result of exec (sqlQuery ) into a variable Pin
sandeep kumar pundhir16-Mar-06 20:15
sandeep kumar pundhir16-Mar-06 20:15 
AnswerRe: storing the result of exec (sqlQuery ) into a variable Pin
Colin Angus Mackay16-Mar-06 20:32
Colin Angus Mackay16-Mar-06 20:32 
GeneralRe: storing the result of exec (sqlQuery ) into a variable Pin
sandeep kumar pundhir20-Mar-06 18:14
sandeep kumar pundhir20-Mar-06 18:14 
Questioncustomer defined data fields Pin
econner16-Mar-06 16:16
econner16-Mar-06 16:16 
AnswerRe: customer defined data fields Pin
Muhammad Jawad17-Mar-06 1:34
Muhammad Jawad17-Mar-06 1:34 

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.