Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

incorrect log on parameters

Status
Not open for further replies.

lutzs

Programmer
Oct 8, 2002
75
LU
Hi!

I have a .net application with two crystalreports.
I will print the one report. On this report is new a database field. And now, I can't printing.
The error message is: "Unable to connect: incorrect log on parameters".
Before I add the database field I could print.

Here is my code:
ReportDocument crReportDocument = new ReportDocument();
crReportDocument.Load("C:\\Documents and Settings\\Lagetzki\\Personal\\Visual Studio Projects\\export_printing_ado.net\\header.rpt");
rReportDocument.PrintToPrinter(1, true, 1, 1);

oRpt.PrintToPrinter(1,true,1,1);

Thanks, Stephanie
 
What type of DBMS and how are you connecting Crystal to the DBMS?
 
Hi,

I'm using an Oracle Database and the OleDB Provider for Oracle.

In my application are two dataSets.
The first: I connect to the database with an OleDb Connection and fill the DataSet with the OleDB Adapter.

That is the code for my second database:

Dataset2 ds_pname = new Dataset2();

DataTable t_pname = new DataTable();

DataColumn myDataColumn = new DataColumn();
myDataColumn.ColumnName = "name";
myDataColumn.DefaultValue = Application.ProductName;
t_pname.Columns.Add(myDataColumn);

ds_pname.Tables.Add(t_pname);

I verify the database and now I can add the database field to my report. When I click my button to print the report I get an error message.

 
You could set the source of the report to your dataset.

Report.SetDataSoure(yourDataSet);
 
Hi,

when I set the source of the report to my dataset I get another error message (in the line crReportDocument.PrintToPrinter(1, true, 1, 1)):
"Query Engine error"

Here's my code:

oRpt.PrintOptions.PrinterName = @"printer";
oRpt.PrintOptions.PaperSource = PaperSource.Auto;
oRpt.PrintOptions.PaperSize = PaperSize.PaperA4;

ReportDocument crReportDocument = new ReportDocument();
crReportDocument.Load("C:\\Documents and Settings\\Schneider\\Personal\\Visual Studio Projects\\header.rpt");

programmname ds_pname = new programmname();

DataTable t_pname = new DataTable();

DataColumn myDataColumn = new DataColumn();
myDataColumn.ColumnName = "name";
myDataColumn.DefaultValue = Application.ProductName;
t_pname.Columns.Add(myDataColumn);

ds_pname.Tables.Add(t_pname);

crReportDocument.SetDataSource(ds_pname);

crReportDocument.PrintToPrinter(1, true, 1, 1);


Is this the wrong way?

Thanks, Stephanie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top