 |
|
| Computers Forum Index » Computer - Databases - Paradox » Report print problem...?... |
|
Page 1 of 1 |
|
| Author |
Message |
| Kenneth... |
Posted: Mon Apr 06, 2009 11:47 pm |
|
|
|
Guest
|
Howdy,
Running P9 with XP
I have a button with several blocks of code on it.
Usually, all works well.
The portion below runs a query, loads a report, and prints
the report.
Sometimes however, the report fails to print.
It generates no errors, and if it fails to print, and I then
view the report manually, it looks fine, and manually prints
properly.
I have had problems with code to print reports in the past,
and for many of them, have gone to Microsoft Word for the
actual printing.
I could do that for this purpose, but before I do, thought
to ask:
Might you see a problem with the code below?
qInv = Query
ANSWER: :MONEY:INVOICE.DB
:MONEY:INVOICES.DB | Num | InvNumber | Replaces | Last | First |
| Check _join1 | Check ~newInvNumber | Check |
Check as LastNameField | Check |
:MONEY:INVOICES.DB | Adr | Purpose | InvDate | DueDate | DUE | RECEIVED |
| Check | Check | Check | Check | Check
| Check |
:MONEY:INVOICES.DB | Balance | Tag | Comment | ReplaceNote |
| Check | Check | Check | Check |
ADDRESS.DB | Num | L7 | L6 | L5 | L4 | L3
| L2 |
| _join1 | Check | Check | Check | Check | Check
| Check |
ADDRESS.DB | L1 | City | State | Zip | Inv |
| Check | Check | Check | Check | True |
EndQuery
if not executeQBE(qInv) then
errorShow()
return
endIf
if not r.load(":MONEY:Invoice",winStyleHidden) then
errorShow()
return
endIf
r.pastDueText.visible=FALSE
r.pastDueBox.visible=FALSE
r.balanceLabel.visible=FALSE
r.balance.FONT.COLOR=WHITE
r.receivedLabel.visible=FALSE
r.received.FONT.COLOR=WHITE
r.matures.visible=true
r.line.visible=false
r.save()
if not r.close() then
errorShow()
return
endIf
if not r.print(":MONEY:Invoice") then
errorShow()
return
endIf
Sincere thanks,
--
Kenneth
If you email... Please remove the "SPAMLESS." |
|
|
| Back to top |
|
|
|
| Jim Giner... |
Posted: Tue Apr 07, 2009 1:10 am |
|
|
|
Guest
|
On the surface (meaning I didn't debug your query or compare your field
names to that query) it looks pretty straight-forward. You're saying that
the last part (r.print) is the part that fails? Are you sure that the Print
actually fails, and it's not the fault of the r.close failing and causing a
Return? I find that errorshow doesn't alway "show" something - I'd insert a
msgstop in addition so that you always see something if it errors out.
"Kenneth" <usenet at (no spam) soleSPAMLESSassociates.com> wrote in message
news:avikt4pu488t6v0csni1hbap1hekrho493 at (no spam) 4ax.com...
Quote: Howdy,
Running P9 with XP
I have a button with several blocks of code on it.
Usually, all works well.
The portion below runs a query, loads a report, and prints
the report.
Sometimes however, the report fails to print.
It generates no errors, and if it fails to print, and I then
view the report manually, it looks fine, and manually prints
properly.
I have had problems with code to print reports in the past,
and for many of them, have gone to Microsoft Word for the
actual printing.
I could do that for this purpose, but before I do, thought
to ask:
Might you see a problem with the code below?
qInv = Query
ANSWER: :MONEY:INVOICE.DB
:MONEY:INVOICES.DB | Num | InvNumber | Replaces | Last | First |
| Check _join1 | Check ~newInvNumber | Check |
Check as LastNameField | Check |
:MONEY:INVOICES.DB | Adr | Purpose | InvDate | DueDate | DUE |
RECEIVED |
| Check | Check | Check | Check | Check
| Check |
:MONEY:INVOICES.DB | Balance | Tag | Comment | ReplaceNote |
| Check | Check | Check | Check |
ADDRESS.DB | Num | L7 | L6 | L5 | L4 | L3
| L2 |
| _join1 | Check | Check | Check | Check | Check
| Check |
ADDRESS.DB | L1 | City | State | Zip | Inv |
| Check | Check | Check | Check | True |
EndQuery
if not executeQBE(qInv) then
errorShow()
return
endIf
if not r.load(":MONEY:Invoice",winStyleHidden) then
errorShow()
return
endIf
r.pastDueText.visible=FALSE
r.pastDueBox.visible=FALSE
r.balanceLabel.visible=FALSE
r.balance.FONT.COLOR=WHITE
r.receivedLabel.visible=FALSE
r.received.FONT.COLOR=WHITE
r.matures.visible=true
r.line.visible=false
r.save()
if not r.close() then
errorShow()
return
endIf
if not r.print(":MONEY:Invoice") then
errorShow()
return
endIf
Sincere thanks,
--
Kenneth
If you email... Please remove the "SPAMLESS." |
|
|
| Back to top |
|
|
|
| Kenneth... |
Posted: Tue Apr 07, 2009 1:35 am |
|
|
|
Guest
|
On Mon, 6 Apr 2009 16:10:49 -0400, "Jim Giner"
<jim.giner at (no spam) suny.edu> wrote:
Quote:
"Kenneth" <usenet at (no spam) soleSPAMLESSassociates.com> wrote in message
news:avikt4pu488t6v0csni1hbap1hekrho493 at (no spam) 4ax.com...
Howdy,
Running P9 with XP
I have a button with several blocks of code on it.
Usually, all works well.
The portion below runs a query, loads a report, and prints
the report.
Sometimes however, the report fails to print.
It generates no errors, and if it fails to print, and I then
view the report manually, it looks fine, and manually prints
properly.
I have had problems with code to print reports in the past,
and for many of them, have gone to Microsoft Word for the
actual printing.
I could do that for this purpose, but before I do, thought
to ask:
Might you see a problem with the code below?
qInv = Query
ANSWER: :MONEY:INVOICE.DB
:MONEY:INVOICES.DB | Num | InvNumber | Replaces | Last | First |
| Check _join1 | Check ~newInvNumber | Check |
Check as LastNameField | Check |
:MONEY:INVOICES.DB | Adr | Purpose | InvDate | DueDate | DUE |
RECEIVED |
| Check | Check | Check | Check | Check
| Check |
:MONEY:INVOICES.DB | Balance | Tag | Comment | ReplaceNote |
| Check | Check | Check | Check |
ADDRESS.DB | Num | L7 | L6 | L5 | L4 | L3
| L2 |
| _join1 | Check | Check | Check | Check | Check
| Check |
ADDRESS.DB | L1 | City | State | Zip | Inv |
| Check | Check | Check | Check | True |
EndQuery
if not executeQBE(qInv) then
errorShow()
return
endIf
if not r.load(":MONEY:Invoice",winStyleHidden) then
errorShow()
return
endIf
r.pastDueText.visible=FALSE
r.pastDueBox.visible=FALSE
r.balanceLabel.visible=FALSE
r.balance.FONT.COLOR=WHITE
r.receivedLabel.visible=FALSE
r.received.FONT.COLOR=WHITE
r.matures.visible=true
r.line.visible=false
r.save()
if not r.close() then
errorShow()
return
endIf
if not r.print(":MONEY:Invoice") then
errorShow()
return
endIf
Sincere thanks,
--
Kenneth
If you email... Please remove the "SPAMLESS."
Quote: On the surface (meaning I didn't debug your query or compare your field
names to that query) it looks pretty straight-forward. You're saying that
the last part (r.print) is the part that fails? Are you sure that the Print
actually fails, and it's not the fault of the r.close failing and causing a
Return? I find that errorshow doesn't alway "show" something - I'd insert a
msgstop in addition so that you always see something if it errors out.
Hi Jim,
I know that the problem is not with the query because when
the printing fails, I can still open (and print) the report
manually, and it looks fine.
I had not thought of the possibility that a failure to close
the report could cause the failure of printing. I will look
into that.
Thanks,
--
Kenneth
If you email... Please remove the "SPAMLESS." |
|
|
| Back to top |
|
|
|
| Jim Moseley... |
Posted: Tue Apr 07, 2009 2:03 am |
|
|
|
Guest
|
Kenneth,
You need to test the result of the Save().
But, really, why are you saving the report? Since you used Load(), you can
adjust it however you want, then directly Run() it.
Also, if this is a multi-user application, you might be overwriting each
other's report.
Here's my suggested fix:
;r.save() ; <- do not need
;if not r.close() then; ; <- do not need
; errorShow() ; <- do not need
;return ; <- do not need
;endIf ; <- do not need
if not r.run() then ; <- add
errorShow() ; <- add
return ; <- add
endif ; <- add
if not r.print(":MONEY:Invoice") then
errorShow()
return
endIf
HTH,
Jim Moseley |
|
|
| Back to top |
|
|
|
| Kenneth... |
Posted: Tue Apr 07, 2009 2:51 am |
|
|
|
Guest
|
On 6 Apr 2009 17:03:39 -0400, "Jim Moseley"
<jmose at (no spam) mapson.triptracker.com> wrote:
Quote:
Kenneth,
You need to test the result of the Save().
But, really, why are you saving the report? Since you used Load(), you can
adjust it however you want, then directly Run() it.
Also, if this is a multi-user application, you might be overwriting each
other's report.
Here's my suggested fix:
;r.save() ; <- do not need
;if not r.close() then; ; <- do not need
; errorShow() ; <- do not need
;return ; <- do not need
;endIf ; <- do not need
if not r.run() then ; <- add
errorShow() ; <- add
return ; <- add
endif ; <- add
if not r.print(":MONEY:Invoice") then
errorShow()
return
endIf
HTH,
Jim Moseley
Hi Jim,
This particular thing is strictly single user...
That said, I thank you for your suggestions, but can't give
'em as try before tomorrow.
I'll let you know,
--
Kenneth
If you email... Please remove the "SPAMLESS." |
|
|
| Back to top |
|
|
|
| Kenneth... |
Posted: Tue Apr 07, 2009 6:31 pm |
|
|
|
Guest
|
On 6 Apr 2009 17:03:39 -0400, "Jim Moseley"
<jmose at (no spam) mapson.triptracker.com> wrote:
Quote:
Kenneth,
You need to test the result of the Save().
But, really, why are you saving the report? Since you used Load(), you can
adjust it however you want, then directly Run() it.
Also, if this is a multi-user application, you might be overwriting each
other's report.
Here's my suggested fix:
;r.save() ; <- do not need
;if not r.close() then; ; <- do not need
; errorShow() ; <- do not need
;return ; <- do not need
;endIf ; <- do not need
if not r.run() then ; <- add
errorShow() ; <- add
return ; <- add
endif ; <- add
if not r.print(":MONEY:Invoice") then
errorShow()
return
endIf
HTH,
Jim Moseley
Hi Jim,
I'm making progress (of a sort), but the report still won't
print.
Here's the current code:
qInv = Query
ANSWER: :MONEY:INVOICE.DB
:MONEY:INVOICES.DB | Num | InvNumber | Replaces | Last | First |
| Check _join1 | Check ~newInvNumber | Check |
Check as LastNameField | Check |
:MONEY:INVOICES.DB | Adr | Purpose | InvDate | DueDate | DUE | RECEIVED |
| Check | Check | Check | Check | Check
| Check |
:MONEY:INVOICES.DB | Balance | Tag | Comment | ReplaceNote |
| Check | Check | Check | Check |
ADDRESS.DB | Num | L7 | L6 | L5 | L4 | L3
| L2 |
| _join1 | Check | Check | Check | Check | Check
| Check |
ADDRESS.DB | L1 | City | State | Zip | Inv |
| Check | Check | Check | Check | True |
EndQuery
if not executeQBE(qInv) then
errorShow()
return
endIf
if not r.load(":MONEY:Invoice",winStyleHidden) then
errorShow()
sleep(2000)
return
endIf
r.pastDueText.visible=FALSE
r.pastDueBox.visible=FALSE
r.balanceLabel.visible=FALSE
r.balance.FONT.COLOR=WHITE
r.receivedLabel.visible=FALSE
r.received.FONT.COLOR=WHITE
r.matures.visible=true
r.line.visible=false
if not r.run()
then
errorShow()
return
endIf
if not r.print(":MONEY:Invoice") then
errorShow()
return
endIf
When I run the code, I get an error on the query telling me
that it can't run because its destination table,
:MONEY:INVOICE.DB, is "in use."
Nothhing anywhere else points to that table, so I am having
trouble understand how it could be "in use." (And, when I
try to open it manually, it opens properly, and appears
empty.)
What might be an appropriate next step in sorting this out?
Many thanks, as before,
--
Kenneth
If you email... Please remove the "SPAMLESS." |
|
|
| Back to top |
|
|
|
| Jim Giner... |
Posted: Tue Apr 07, 2009 6:54 pm |
|
|
|
Guest
|
During your trial and error(s), you probably have a "hidden" report on your
desktop. Remove the hide parm of the load and debug your script - that way
you'll know if you have something still open on that table.
"Kenneth" <usenet at (no spam) soleSPAMLESSassociates.com> wrote in message
news:gjkmt4tapc4qkaq35ht3mt05rgpmqbqins at (no spam) 4ax.com...
Quote: On 6 Apr 2009 17:03:39 -0400, "Jim Moseley"
jmose at (no spam) mapson.triptracker.com> wrote:
Kenneth,
You need to test the result of the Save().
But, really, why are you saving the report? Since you used Load(), you
can
adjust it however you want, then directly Run() it.
Also, if this is a multi-user application, you might be overwriting each
other's report.
Here's my suggested fix:
;r.save() ; <- do not need
;if not r.close() then; ; <- do not need
; errorShow() ; <- do not need
;return ; <- do not need
;endIf ; <- do not need
if not r.run() then ; <- add
errorShow() ; <- add
return ; <- add
endif ; <- add
if not r.print(":MONEY:Invoice") then
errorShow()
return
endIf
HTH,
Jim Moseley
Hi Jim,
I'm making progress (of a sort), but the report still won't
print.
Here's the current code:
qInv = Query
ANSWER: :MONEY:INVOICE.DB
:MONEY:INVOICES.DB | Num | InvNumber | Replaces | Last
| First |
| Check _join1 | Check ~newInvNumber | Check |
Check as LastNameField | Check |
:MONEY:INVOICES.DB | Adr | Purpose | InvDate | DueDate | DUE |
RECEIVED |
| Check | Check | Check | Check | Check
| Check |
:MONEY:INVOICES.DB | Balance | Tag | Comment | ReplaceNote |
| Check | Check | Check | Check |
ADDRESS.DB | Num | L7 | L6 | L5 | L4 | L3
| L2 |
| _join1 | Check | Check | Check | Check | Check
| Check |
ADDRESS.DB | L1 | City | State | Zip | Inv |
| Check | Check | Check | Check | True |
EndQuery
if not executeQBE(qInv) then
errorShow()
return
endIf
if not r.load(":MONEY:Invoice",winStyleHidden) then
errorShow()
sleep(2000)
return
endIf
r.pastDueText.visible=FALSE
r.pastDueBox.visible=FALSE
r.balanceLabel.visible=FALSE
r.balance.FONT.COLOR=WHITE
r.receivedLabel.visible=FALSE
r.received.FONT.COLOR=WHITE
r.matures.visible=true
r.line.visible=false
if not r.run()
then
errorShow()
return
endIf
if not r.print(":MONEY:Invoice") then
errorShow()
return
endIf
When I run the code, I get an error on the query telling me
that it can't run because its destination table,
:MONEY:INVOICE.DB, is "in use."
Nothhing anywhere else points to that table, so I am having
trouble understand how it could be "in use." (And, when I
try to open it manually, it opens properly, and appears
empty.)
What might be an appropriate next step in sorting this out?
Many thanks, as before,
--
Kenneth
If you email... Please remove the "SPAMLESS." |
|
|
| Back to top |
|
|
|
| Anders... |
Posted: Tue Apr 07, 2009 6:59 pm |
|
|
|
Guest
|
Quote: When I run the code, I get an error on the query telling me
that it can't run because its destination table,
:MONEY:INVOICE.DB, is "in use."
If I understand correctly that is the table which the report is based on.
You run the report hidden, then print, but you are not closing the report.
That will leave the report on the desktop - hidden - the second time you run
the code the table is "in use" - by the hidden report.
I *think* you need to close the report after the print.
Anders |
|
|
| Back to top |
|
|
|
| Kenneth... |
Posted: Tue Apr 07, 2009 8:44 pm |
|
|
|
Guest
|
On Tue, 7 Apr 2009 09:54:51 -0400, "Jim Giner"
<jim.giner at (no spam) suny.edu> wrote:
Quote: During your trial and error(s), you probably have a "hidden" report on your
desktop. Remove the hide parm of the load and debug your script - that way
you'll know if you have something still open on that table.
"Kenneth" <usenet at (no spam) soleSPAMLESSassociates.com> wrote in message
news:gjkmt4tapc4qkaq35ht3mt05rgpmqbqins at (no spam) 4ax.com...
On 6 Apr 2009 17:03:39 -0400, "Jim Moseley"
jmose at (no spam) mapson.triptracker.com> wrote:
Hi Jim,
You comment makes sense to me, but I don't know just what I
should be searching for (to remove its hidden attribute.)
Thanks again,
--
Kenneth
If you email... Please remove the "SPAMLESS." |
|
|
| Back to top |
|
|
|
| Jim Giner... |
Posted: Tue Apr 07, 2009 10:26 pm |
|
|
|
Guest
|
YOu do a load command with winstylehidden in it. change that to
winstyledefault and it won't be hidden anymore. That way if your script
crashes, you can easily close the report and try again.
"Kenneth" <usenet at (no spam) soleSPAMLESSassociates.com> wrote in message
news:rqsmt4phjsptej24pcvmlk8sc5mdnrgbv6 at (no spam) 4ax.com...
Quote: On Tue, 7 Apr 2009 09:54:51 -0400, "Jim Giner"
jim.giner at (no spam) suny.edu> wrote:
During your trial and error(s), you probably have a "hidden" report on
your
desktop. Remove the hide parm of the load and debug your script - that
way
you'll know if you have something still open on that table.
"Kenneth" <usenet at (no spam) soleSPAMLESSassociates.com> wrote in message
news:gjkmt4tapc4qkaq35ht3mt05rgpmqbqins at (no spam) 4ax.com...
On 6 Apr 2009 17:03:39 -0400, "Jim Moseley"
jmose at (no spam) mapson.triptracker.com> wrote:
Hi Jim,
You comment makes sense to me, but I don't know just what I
should be searching for (to remove its hidden attribute.)
Thanks again,
--
Kenneth
If you email... Please remove the "SPAMLESS." |
|
|
| Back to top |
|
|
|
| Kenneth... |
Posted: Tue Apr 07, 2009 10:35 pm |
|
|
|
Guest
|
On Tue, 7 Apr 2009 15:59:14 +0200, "Anders"
<anders at (no spam) jREMOVEjonssondata.se> wrote:
Hi again,
With sincere apologies to all... (and feeling like a
dunce...)
The problem is unrelated to Paradox.
I had replaced the mobo on this system, and with that, there
was a printer installation problem.
Please accept my thanks,
--
Kenneth
If you email... Please remove the "SPAMLESS." |
|
|
| Back to top |
|
|
|
| Jim Giner... |
Posted: Tue Apr 07, 2009 11:07 pm |
|
|
|
Guest
|
I still stand by the suggestions I made for future reference. As do
probably the others who made suggestions. |
|
|
| Back to top |
|
|
|
| Kenneth... |
Posted: Tue Apr 07, 2009 11:10 pm |
|
|
|
Guest
|
On Tue, 7 Apr 2009 14:07:42 -0400, "Jim Giner"
<jim.giner at (no spam) suny.edu> wrote:
Quote: I still stand by the suggestions I made for future reference. As do
probably the others who made suggestions.
Hi Jim,
I did make the modifications you suggested, and sincerely
appreciate your assistance,
--
Kenneth
If you email... Please remove the "SPAMLESS." |
|
|
| Back to top |
|
|
|
|
|
All times are GMT
The time now is Sun Dec 06, 2009 9:19 pm
|
|