FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 2024
→
Customer specific captions
Customer specific captions
Débuté par SolutionJ-Reg, 30 oct. 2014 19:35 - 7 réponses
Connectez-vous…
SolutionJ-Reg
#1
Posté le 30 octobre 2014 - 19:35
Hi,
I want to allow different companies who use a computer system I've written to choose different names for certain database fields.
So, for example, I might have a field called ProductID, which has a caption in the Analysis set to 'Product', but a particular company might want to see this as 'Item' on every form and report it appears on.
Currently I do this in code which examines the caption of every data field on every form and report as they open. I enclose the caption on the form/report in # (so e.g. #Product#) and then use string functions to replace it with the required value which I retrieve from a table.
This works, but is complex and must slow the system down. Is there a better way of doing this?
Cheers
Reg
Signaler
0
0
Ola
#2
Posté le 30 octobre 2014 - 21:44
Hi Reg,
Here's what I do:
Put the changeable field captions in fields in a global one-record parameter file, where the user can give any names to them.
Replace the field names in forms with something like ProdId..Caption = PARAM.ProdIdName.
If these fields are used in tables and reports, they must be moved to column headers with something like Table.ProdIdName..Caption = PARAM.ProdIdName
And you can take this even further by defining the caption names in the product group (or category) file, so that they can be different in different category products.
If these are optional fields, and their caption fields are empty, then grey them or make them invisible.
Best regards
Ola
Signaler
0
0
Stefan Bentvelsen
#3
Posté le 31 octobre 2014 - 09:19
Hi Reg,
if the speed is a problem, you could try to use MyWindow..DisplayEnabled before and after the replacement in your window.
// Before the replacement:
MyWindow..DisplayEnabled = False
// Your caption replacements
// ...
// After the replacement:
MyWindow..DisplayEnabled = True
The window is than refreshed ones.
Signaler
0
0
SolutionJ-Reg
#4
Posté le 31 octobre 2014 - 09:21
Hi Stefan,
Thanks, that's a good idea.
Cheers
Reg
Signaler
0
0
SolutionJ-Reg
#5
Posté le 31 octobre 2014 - 09:21
Hi Ola,
Thanks for this, it sounds like a cleaner way to do it.
Cheers
Reg
Signaler
0
0
Arie Mars
#6
Posté le 31 octobre 2014 - 09:37
I would do this in the opening section of a window. Before the window is shown in the first place.
Otherwise the user may see thee 'old' caption first and then the change to a new caption.
I can;t imagine speed will be a problem, at least not the drawing part. Or you must have dozens of controls, which could possibly change.
If you read the new captions from let's say the database, just be sure to create proper indexes on the table holding this info.
Or use an array and read these values once, ie when starting.
Signaler
0
0
SolutionJ-Reg
#7
Posté le 31 octobre 2014 - 09:38
Thanks Arie
Signaler
0
0
Dave
#8
Posté le 31 octobre 2014 - 11:06
How about using the user defined languages 1-15
set up each caption variation at language level and dynamically select the coorect language 1 to 15 for each company
Dave
Signaler
0
0
→ Revenir à WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte