0

我有一个基于使用 2 个表和大约 47 列的视图的水晶报表。这是在 2008 年创建的。现在我必须将此报告导入 c# asp.net 项目并使用我创建的数据集作为同一报告的数据源。它给出错误说明使用视图创建的公式字段正在引发类似这样的错误

This field name is not known.
    Details: errorKindError in File statement {C4B51C11-81BC-4D27-9886-23BE50D5A9D0}.rpt:
    Error in formula  Location: 
    'if {statements_view.DOC_TYPE} = 'RU' then
    {statements_view.BUNUMBER_RU}
    else {statements_view.BUNUMBER}

我在这里错过了什么吗?

到目前为止,这是我的代码

string connetionString = null;
OracleConnection connection;
OracleDataAdapter OracleAdapter;
DataSet ds = new DataSet();
string firstSql = null;
string secondSql = null;

connetionString = "DATA SOURCE= blah blah ";
firstSql = "select * from STATEMENT_DOMESTIC";
secondSql = "Select * from STATEMENT_DOM_DETAILS";
connection = new OracleConnection(connetionString);

connection.Open();
OracleAdapter = new OracleDataAdapter(firstSql, connection);
OracleAdapter.Fill(ds, "Tables[0]");
OracleAdapter.SelectCommand.CommandText = secondSql;
OracleAdapter.Fill(ds, "tables[1]");

OracleAdapter.Dispose();
connection.Close();
// GridView1.DataSource = ds;
//  GridView1.DataBind();

ReportDocument reportDoc = new ReportDocument();
reportDoc.Load(@"c:\statement.rpt");
reportDoc.SetDataSource(ds.Tables);

 ExportOptions CrExportOptions;
DiskFileDestinationOptions CrDiskFileDestinationOptions =new DiskFileDestinationOptions();
PdfRtfWordFormatOptions CrFormatTypeOptions = new PdfRtfWordFormatOptions();
CrDiskFileDestinationOptions.DiskFileName = @"d:\Converte5_1_13.pdf";
CrExportOptions = reportDoc.ExportOptions;
{
CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions;
CrExportOptions.FormatOptions = CrFormatTypeOptions;

}
reportDoc.Export();
}

我的数据集有问题还是我在这里遗漏了什么..关于这个问题的任何指导都是

4

0 回答 0