Hi,
I'm getting the error that I show in the picture attached, please take a look.
Also attached a small example (based on HMG examples).
If you put as a comment line 16 (BUTTON btnAcepta...), the example generates the error as attached image.
And if you put as a comment line 17 - printTest1 () and uncomment line 16, then the example works fine.
The question is why?, and if I'm doing something wrong.
And if someone asks me,
What I need is to use the property NOSHOW in the definition of the window, why?, Because in a console mode application with HMG, I need to generate reports and preview (preview in graphical mode) and print.
Then in the console mode application (in the print option - application menu) should be to deploy and/or print the report generated.
BTW, All this that I need to do, it will be possible?, someone has tried?.
I appreciate any help.
Thanks
Best Regards
Javier
Error when trying to preview a report
Moderator: Rathinagiri
Error when trying to preview a report
- Attachments
-
- img_print.png (20.35 KiB) Viewed 3071 times
-
- imprimir.zip
- (694 Bytes) Downloaded 222 times
- Roberto Lopez
- HMG Founder
- Posts: 4012
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Error when trying to preview a report
The problem is that you are starting a print preview before activating/ closing the main window definition.jparada wrote:Hi,
I'm getting the error that I show in the picture attached, please take a look.
Also attached a small example (based on HMG examples).
If you put as a comment line 16 (BUTTON btnAcepta...), the example generates the error as attached image.
And if you put as a comment line 17 - printTest1 () and uncomment line 16, then the example works fine.
The question is why?, and if I'm doing something wrong.
And if someone asks me,
What I need is to use the property NOSHOW in the definition of the window, why?, Because in a console mode application with HMG, I need to generate reports and preview (preview in graphical mode) and print.
Then in the console mode application (in the print option - application menu) should be to deploy and/or print the report generated.
BTW, All this that I need to do, it will be possible?, someone has tried?.
I appreciate any help.
Thanks
Best Regards
Javier
So, print preview attempt to define (and activate) its own window 'inside' a not closed define window... end window structure, giving you an error message.
This behavior is by design.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
Re: Error when trying to preview a report
Hi Roberto,
Thank you for answering and thanks for your explanation
Best Regards
Javier
Thank you for answering and thanks for your explanation
Best Regards
Javier
Re: Error when trying to preview a report
Hi Roberto,
I think I found the solution (very simple indeed)
Please take a look at small change in the code:
And in the application (HMG console), I do this:
and that's all.
Now the question is, can there be any problems doing something like what I'm doing, I mean, I do not know, incompatibility or something "bad."
Thanks
Best Regards
Javier
I think I found the solution (very simple indeed)
Please take a look at small change in the code:
Code: Select all
DEFINE WINDOW Win_1 ;
AT 0,0 ;
WIDTH 400 ;
HEIGHT 400 ;
TITLE 'MiniPrint Library Test' ;
WINDOWTYPE MAIN ;
ONINIT PrintTest1() ;
NOSHOW
Code: Select all
EXECUTE FILE "c:\testhmg\imprimir.exe"
Now the question is, can there be any problems doing something like what I'm doing, I mean, I do not know, incompatibility or something "bad."
Thanks
Best Regards
Javier
- Roberto Lopez
- HMG Founder
- Posts: 4012
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Error when trying to preview a report
I should look at the whole thing to give you a proper answer, but, based on small chunks of code that you've posted, it appears to be ok.jparada wrote:Hi Roberto,
I think I found the solution (very simple indeed)
Please take a look at small change in the code:And in the application (HMG console), I do this:Code: Select all
DEFINE WINDOW Win_1 ; AT 0,0 ; WIDTH 400 ; HEIGHT 400 ; TITLE 'MiniPrint Library Test' ; WINDOWTYPE MAIN ; ONINIT PrintTest1() ; NOSHOW
and that's all.Code: Select all
EXECUTE FILE "c:\testhmg\imprimir.exe"
Now the question is, can there be any problems doing something like what I'm doing, I mean, I do not know, incompatibility or something "bad."
Thanks
Best Regards
Javier
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
Re: Error when trying to preview a report
Hi Roberto,
Thanks for answering.
I await your comments please.
Thanks
Best Regards
Javier
Thanks for answering.
Here you have a small example, please take a look.Roberto Lopez wrote:I should look at the whole thing to give you a proper answer, but, based on small chunks of code that you've posted, it appears to be ok.
I await your comments please.
Thanks
Best Regards
Javier
- Attachments
-
- test.zip
- (1.09 KiB) Downloaded 265 times
- Roberto Lopez
- HMG Founder
- Posts: 4012
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Error when trying to preview a report
You've done a very strange construct indeed.jparada wrote:Hi Roberto,
Thanks for answering.
Here you have a small example, please take a look.Roberto Lopez wrote:I should look at the whole thing to give you a proper answer, but, based on small chunks of code that you've posted, it appears to be ok.
I await your comments please.
Thanks
Best Regards
Javier
You are stopping main window activation process with the print preview windows activation message loop and then releasing it.
OnInit event is not intended to be used in such way and I couldn't encourage anybody to do it so, but I guess that you'll be ok anyway

Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)