Page 1 of 2

Configure postgres

Posted: Sun Jul 18, 2010 12:55 pm
by esr
Hello.
Currently developing applications with Delphi for PHP and PostgreSQL. How I have to configure "Stimulsoft Reports.Fx for PHP" for use with postgres?.
When I try to configure the connection Dictionary-> New Connection-> only appears: "XML Data" and "MySQL Connection".

Thank you very much.

ESR.

Configure postgres

Posted: Mon Jul 19, 2010 5:05 am
by Vladimir
Hello,

Support for PostgreSQL data sources has already been finished, the new version of Stimulsoft Reports.Fx for PHP will be available tomorrow.

Thank you.

Configure postgres

Posted: Thu Jul 22, 2010 11:45 am
by esr
Hello.
Today I downloaded the latest version available for php, and still shows no connection to postgres or through ODBC.
ESR

Configure postgres

Posted: Fri Jul 23, 2010 5:35 am
by Edmund Andersson
Beta 2 is the "old" Beta Version, a new version is still not released.

/Edmund Andersson

Configure postgres

Posted: Fri Jul 23, 2010 2:44 pm
by Jan
Hello,

New version will be available at 24 July. At this moment we at final stage of testing.

Thank you.

Configure postgres

Posted: Tue Jul 27, 2010 12:14 am
by Andrew
Hello,

Sorry for the delay with response. Our new Beta 3 version is published.

Thank you.

Configure postgres

Posted: Tue Jul 27, 2010 12:10 pm
by esr
Hello.
I have tried to connect, but I could not. I am using the following parameters:
Server=localhost;Port=5432;Database=DEMO;UserId=postgres;Password=123456;

Could help to correctly configure postgres connection?

Configure postgres

Posted: Wed Jul 28, 2010 3:31 am
by Vladimir
Hello,

We checked the connection to PostgreSQL database and found an error on the server side script. We send you a corrected PHP script, please see the attacher archive.

Thank you.

Configure postgres

Posted: Sat Jul 31, 2010 4:02 am
by tony.tomov
Hello Vladimir,

I think that PostgreSQL driver has a lot of bugs.

1. It seems like the PosgreSQL driver uses parseMySqlConnectionString to configure connection.
This is wrong since the default port of PostgreSQL is 5432 and not 3306 (MySQL)
In order to fix I think that a separate parsePgSqlConnectionString function should be created with the following default settings.

Code: Select all

	function parsePgSqlConnectionString($connectionString)
	{
		class connectionInfo {
			var $host;
			var $port = "5432";
			var $database;
			var $userId;
			var $password;
		}
...
2. The function getPostgreSQLDatabaseColumns uses a wrong convertMySqlType function to get the field types.
In order to fix I have created convertPgSqlType which replaces convertMySqlType in getPostgreSQLDatabaseColumns function.
The function look like this (It can be refined)

Code: Select all

	function convertPgSqlType($type)
	{
		switch (strtolower($type))
		{
			case "varchar":
			case "bpchar":
			case "macaddr":
			case "inet":
			case "money":
			case "text":
				return "System.String";

			case "bool":
				return "System.Boolean";

			case "bit":
			case "int8":
			case "int4":
			case "int2":
			case "interval":
				return "System.Int32";

			case "float4":
			case "float8":
			case "numeric":
				return "System.Decimal";

			case "date":
			case "time":
			case "timetz":
			case "timestamp":
			case "timestamptz":
				return "System.DateTime";
			default:
			 	return "System.String";				
		}

		return $type;
	}
Hope this help ;-)

Kind Regards
Tony

Configure postgres

Posted: Mon Aug 02, 2010 4:53 am
by Vladimir
Hello, Tony

Thank you for you excellent help, we will include these corrections in the next version of Reports.Fx for PHP.

Thanks.