по поводу приведенного поясню:2007:08:07, 18:13: StiReport: Loading report
2007:08:07, 18:13: StiSqlAdapterService: Method : [OnError] : Prepared statement '(@beginDate datetime,@endDate datetime,@author int,@firm int,@de' expects parameter @beginDate, which was not supplied.
====================================================
в System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
в System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
в System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
в System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
в System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
в System.Data.SqlClient.SqlDataReader.get_MetaData()
в System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
в System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
в System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
в System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
в System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
в System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
в System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
в System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
в System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
в System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
в Stimulsoft.Report.Dictionary.StiSqlSource.UpdateParameters()
в Stimulsoft.Report.Dictionary.StiSqlAdapterService.ConnectDataSourceToData(StiDictionary dictionary, StiDataSource dataSource, Boolean loadData)
====================================================
A first chance exception of type 'System.Data.SqlClient.SqlException' occurred in Stimulsoft.Report.dll
System.Data.SqlClient.SqlException: Prepared statement '(@beginDate datetime,@endDate datetime,@author int,@firm int,@de' expects parameter @beginDate, which was not supplied.
в System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
в System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
в System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
в System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
в System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
в System.Data.SqlClient.SqlDataReader.get_MetaData()
в System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
в System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
в System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
в System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
в System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
в System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
в System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
в System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
в System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
в System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
в Stimulsoft.Report.Dictionary.StiSqlSource.UpdateParameters()
в Stimulsoft.Report.Dictionary.StiSqlAdapterService.ConnectDataSourceToData(StiDictionary dictionary, StiDataSource dataSource, Boolean loadData)
в Stimulsoft.Report.Dictionary.StiDataSource.Connect(StiDataCollection datas, Boolean loadData)
в Stimulsoft.Report.Dictionary.StiDataSourcesCollection.Connect(StiDataCollection datas, Boolean loadData)
в Stimulsoft.Report.Dictionary.StiDataSourcesCollection.Connect(Boolean loadData)
в Stimulsoft.Report.Dictionary.StiDictionary.Connect(Boolean loadData)
в BusinessLib.Reports.CashOperationsReport.PrepareData(Boolean forDesign) в D:\NewProject\xservice\BusinessLib\Reports\CashOperationsReport.cs:строка 110
Используется DataSource от SQL Connection со следующим запросом (упрощенно):
параметры @beginDate, @endDate, @firm, @department, @author определены и в Expression у них стоят переменные отчёта , т.е. напримерSELECT
docs.Number as poNum,
pol.Interest
FROM dbo.POperations as pol
INNER JOIN dbo.Documents as docs ON docs.id = pol.Owner
AND docs.Registered = 1
AND docs.Date >= @beginDate
AND docs.Date < DATEADD(day,1, @endDate)
AND docs.Firm = @firm
AND docs.Department = @department
AND docs.Author = @author
@department = _department где _department - переменная инициализируемая в приложении как
Report.Dictionary.Variables.Add("_department", Department.ID);