private static void ReportExportJPG()
{
Report report = new Report();
report.Load(@"sql-report.frx");
report.Prepare(); // <<<--- Error here
...
}
eRROR消息是:
cant查找对象mssqldataconnection
Feature Tablow表示,MS SQL连接(NOR ODBC,也没有许多其他)在FastrePort.Mono中不可用。这是否意味着它完全缺少,或者我应该使用其他方式并以某种方式提供与FastrePort的现成连接?如果是这样 - 如何?
P.S。在Wine下运行Windows Report Report Generator,葡萄酒下的MS SQL连接运行良好,因此我认为从CentOS连接到MS SQL是可行的。
我能够通过将以下内容添加到我的项目来源来解决此问题:插入包装“ fastreport.opensource.data.mssql”,然后从下面编写代码,
using FastReport.Data; using FastReport.Utils; ... RegisteredObjects.AddConnection(typeof(MsSqlDataConnection));
FastReport.Utils.RegisteredObjects.AddConnection(typeof(MsSqlDataConnection));
var report = new Report();
report.Load(Path);