Ich verwende Windows XP SP3, Crystal Reports Basic Version 10.5.3700.0 (gefolgt von c: \ windows \ assembly)), Visual Studio 2008, MSSQL 2008 R2.Ich möchte Crystal Report drucken "bill.rpt" konnte nicht drucken oder als PDF in meiner Entwicklungsumgebung speichern
Fehler
Error in File C:\DOCUME~1\NKT\LOCALS~1\Temp\Bill {CE9EC584-2281}.rpt:
Fehlerbeschreibung
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Ausnahmedetails:
System.Runtime.InteropServices.COMException: Error in File C:\DOCUME~1\NKT\LOCALS~1\Temp\Bill
{CE9EC584-2281-4C5F-89ED-54C60AFCC0CB}.rpt:
The table could not be found.
Quellfehler:
Line 2697: myReportDocument.SetDataSource(ds); Line
2698: //myReportDocument.PrintToPrinter(1, true,0,0);
Line 2699: myReportDocument.PrintToPrinter(1, false, 0, 0);
Source File: c:\Documents and Settings\NKT\My Documents\Visual
Studio 2008\Projects\\ParlerBill.aspx.cs Line: 2699
Hier
ist mein CS-Datei Code-Schnipsel
//--Opening Sql Connection
String strConn = ConfigurationManager.AppSettings["connectionString"];
SqlConnection sqlConn = new SqlConnection(strConn);
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(strCmd, sqlConn);
sqlConn.Open();
//--this statement is very important, here the table name should match with the XML Schema table name.
da.Fill(ds, "customerbilldetail");
//--Closing Sql Connection
sqlConn.Close();
//--(Optional) I have used it to disable the properties
CrystalReportViewer1.Visible = true;
CrystalReportViewer1.DisplayGroupTree = false;
CrystalReportViewer1.HasCrystalLogo = false;
//--Initializing CrystalReport
ReportDocument myReportDocument;
myReportDocument = new ReportDocument();
myReportDocument.Load(Server.MapPath("~//Repport/Bill.rpt"));
myReportDocument.SetDatabaseLogon("sa", "saa");
myReportDocument.SetDataSource(ds);
//myReportDocument.PrintToPrinter(1, true,0,0);
myReportDocument.PrintToPrinter(1, false, 0, 0);
Hier ist der Fehler zu werfen ist.
Soweit Ihre Sorge hat mir @ Mario geholfen. –