PB à toute heure et à tout moment. (à parcourir avec modération)

Le forum (ô combien francophone) des utilisateurs de Powerbuilder.

Recherche rapide

Annonce

Certaines rubriques, dont des cours, sont uniquement visibles par les membres du forum ^^.
Dans la rubrique Liens & Références, vous avez accès à un sommaire de téléchargement, profitez-en !
Il existe maintenant un nouveau TOPIC "Votre CV en Ligne" accessible uniquement par demande.

#1 26-11-2008 15:54:51

johnpelu  
Membre Power Geek
Date d'inscription: 17-10-2008
Messages: 179
Pépites: 677
Banque: 0

[RESOLU] Changer la couleur d'une cellule

La syntaxe ci-dessous ne change pas la couelur et pourtant j'ai testé le code retour et cela fonctionne correctement.

Code: pb

dw_planning.modify("projects_project_name_AM_"+string(ll_col)+".background.color='"+string(ll_color_value)+"'")

Dernière modification par johnpelu (27-11-2008 12:33:25)

Hors ligne

 

#2 26-11-2008 16:33:08

Chrnico  
N2I Power
Award: bf
Lieu: Vanves
Date d'inscription: 05-06-2007
Messages: 1206
Pépites: 12,884,901,943
Banque: 9,223,372,036,854,776,000
Site web

Re: [RESOLU] Changer la couleur d'une cellule

Ton code doit changer la couleur de fond la colonne (pour toutes les lignes).

Donc pour moi il n'y a que deux pistes :
- soit ton fond a l'attribu transparent
- soit une autre ligne change la couleur après celle-ci


Tu dois donc tu peux (Kant)

Tu peux donc tu dois (N2i)
www.n2i.fr

Hors ligne

 

#3 26-11-2008 16:34:18

johnpelu  
Membre Power Geek
Date d'inscription: 17-10-2008
Messages: 179
Pépites: 677
Banque: 0

Re: [RESOLU] Changer la couleur d'une cellule

Chrnico a écrit:

Ton code doit changer la couleur de fond la colonne (pour toutes les lignes).

Donc pour moi il n'y a que deux pistes :
- soit ton fond a l'attribu transparent
- soit une autre ligne change la couleur après celle-ci

Euh en fait je veux le changer pour une ligne bien spécifique, à chaque ligne , selon les type de projet j'aurais une couleur différente pour la colonne

Hors ligne

 

#4 26-11-2008 17:04:22

Cortex  
Modérateur
Lieu: Arlon
Date d'inscription: 08-02-2008
Messages: 194
Pépites: 6,904
Banque: 2,109,818,425,070

Re: [RESOLU] Changer la couleur d'une cellule

johnpelu a écrit:

Chrnico a écrit:

Ton code doit changer la couleur de fond la colonne (pour toutes les lignes).

Donc pour moi il n'y a que deux pistes :
- soit ton fond a l'attribu transparent
- soit une autre ligne change la couleur après celle-ci

Euh en fait je veux le changer pour une ligne bien spécifique, à chaque ligne , selon les type de projet j'aurais une couleur différente pour la colonne

Et pourquoi tu ne met pas une expression dans la background color de ta colonne qui se base sur la valeur du type de projet pour la ligne courante?

Hors ligne

 

#5 26-11-2008 17:24:09

johnpelu  
Membre Power Geek
Date d'inscription: 17-10-2008
Messages: 179
Pépites: 677
Banque: 0

Re: [RESOLU] Changer la couleur d'une cellule

Cortex a écrit:

johnpelu a écrit:

Chrnico a écrit:

Ton code doit changer la couleur de fond la colonne (pour toutes les lignes).

Donc pour moi il n'y a que deux pistes :
- soit ton fond a l'attribu transparent
- soit une autre ligne change la couleur après celle-ci

Euh en fait je veux le changer pour une ligne bien spécifique, à chaque ligne , selon les type de projet j'aurais une couleur différente pour la colonne

Et pourquoi tu ne met pas une expression dans la background color de ta colonne qui se base sur la valeur du type de projet pour la ligne courante?

