PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WEBDEV 2024 → [WB26] YesNo Dialog and Filedisplay
[WB26] YesNo Dialog and Filedisplay
Débuté par a.martinez, 22 fév. 2024 12:21 - Aucune réponse
Membre enregistré
1 message
Posté le 22 février 2024 - 12:21
Hello

I have the following code on a button server code click (not ajax) that fist add data to some DB tables and then ask the user with a YesNo dialog box to print a report.

addtoDB()
IF YesNo(Yes,"Do you want to print?") = Yes THEN
iInitReportQuery(RPT_MYRPT,gnMyID)
iDestination(iGenericPDF,CompleteDir(fWebDir())+gnMyID+".pdf")
iPrintReport(RPT_MYRPT)
FileDisplay(CompleteDir(fWebDir()) + gnMyID+".pdf","application/unknown", gnMyID+".pdf")


if I click yes then the YesNo dialog box does not close and is stuck open and if I click again I get the following error:
Invalid request: the page context 'WebDevMessageBox' is unknown.
Check:
- the requested url,
- the validity of the page name.
- the presence of the page context (the context may have been closed by ContextClose or PageUse).
(8, ERR_BAD_PAGE)

I tested and if I comment the Filedisplay, the YesNo closes normally. But now how can I download that file? Any alternatives or tips?
Thank You