我在测试FastReport Open Source。告诉我,如何在报表中注册PostgreSQL数据库?我试图在免费的设计器社区中创建一个报表,但只有MS SQL。我知道只有一种方法可以用Nuget的包从代码中构建报告,这是对的?

最佳答案

使用最新版本FastReport Open Source 2018.4.9。它可以和PotgreSQL一起工作。设计器社区版具有本机PostgreSQL连接器。您还需要在应用程序中添加来自NuGet的FastReport.OpenSource.Data.Postgres
在应用程序启动时执行以下代码一次:

FastReport.Utils.RegisteredObjects.AddConnection(typeof(PostgresDataConnection));

现在您应该能够从设计器或代码创建新的PostgreSQL数据源:
Report report = new Report();
report.Load(@"YourReport.frx");
//...
PostgresDataConnection conn = new PostgresDataConnection();
conn.ConnectionString = "your connection string";
conn.CreateAllTables();
report.Dictionary.Connections.Add(conn);

关于c# - 如何在FastReport开源中注册PostgreSQL,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/53080630/

10-11 04:59