Expression du genre ? Car le je suis pas , je suis de retour dans une heure, en tout cas merci pour ton aide sur la DW Dynamique ca marche du tonnerre, faut que je regarde aussi au header ;-)

Hors ligne

 

#6 26-11-2008 17:42:37

Cortex  
Modérateur
Lieu: Arlon
Date d'inscription: 08-02-2008
Messages: 194
Pépites: 6,904
Banque: 2,109,818,425,070

Re: [RESOLU] Changer la couleur d'une cellule

johnpelu a écrit:

Expression du genre ? Car le je suis pas , je suis de retour dans une heure, en tout cas merci pour ton aide sur la DW Dynamique ca marche du tonnerre, faut que je regarde aussi au header ;-)

F1 a écrit:

Using expressions in property values

With some DataWindow properties, you can assign a value through an expression that the DataWindow evaluates during execution, instead of having to assign a value directly. For example, the following statement displays a salary in red if it is less than $12,000, and in black otherwise:

dw_1.Modify("salary.Color = '0 ~t if(salary <12000,255,0)' ")

Donc, si le type de projet est un des champs de ta datawindow (mettons qu'il s'apelle "projectType"), tu devrais mettre dans bgcolor de ton projet (mettons la colonne "project"):

Code: pb

dw_1.Modify("project.background.color = '0 ~t if(projectType = 1, rgb(255,0,0) , rgb(0,255,0) )' ")

...par exemple...


Hors ligne

 

#7 26-11-2008 18:33:59

johnpelu  
Membre Power Geek
Date d'inscription: 17-10-2008
Messages: 179
Pépites: 677
Banque: 0

Re: [RESOLU] Changer la couleur d'une cellule

Bah j'avais fait  mais ca ne marche pasAvec un If non plus et j'ai egalement une chaine une chaine vide (donc normalement ca devrait changer la couleur) si je teste le retour.
Et au final aucun changement de couleur pour la cellule

Dernière modification par johnpelu (26-11-2008 18:40:45)

Hors ligne

 

#8 26-11-2008 18:42:50

erasorz  
Admin
Lieu: Babylone
Date d'inscription: 23-11-2006
Messages: 5121
Pépites: 97,197
Banque: 2,147,483,647

Re: [RESOLU] Changer la couleur d'une cellule

d'ailleurs pourquoi utiliser un modify pour qqchose de définitif, autant le mettre en expression de DW comme suggéré un paquet de fois en utilisant une colonne masquée adhoc...

si besoin :  sur le forum et dans l'aide PB


N'envoyez jamais un humain faire le travail d'un programme.

Hors ligne

 

#9 26-11-2008 18:46:36

johnpelu  
Membre Power Geek
Date d'inscription: 17-10-2008
Messages: 179
Pépites: 677
Banque: 0

Re: [RESOLU] Changer la couleur d'une cellule

erasorz a écrit:

d'ailleurs pourquoi utiliser un modify pour qqchose de définitif, autant le mettre en expression de DW comme suggéré un paquet de fois...

si besoin : 

Excuse moi, mais le "comme suggéré un paquet de fois..." sous-entend que je n'ai pas suivi vos conseils, mais j'ai toutefois changé en faisant une datawindow dynamique et en laissant tomber la crosstab , j'ai également effectué des tests pour changer les couleurs des cellules en fonction du type de projet (ce qui ne marche pas et pourtant je respecte les syntaxes).
Je ne vois pa d'autre solution pour pouvoir changer la couleur d'une cellule spécifique qu'un modify de celle-ci, si toi tu le sais alors dis le moi, mais apparemment mes posts te dérangent plus qu'autre chose.
Et l'aide de PB me renvoie vers un Modify

Dernière modification par johnpelu (26-11-2008 18:47:55)

Hors ligne

 

#10 26-11-2008 20:08:24

johnpelu  
Membre Power Geek
Date d'inscription: 17-10-2008
Messages: 179
Pépites: 677
Banque: 0

Re: [RESOLU] Changer la couleur d'une cellule

Voici la syntaxe de ma Datawindow

Code: pb

