Date: prev next · Thread: first prev next last
2015 Archives by date, by thread · List index


Bonjour,Avec libreoffice 4.3.3.2, je cherche désespérément à ajouter un champ formaté à un rapport 
fait avec report builder.
J'arrive à cloner un champ puis à modifier ses propriétés mais je n'arrive pas à ajouter 
directement un champ formaté avec basic  dans mon raport.
Voici ce qui marche (j'ai un nouveau champ toto dans mon rapport) :dim oConnection as object
dim aProp(2) as new com.sun.star.beans.PropertyValue
dim oReportsDocuments as object
dim oReportDesign as object
oConnection = ThisDatabaseDocument.DataSource.getconnection("","")
aProp(0).Name = "ActiveConnection"
aProp(0).Value = oConnection
aProp(1).Name = "Hidden"
aProp(1).Value = true
aProp(2).Name = "OpenMode"
aProp(2).Value = "openDesign"
oReportsDocuments = ThisDatabaseDocument.ReportDocuments
'Open report in design mode and hidden
oReportDesign = oReportsDocuments.loadComponentFromURL("Rapport1", "", 0, aProp())
REM ###############################
oField = oReportDesign.Detail.getbyindex(1).createclone
oField.name="toto"REM ###############################
oReportDesign.detail.add(oField)
aProp(1).Value = false
aProp(2).Value = "open"
' Now the result of the report wil be showed. and the hidden report in design mode is closed
oReportsDocuments.loadComponentFromURL("Rapport1_Artistes-Albums-Pistes", "", 23, aProp())

maintenant si je créé le champ toto en remplaçant les deux lignes entre commentaires par :
oField = createUnoService("com.sun.star.comp.report.OFormattedField")
with oField
    .name = "toto"
    .datafield = "field:[Format]"
    .positionX = 14000
    .positionY = 0
    .width = 2000
    .height = 500
end with
oReportDesign.detail.add(oField)
je n'obtiens pas de message d'erreur mais je n'ai pas de nouveau champ toto dans mon rapport.Est-ce 
que j'oublie une propriété?Comment procéder?
Merci encore pour votre aide.

-- 
Envoyez un mail à users+unsubscribe@fr.libreoffice.org pour savoir comment vous désinscrire
Les archives de la liste sont disponibles à http://listarchives.libreoffice.org/fr/users/
Tous les messages envoyés sur cette liste seront archivés publiquement et ne pourront pas être 
supprimés

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.