31 messages in org.openoffice.fr.prog[prog] Probleme concernant le datasou...
FromSent OnAttachments
thom...@free.frApr 15, 2005 5:51 am 
Laurent GodardApr 15, 2005 6:04 am 
thom...@free.frApr 15, 2005 6:22 am 
thom...@free.frApr 15, 2005 7:23 am 
Bernard MarcellyApr 15, 2005 7:43 am 
thom...@free.frApr 15, 2005 7:59 am 
thom...@free.frApr 18, 2005 12:05 am 
Bernard MarcellyApr 18, 2005 1:53 am 
thom...@free.frApr 18, 2005 3:03 am 
thom...@free.frApr 18, 2005 5:50 am 
thom...@free.frApr 18, 2005 7:35 am 
Bernard MarcellyApr 18, 2005 9:40 am 
Thomas CoqueryApr 20, 2005 5:48 am 
Thomas CoqueryApr 20, 2005 6:35 am 
Thomas CoqueryApr 20, 2005 7:55 am 
Laurent GodardApr 20, 2005 8:10 am 
Thomas CoqueryApr 20, 2005 11:11 pm 
Josianne SAUVAGEApr 21, 2005 1:51 am 
will...@free.frApr 21, 2005 2:07 am 
Thomas CoqueryApr 21, 2005 2:08 am 
will...@free.frApr 21, 2005 2:22 am 
Alain NowakApr 21, 2005 7:30 am 
Josianne SAUVAGEApr 21, 2005 9:01 am 
Jean-MichelApr 21, 2005 9:06 am 
GVApr 21, 2005 10:20 am 
Josianne SAUVAGEApr 22, 2005 2:15 am 
Thomas CoqueryApr 22, 2005 2:27 am 
Thomas CoqueryApr 27, 2005 6:50 am 
Thomas CoqueryApr 29, 2005 2:47 am 
Laurent GodardApr 29, 2005 3:06 am 
Thomas CoqueryApr 29, 2005 6:15 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[prog] Probleme concernant le datasource dans un publipostage (ma table n'existe pas)Actions...
From:thom...@free.fr (thom@free.fr)
Date:Apr 15, 2005 5:51:09 am
List:org.openoffice.fr.prog

Voilà, je dois réaliser un publipostage openoffice en le pilotant à partir d'une appli delphi. Ce publipostage concerne un .sxw et un .txt (avec des ";" comme séparateurs) Je sais réaliser un publipostage si la source existe dans openoffice, mon problème est que lors de l'installation de l'application , la source ne sera pas dans openoffice... Il me faut donc savoir la créer (on ne va pas demander à un utilisateur lambda de le faire). Je me suis donc renseigné et j'ai trouvé comment créer une DataSource... Celle ci se crée bien mais le problème est qu'elle ne contient aucune table... Comment puis je faire pour qu'elle en contienne ou que celles ci soient visibles.

Je vous passe mon code en même temps (juste pour la DataSource mais si quelqu'un veut le MailMerge en Delphi c'est tout à fait faisable)

procedure TTest.bt_creation_datasourceClick(Sender: TObject); var arguments:variant; PropertyValue :variant; CoreReflection: Variant; begin //création d'un database context qui contient toutes les sources de données //connait open office Datacontext:=OpenOffice.createInstance('com.sun.star.sdb.DatabaseContext'); //si openoffice connait la source src1 if Datacontext.hasbyname('src1') then Memo_Enumeration.Lines.Add('src1 trouvé') else begin // Core reflection est utilisé pour pouvoir créer des property value CoreReflection := OpenOffice.createInstance ('com.sun.star.reflection.CoreReflection'); // un tableau dynamique de propertyvalues arguments:= VarArrayCreate([0,7], varVariant);

CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(PropertyValue); PropertyValue.Name := 'Extension'; PropertyValue.Value := 'txt'; arguments[0]:= PropertyValue ; PropertyValue.Name := 'Charset'; PropertyValue.Value := 0; arguments[1]:= PropertyValue ; PropertyValue.Name := 'FixedLength'; PropertyValue.Value := true; arguments[2]:= PropertyValue ; PropertyValue.Name := 'HeaderLine'; PropertyValue.Value := true; arguments[3]:= PropertyValue ; PropertyValue.Name := 'FieldDelimiter'; PropertyValue.Value := ';'; arguments[4]:= PropertyValue ; PropertyValue.Name := 'StringDelimiter'; PropertyValue.Value := '"'; arguments[5]:= PropertyValue ; PropertyValue.Name := 'DecimalDelimiter'; PropertyValue.Value := '.'; arguments[6]:= PropertyValue ; PropertyValue.Name := 'ThousandDelimiter'; PropertyValue.Value := ','; arguments[7]:= PropertyValue ; //création de la datasource avec parametres Datasource:=OpenOffice.createInstance('com.sun.star.sdb.DataSource'); //enregistrement dans openoffice datacontext.registerObject('src1',Datasource); Datasource.URL:= 'sdbc:flat:file:///C:/Dossiers/coquery'; Datasource.Info:= arguments; connection:=datasource.getconnection('',''); {datasource.TableFilter.('essai'); datasource.TableTypeFilter.'TABLE';} datasource.TableTypeFilter.getType {connection.tables;} end; end; Je rappelle mon problème vient du fait que le MailMerge ne détecte pas ma table (essai) qui correspond au fichier .txt

Sinon toutes mes excuses à Laurent Godard que j'ai importuné sur un mail professionnel alors que cette liste existait...(je ne le savais pas encore)