[Kexi] Merge data from Kexi to KWord

Jaroslaw Staniek js at iidea.pl
Tue Feb 12 09:59:14 CET 2008


John Jason Jordan said the following, On 2008-02-12 04:13:
> On Mon, 11 Feb 2008 10:12:04 +0100
> Jaroslaw Staniek <js at iidea.pl> dijo:
> 
>> John Jason Jordan said the following, On 2008-02-11 07:37:
>>> I go into Tools > Configure Mail Merge > Open Existing, and in the
>>> popup I select Qt-SQL Source (power user) - which is the only choice -
>>> and then I click on OK. 
>>>
>>> This gives me another popup asking for Hostname, Driver, Database name,
>>> Username and Port. I enter the name of the computer (Devil7), leave the
>>> driver at QMYSQL3 (the only option), drag the database file from
>>> Nautilus into the Database Name box (the filename appears correctly),
>>> enter my username (jjj), and leave the Port at "default." 
>>>
>>> When I click on OK, I am prompted for the password, so I enter the root
>>> password. And then I get "Can't connect to MySQL server on
>>> 'Devil7' (111)." 
>>>
>>> I suspect that putting "Devil7" in the top box is wrong, but I can't
>>> find anything in the Help files that explains where to tell KWord to
>>> look for the file. The file is right here on the same computer as KWord
>>> - not on a networked server somewhere. 
> 
>> IIRC, this feature has been added long before Kexi appeared.
> 
> Which feature do you mean?

Tools > Configure Mail Merge; it's not related to Kexi in any explicit way.

>> Kexi's is not QtSQL-based, the KWord's feature is not dependent on whether the 
>> database was created usign Kexi or not. Your problem can be related to 
>> connection itself. Why do you use nautilus in the procedure or enter uppercase 
>> computer name? Try entering IP address or locelhost if the database is put on 
>> the same computer.
>>
>> and try to test:
>> mysql -h {IP} -u root -p
> 
> I get the error message "Can't connect to local MySQL server through
> socket '/var/run/mysqld/mysqld.sock' (2)." I get this error message
> whether I try to connect via KWord (Tools > Configure Mail Merge), or
> using the command line you gave me above.
> 
> As for why I used Nautilus, it was just a fast way to type the filename
> into the box in the KWord connection window. The Kexi file is
> named /home/jjj/REPI/QuestionBank_kexi.kexi. I got tired of typing it
> over and over again and found that the filename and path are inserted
> automatically if I just drag the file from a Nautilus window into the
> box. Besides, it eliminates typos.

.kexi files are SQLite files. This is completely different thing compared to 
mysql databases and their server names. Unless KWord 1.x can open SQLite 
format (usign QtSQL), you cannot type .kexi filename into KWord Mailmerge's 
input box.

>>> Can someone give me a step by step for how to get KWord to merge data
>>> from a Kexi database file?
>> Exprort to CSV from Kexi, then paste or insert the file. Kexi also ofers a 
>> Python plugin for exporting tables to html, which could be imported too.
> 
> I can export from Kexi as .csv files, but the database has 43 tables in
> it. Doing them one at a time would be painful. Furthermore, I never
> want to merge an entire table, so I use queries to select specific
> records from the 43 tables and place them into another table called
> "Worktable." "Worktable" is what I want to merge from, but the data in
> it will always be changing. Furthermore, most of the tables have 25+
> fields but I want only selected fields, not the entire table. Pasting
> an entire table into a KWord document is not a solution.

Couldn't you run a query within Kexi to limit your set of records?

>> For Kexi 2 there's a plan for more direct embedding of query results in other 
>> KDE apps.
> 
> So at this time KWord cannot connect to data in Kexi?

You should be able - by connecting to native database (raw tables) on top of 
which Kexi is operating. Either SQLite, PostgreSQL or MySQL. Always be 
providing proper conenction data - again - without mixing kexi database file 
path with server database name.

> Thanks for the suggestions. Still trying to figure out how to merge
> selected data into a word processor. I'd actually prefer to merge into
> OpenOffice.org Writer, but I tried KWord because OOo cannot merge data
> from Kexi either. I thought it might be easier using a KDE app like
> KWord.

-- 
regards / pozdrawiam, Jaroslaw Staniek
  Sponsored by OpenOffice Polska (http://www.openoffice.com.pl/en) to work on
  Kexi & KOffice (http://www.kexi.pl/en, http://www.koffice.org/kexi)
  KDE Libraries for MS Windows (http://windows.kde.org)



More information about the Kexi mailing list