release 11.5;
detail(height=120 color="536870912" transparency="0" gradient.color="8421504" gradient.transparency="0" gradient.angle="0" brushmode="0" gradient.repetition.mode="0" gradient.repetition.count="0" gradient.repetition.length="100" gradient.focus="0" gradient.scale="100" gradient.spread="100" )
table(column=(type=date updatewhereclause=yes name=day_service dbname='' )
column=(type=char(50) name=consultant_name_1 dbname='' )
column=(type=char(30) name=projects_project_name_AM_1 dbname='' )
column=(type=char(30) name=projects_project_name_PM_1 dbname='' )
column=(type=char(50) name=consultant_name_2 dbname='' )
column=(type=char(30) name=projects_project_name_AM_2 dbname='' )
column=(type=char(30) name=projects_project_name_PM_2 dbname='' )
)
column(band=detail id=1 alignment="0" tabsequence=10 border="2" color="33554432" x="133" y="56" height="52" width="329" format="[general]" html.valueishtml="0"  name=consultant_day_day_service visible="1" edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes  font.face="Verdana" font.height="-7" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )
column(band=detail id=2 alignment="2" tabsequence=20 border="2" color="33554432" x="466" y="0" height="52" width="699" format="[general]" html.valueishtml="0"  name=consultants_consultant_name_1 visible="1" edit.limit=50 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes  font.face="Verdana" font.height="-8" font.weight="700"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" tooltip.enabled="1")
column(band=detail id=3 alignment="2" tabsequence=30 border="2" color="33554432" x="466" y="56" height="52" width="347" format="[general]" html.valueishtml="0"  name=projects_project_name_AM_1 visible="1" edit.limit=30 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes  font.face="Verdana" font.height="-7" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" tooltip.enabled="1")
column(band=detail id=4 alignment="2" tabsequence=40 border="2" color="33554432" x="818" y="56" height="52" width="347" format="[general]" html.valueishtml="0"  name=projects_project_name_PM_1 visible="1" edit.limit=30 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes  font.face="Verdana" font.height="-7" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" tooltip.enabled="1")
column(band=detail id=5 alignment="2" tabsequence=50 border="2" color="33554432" x="1170" y="0" height="52" width="699" format="[general]" html.valueishtml="0"  name=consultants_consultant_name_2 visible="1" edit.limit=50 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes  font.face="Verdana" font.height="-8" font.weight="700"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" tooltip.enabled="1")
column(band=detail id=6 alignment="2" tabsequence=60 border="2" color="33554432" x="1170" y="56" height="52" width="347" format="[general]" html.valueishtml="0"  name=projects_project_name_AM_2 visible="1" edit.limit=30 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes  font.face="Verdana" font.height="-7" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" tooltip.enabled="1")
column(band=detail id=7 alignment="2" tabsequence=70 border="2" color="33554432" x="1522" y="56" height="52" width="347" format="[general]" html.valueishtml="0"  name=projects_project_name_PM_2 visible="1" edit.limit=30 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes  font.face="Verdana" font.height="-7" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" tooltip.enabled="1")

quelle raison fait que

Code: pb

dw_planning.modify("projects_project_name_AM_"+string(ll_col)+".background.color='"+string(ll_color_value)+"'"


ne fait pas en sorte que ma cellule change de couleur ?

Dernière modification par johnpelu (26-11-2008 20:09:05)

Hors ligne

 

#11 26-11-2008 20:08:31

erasorz  
Admin
Lieu: Babylone
Date d'inscription: 23-11-2006
Messages: 5121
Pépites: 97,197
Banque: 2,147,483,647

Re: [RESOLU] Changer la couleur d'une cellule

johnpelu a écrit:

mais apparemment mes posts te dérangent plus qu'autre chose.

j'ai essayé de t'aider à plusieurs reprises, donc je ne pense pas que tes posts me "dérangent" outre mesure
si c'était le cas j'y serais allé d'un petit bart :




pour répondre concrètement à ta question :

johnpelu a écrit:

Je ne vois pa d'autre solution pour pouvoir changer la couleur d'une cellule spécifique qu'un modify de celle-ci, si toi tu le sais alors dis le moi,

tu ouvres ta DW
dans le DW painter, tu sélectionnes ta colonne
tu vas dans properties
sur background color (ou toute autre proriété qui doit être conditionnelle), tu cliques sur le bouton [=]
tu saisis une expression du genre la suivante, en remplaçant la condition colonne_virtuel = 1  par celle que souhaites  :

nico a écrit:

Au niveau de ta colonne (propriété du Background color), tu peux mettre une condition du type

Code: pb

if( colonne_virtuel = 1  , rgb(255,0,0) , if( colonne_virtuel = 2, rgb(255,128,0) , if (colonne_virtuel = 3 , rgb(0,255,0), rgb(255,255,255) ) ))

N'envoyez jamais un humain faire le travail d'un programme.

Hors ligne

 

#12 27-11-2008 10:52:09

johnpelu  
Membre Power Geek
Date d'inscription: 17-10-2008
Messages: 179
Pépites: 677
Banque: 0

Re: [RESOLU] Changer la couleur d'une cellule

Je tiens d'abord à m'excuser pour m'être énervé hier soir.
J'ai essayé ta méthode, je mets les conditions dans la création de la syntaxe de ma DW , comme tu peux voir ci-dessous, mais ca ne fonctionne pas.
J'ai récupéré ma syntaxe et l'ai mise dans le Painter Datawindow, ai vérifié la condition est elle est OK.
En fait, ma condition repose sur la valeur d'une autre colonne, cette colonne je lui affecte la valeur comme ceci :

Code: pb

dw_planning.setvalue( 'projects_type_id_AM_'+string(ll_col), int(ll_row), string(lds_data_planning.object.projects_type_id[ll_i_temp]))


Je n'ai pas choisi le SetItem car malgré le fait que ma colonne était en visible="0" la valeur apparaissait à l'écran, donc j'ai pris le SetValue.
Chose bizarre, c'est que quand je veux faire un messagebox de ma value (pour voir si c'est correct), le messagebox n'apparait pas, j'ai donc essayé de faire un messagebox du SetValue et la ca apparait et ca me retourne 1 (donc succès du SetValue).
Est-ce que Quelqu'un à une idée ?

Code: pb

release 11.5;
header(height=50 color="536870912" transparency="0" gradient.color="8421504" gradient.transparency="0" gradient.angle="0" brushmode="0" gradient.repetition.mode="0" gradient.repetition.count="0" gradient.repetition.length="100" gradient.focus="0" gradient.scale="100" gradient.spread="100" )
detail(height=70 color="536870912" transparency="0" gradient.color="8421504" gradient.transparency="0" gradient.angle="0" brushmode="0" gradient.repetition.mode="0" gradient.repetition.count="0" gradient.repetition.length="100" gradient.focus="0" gradient.scale="100" gradient.spread="100" )
table(column=(type=date updatewhereclause=yes name=day_service dbname='' )
column=(type=decimal(0) name=projects_type_id_AM_1 dbname='' )
column=(type=char(30) name=projects_project_name_AM_1 dbname='' )
column=(type=decimal(0) name=projects_type_id_PM_1 dbname='' )
column=(type=char(30) name=projects_project_name_PM_1 dbname='' )
column=(type=decimal(0) name=projects_type_id_AM_2 dbname='' )
column=(type=char(30) name=projects_project_name_AM_2 dbname='' )
column=(type=decimal(0) name=projects_type_id_PM_2 dbname='' )
column=(type=char(30) name=projects_project_name_PM_2 dbname='' )
)
text(band=header alignment="2" text="Consultant Name" border="2" color="33554432" x="466" y="0" height="52" width="699" html.valueishtml="0"  name=consultant_name_1 visible="1"  font.face="Verdana" font.height="-8" font.weight="700"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )
text(band=header alignment="2" text="Consultant Name" border="2" color="33554432" x="1170" y="0" height="52" width="699" html.valueishtml="0"  name=consultant_name_2 visible="1"  font.face="Verdana" font.height="-8" font.weight="700"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )
column(band=detail id=1 alignment="0" tabsequence=32766 border="2" color="33554432" x="133" y="0" height="65" width="329" format="[general]" html.valueishtml="0"  name=consultant_day_day_service visible="1" edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes  font.face="Verdana" font.height="-7" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )
column(band=detail id=2 alignment="2" tabsequence=32766 border="2" color="33554432" x="466" y="0" height="65" width="347" format="[general]" html.valueishtml="0"  name=projects_type_id_AM_1 visible="0" edit.limit=30 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes  font.face="Verdana" font.height="-7" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )
column(band=detail id=3 alignment="2" tabsequence=32766 border="2" color="33554432" x="466" y="0" height="65" width="347" format="[general]" html.valueishtml="0"  name=projects_project_name_AM_1 visible="1" edit.limit=30 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes  font.face="Verdana" font.height="-7" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912   if( projects_type_id_AM_1 = 3  , rgb(255,0,0),0)" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )
column(band=detail id=4 alignment="2" tabsequence=32766 border="2" color="33554432" x="466" y="0" height="65" width="347" format="[general]" html.valueishtml="0"  name=projects_type_id_PM_1 visible="0" edit.limit=30 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes  font.face="Verdana" font.height="-7" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )
column(band=detail id=5 alignment="2" tabsequence=32766 border="2" color="33554432" x="818" y="0" height="65" width="347" format="[general]" html.valueishtml="0"  name=projects_project_name_PM_1 visible="1" edit.limit=30 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes  font.face="Verdana" font.height="-7" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912   if( projects_type_id_PM_1 = 3  , rgb(255,0,0),0)" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )
column(band=detail id=6 alignment="2" tabsequence=32766 border="2" color="33554432" x="1170" y="0" height="65" width="347" format="[general]" html.valueishtml="0"  name=projects_type_id_AM_2 visible="0" edit.limit=30 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes  font.face="Verdana" font.height="-7" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )
column(band=detail id=7 alignment="2" tabsequence=32766 border="2" color="33554432" x="1170" y="0" height="65" width="347" format="[general]" html.valueishtml="0"  name=projects_project_name_AM_2 visible="1" edit.limit=30 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes  font.face="Verdana" font.height="-7" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912   if( projects_type_id_AM_2 = 3  , rgb(255,0,0),0)" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )
column(band=detail id=8 alignment="2" tabsequence=32766 border="2" color="33554432" x="1170" y="0" height="65" width="347" format="[general]" html.valueishtml="0"  name=projects_type_id_PM_2 visible="0" edit.limit=30 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes  font.face="Verdana" font.height="-7" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )
column(band=detail id=9 alignment="2" tabsequence=32766 border="2" color="33554432" x="1522" y="0" height="65" width="347" format="[general]" html.valueishtml="0"  name=projects_project_name_PM_2 visible="1" edit.limit=30 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes  font.face="Verdana" font.height="-7" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912   if( projects_type_id_PM_2 = 3  , rgb(255,0,0),0)" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )

Hors ligne

 

#13 27-11-2008 11:08:05

Nephtis  
Bienfaiteur du site
Award: bf
Lieu: Longjumeau
Date d'inscription: 29-06-2007
Messages: 665
Pépites: 17,189,873,958
Banque: 9,223,372,036,854,776,000

Re: [RESOLU] Changer la couleur d'une cellule

johnpelu a écrit:

Je n'ai pas choisi le SetItem car malgré le fait que ma colonne était en visible="0" la valeur apparaissait à l'écran, donc j'ai pris le SetValue.
Chose bizarre, c'est que quand je veux faire un messagebox de ma value (pour voir si c'est correct), le messagebox n'apparait pas, j'ai donc essayé de faire un messagebox du SetValue et la ca apparait et ca me retourne 1 (donc succès du SetValue).
Est-ce que Quelqu'un à une idée ?

Si j'ai bien compris :

1MessageBox("Debug", maDataWindow.GetItemX(ligne,colonne)) ==> pas d'affichage de la MessageBox

2MessageBox("Debug", dw_planning.setvalue(...)) ==> affichage de '1' (succès)


1 Si il n'y a pas d'affichage c'est qu'il contient une valeur nulle : vérifier l'affectation.

2 Succès mais est ce que ça a bien modifié la valeur dans la colonne (je n'ai jamais utilisé SetValue )


J'ai pas trop eu le temps de lire ton problème en profondeur et c'est l'heure de manger
C'est juste un début de piste


Qui sème des problèmes, récolte des réponses.
PB 6.5 || ASE 12.5.4 || XP SP3

Hors ligne

 

#14 27-11-2008 11:24:31

nico  
Modérateur
Award: bf
Lieu: Plélan le grand
Date d'inscription: 08-02-2007
Messages: 273
Pépites: 13
Banque: 9,223,372,036,854,776,000

Re: [RESOLU] Changer la couleur d'une cellule

Si j'ai bien compris,

1 - Tu as mis ta condition pour rendre ta colonne invisible dans les propriétés de ta colonne.
2 - Tu as fais un test directement dans ta DW en affectant une valeurs à ta colonne 'projects_type_id_AM_1' de façon à rendre invisible la colonne ou tu as mis ta condition.
3 - Jusque là, ça marche.
4 - Dans ton code tu fais un setvalue() sur ta colonne 'projects_type_id_AM_1' avec la même valeur que dans le test précédent (celui qui marche). Et là, ça ne marche pas.

As tu une visualisation de la valeur collée avec ton setvalue() à l'écran en affichant ta datawindow?

Ce que je peux te conseiller, c'est de vérifier étape par étape si tout fonction, c'est à dire, créer ta DW et l'afficher, puis vérifier si tout colle. Ensuite tu mets un tabsequence = 1 sur la colonne ou tu veux affecter ta valeur , et tu vas la saisir à la main, puis tu vois si ta colonne devient invisible.
Si ça marche, il faut revoir ton setvalue() (?), sinon, il faut revoir ta DW.

Hors ligne

 

#15 27-11-2008 11:30:00

Cortex  
Modérateur
Lieu: Arlon
Date d'inscription: 08-02-2008
Messages: 194
Pépites: 6,904
Banque: 2,109,818,425,070

Re: [RESOLU] Changer la couleur d'une cellule

Je pense qu'il y a méprise là... Comment t'es venue l'idée d'utiliser setvalue()? Parce que ça ne fait absolument pas la même chose que le setItem().

Pour certains format d'edit de colonne, comme la listbox, tu peux vouloir afficher pour certaines valeur une chaine spécifique. Exemple: tu as une colonne censée s'afficher comme une listbox pour présenter une liste de valeur numériques (1,2,3,...) mais tu veux que ta liste t'affiche "Vide" quand la valeur sélectionnée est NULL. Pour ce faire, il y a une petite table de mapping attachée à ta colonne, et dans le cas présent, tu decrais y mettre {data=[null]-display="Vide"}.
Bref, le setValue permet de modifier dynamiquement ces mappings, pas de modifier la valeur de ta colonne.

Un rapide coup d'oeil aux 2 méthodes dans l'aide de l'expliquera mieux que moi.

Le setiItem doit marcher. Je veux dire, il marche fatalement. Mais s'il ne fait pas ce que tu veux, c'est qu'il y a anguille sous roche. Vérifie bien en debug chacune de tes étapes. N'hésite pas à checker chaque valeur de retour de fonction, et de la comparer avec les valeurs de retour décrite dans l'aide respective de chaque méthode.

Que veux-tu faire exactement?
Tu veux modifier projects_type_id_AM_... :

Code: pb

dw_planning.setitem( ll_row, 'projects_type_id_AM_'+string(ll_col), ll_value)

// ll_row doit être compris entre 1 et dw_planning.rowcount()
// ll_col doit pour toi être soit 1 soit 2 (puisque tu n'as que 2 possibilités dans ta dw à l'heure actuelle)
// ll_value est bien un numérique puisque ta colonne est decimal(0)
// setitem doit te renvoyer 1


Ensuite, tu veux modifier la couleur de background de projects_project_name_AM_... en fonction de projects_type_id_AM_... Donc dans ta syntaxe du doit avoir quelque chose comme:

Code: pb

column(band=detail id=3 alignment="2" tabsequence=32766 border="2" color="33554432" x="466" y="0" height="65" width="347" format="[general]" html.valueishtml="0"  name=projects_project_name_AM_1 visible="1~tif(projects_type_id_AM_1 = 1, rgb(255,0,0), rgb(0,255,0))" // ... etc

// et projects_type_id_AM_1 à cette ligne là ne doit pas être NULL


Voilà, ça, c'est le core business de la datawindow, si ça ne marche pas, c'est soit qu'il y a un problème ailleurs, une faute de distraction (je modifie une colonne en croyant que c est une autre, etc...) ou alors c'est un truc plus subtile... Une erreur frequente qui fait que des colonnes invisibles (ou protected) apparaissent, est que la colonne a cacher soit la seule de l'ecran à pouvoir avoir le focus, ou qu'elle soit la 1ere dans l'ordre de tabsequence. Or dans ton cas, ce ne doit pas être le cas...

Hors ligne

 

#16 27-11-2008 11:40:57

johnpelu  
Membre Power Geek
Date d'inscription: 17-10-2008
Messages: 179
Pépites: 677
Banque: 0

Re: [RESOLU] Changer la couleur d'une cellule

Bon j'ai revérifié et en utilisant le SetItem dans ma colonne "non visible" (et en vérifiant sa valeur) c'est ok , la valeur qu'il me faut est bien affectée et l'affichage est des données reste correct.
Donc ce qui est inquiétant c'est que ma condition n'est pas prise en compte alors qu'elle est correcte syntaxiquement et que la valeur correspond à celle qui est dans mon test.

Hors ligne

 

#17 27-11-2008 11:50:11

Cortex  
Modérateur
Lieu: Arlon
Date d'inscription: 08-02-2008
Messages: 194
Pépites: 6,904
Banque: 2,109,818,425,070

Re: [RESOLU] Changer la couleur d'une cellule

Désolé, j'ai modifié mon dernier post pendant que tu repondais, jettes-y un oeil.

Hors ligne

 

#18 27-11-2008 11:53:19

johnpelu  
Membre Power Geek
Date d'inscription: 17-10-2008
Messages: 179
Pépites: 677
Banque: 0

Re: [RESOLU] Changer la couleur d'une cellule

Cortex a écrit:

Désolé, j'ai modifié mon dernier post pendant que tu repondais, jettes-y un oeil.

Pas de souci, à mon avis ca doit etre une erreur à la con, je vais chercher, car ce que tu expliques je l'ai fait, p-e est-ce une option lors de la création de ma DW, je vais checker tout cela.
Euh dans ton exemple sur la DW, tu mets la condition if sur visible, moi je la mets sur background.color, c'est bien sur le background.color hein ?
Merci

Dernière modification par johnpelu (27-11-2008 11:55:52)

Hors ligne

 

#19 27-11-2008 12:02:35

Cortex  
Modérateur
Lieu: Arlon
Date d'inscription: 08-02-2008
Messages: 194
Pépites: 6,904
Banque: 2,109,818,425,070

Re: [RESOLU] Changer la couleur d'une cellule

Oui, autant pour moi (quand je parlais de distraction... )

Hors ligne

 

#20 27-11-2008 12:33:01

johnpelu  
Membre Power Geek
Date d'inscription: 17-10-2008
Messages: 179
Pépites: 677
Banque: 0

Re: [RESOLU] Changer la couleur d'une cellule

Bon bah voila, j'ai trouvé, pour que la couleur du background change il faut que

Code: pb

background.mode="0"

Dans mon cas c'était égal à 1.
Merci à tous

Hors ligne

 

#21 27-11-2008 14:04:42

Chrnico  
N2I Power
Award: bf
Lieu: Vanves
Date d'inscription: 05-06-2007
Messages: 1206
Pépites: 12,884,901,943
Banque: 9,223,372,036,854,776,000
Site web

Re: [RESOLU] Changer la couleur d'une cellule

johnpelu a écrit:

Bon bah voila, j'ai trouvé, pour que la couleur du background change il faut que

Code: pb

background.mode="0"

Dans mon cas c'était égal à 1.
Merci à tous

C'est quand même dommage de ne pas avoir lu mon premier post.
Ca aurait fait gagner pas mal de temps à tout le monde


Tu dois donc tu peux (Kant)

Tu peux donc tu dois (N2i)
www.n2i.fr

Hors ligne

 

Pied de page des forums

Propulsé par FluxBB 1.2.22