PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WEBDEV 2024
→
ERR_BAD_CONTEXT_INVALID
ERR_BAD_CONTEXT_INVALID
Started by Zach, Jun., 21 2013 8:16 PM - 3 replies
Connect yourself…
Zach
#1
Posted on June, 21 2013 - 8:16 PM
I'm trying to print a pdf with the following code on a button click:
invoiceNum = ...
TABLE.COLUMN[TableSelect(TABLE,1)]
sFile = fWebDir() + "\" + DateSys() + TimeSys() + 1 + invoiceNum + ".pdf"
iDestination(iPDF, sFile)
iInitReportQuery(REPORT,invoiceNum)
iPrintReport(REPORT)
FileDisplay(sFile, "application/pdf", "Report " + invoiceNum + ".pdf")
It works for most items but generates a 54, ERR_BAD_CONTEXT_INVALID when I try to filedisplay the larger reports.
Report
0
0
Fabrice Harari
#2
Posted on June, 22 2013 - 5:28 PM
Hi Zach
it MAY be that the report is not fully generated (external module doing
the work) at the time you do your filedisplay... Try to put a multitask
between the two, to check if that is the case....
Best regards
--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting
New web site (EXPERIMENTAL)
http://www.fabriceharari.eu
(More information on
http://www.fabriceharari.com
)
On 6/21/2013 12:16 PM, Zach wrote:
I'm trying to print a pdf with the following code on a button click:
invoiceNum = ...
TABLE.COLUMN[TableSelect(TABLE,1)]
sFile = fWebDir() + "\" + DateSys() + TimeSys() + 1 + invoiceNum +
".pdf" iDestination(iPDF, sFile)
iInitReportQuery(REPORT,invoiceNum)
iPrintReport(REPORT)
FileDisplay(sFile, "application/pdf", "Report " + invoiceNum + ".pdf")
It works for most items but generates a 54, ERR_BAD_CONTEXT_INVALID when
I try to filedisplay the larger reports.
Report
0
0
Diego
#3
Posted on June, 22 2013 - 5:51 PM
Is there any slight difference between your "normal" and "larger" reports ?
Report
0
0
Zach
#4
Posted on June, 24 2013 - 7:55 PM
you were right Fabrice, it was not fully generating the report.
The difference between smaller and larger reports was the smaller had 1 - 5 lines in the body and the larger had over 1000.
I narrowed down the cause in the report and it happened whenever there were enough lines to overflow into a second page. I fixed the problem by unselecting Breakable Block in the details of the block description.
Report
0
0
→ Go back to WEBDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (earlier versions)
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text