FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 2024
→
[WD] How to change "search key" on a report
[WD] How to change "search key" on a report
Débuté par Gianni Spano, 21 oct. 2016 08:15 - 4 réponses
Connectez-vous…
Gianni Spano
#1
Posté le 21 octobre 2016 - 08:15
Hello to all
I have a report to print customers data from my application.
The report has a "search key" (with low and upper bound checked) based on the customer_name field and this is ok.
What i'm trying to do : Is it possible to "change" at runtime the "search key" field selecting one from the available other keys file? (like customer_code order)
I didn't find any information on the help.
Please, Can someone tell me if is it possible??
Thanks in advance
Gianni
Signaler
0
0
Gianni Spano
#2
Posté le 21 octobre 2016 - 08:25
Doing a deep search on the online help, i found this example, that i think is related to my needed:
// -- Opening code of the report
// Change the file browsed
RPT_Report1..SourceName = Customer
// New search item for "Customer" file
RPT_Report1..BrowsedItem = CustomerID
Is it the way i have to follow??
Thanks
Gianni
Signaler
0
0
Gianni Spano
#3
Posté le 21 octobre 2016 - 12:17
Hello
I think there is an OLD bug with "browseditem" on the report design.
This is the code i'm using to set the "search key" on the report:
SWITCH ASL_ReportMedici.RADIO_TipoStampa CASE 1 RPT_medici..SourceName=medici RPT_medici..BrowsedItem=medici.id CASE 2 RPT_medici..SourceName=medici RPT_medici..BrowsedItem=medici.id_cup OTHER CASE END iPreview(ipvZoom100, "Anteprima") iPrintReport(RPT_medici)
When i run the application, an error occurs (in french??):
Erreur à la ligne 3 du traitement Click BTN_Avvia.
Le champ 'RPT_medici' est inconnu.
How to resolve this issue?
Any hint or tip is appreciated..
Gianni
Signaler
0
0
Piet van Zanten
#4
Posté le 21 octobre 2016 - 13:03
Hi Gianni,
Looks to me that you are trying to change the report properties outside the report.
Since the report is not opened yet you get the error that the report is unknown.
So you need to put your code in the report opening code and pass the BrowsedItem value to the report as a parameter (string).
Best regards,
Piet
Signaler
0
0
Gianni Spano
#5
Posté le 21 octobre 2016 - 13:38
Hello Piet
Thanks for the suggestion. It works!
I have used two global variables (gsSourceName and gsBrowsedItem)
Before to print the report both variables are set like:
gsSourceName="medici" gsBrowsedItem="id" // or "id_cup" depending on the user choice
and in the opening section of the report:
MySelf..SourceName=gsSourceName MySelf..BrowsedItem=gsBrowsedItem
And finally the report is printed as it is selected.
Thanks again
Gianni
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