PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Nested Reports
Nested Reports
Débuté par Parianos Henri, 19 juin 2006 11:22 - 6 réponses
Posté le 19 juin 2006 - 11:22
Hi,
I have a program that print different report in the same run.
a)iPreview(LOC_preview,"Preview",True,Loc_col,Loc_line,Loc_width,Loc_high)
iPrintReport(LOC_reportname)
b) iPreview(LOC_preview,"Preview",True,Loc_col,Loc_line,Loc_width,Loc_high)
iPrintReport(LOC_reportname2)
a is executed wel.
before we got to point b I have to cancel the report (preview) at that moment
then the program goes thru the got focus process of the window (so far so good)
then by using a variable I make that the program goes to point b.
and when the first command is executed (ipreview) then the program hangs.
Do I have to do something within the report when I cancel the preview or ....
Any help will be welcome.
Thanks Parianos Henri.
Posté le 19 juin 2006 - 11:49
before we got to point b I have to cancel the report (preview) at that moment
then the program goes thru the got focus process of the window (so far so good)
then by using a variable I make that the program goes to point b.
and when the first command is executed (ipreview) then the program hangs.

I put all into one print job in the following way, meaning no worry about closing preview, etc.
Regards
Mat

// opening of the master report
PROCEDURE RepProcessing(vParams)
vFirst is boolean = True
vRepType is int = Open(winProcMenu)
IF vRepType = 0 THEN iCloseReport()

//in the body code of the master report
iNestedHeaderFooter(True)
SWITCH vRepType
CASE 1 : DoReport("RepProcResult")
CASE 2 : DoReport("RepProcResult")
DoReport("repProcUsedProd")
END

// local procedure of master report
// PROCEDURE DoReport(vRepName)
//iInitReportQuery(vrepname,winProcessing.pID,winprocessing.pid) moved to each report (problem WD9)
IF vFirst THEN
vFirst = False
ELSE
iPageEnd()
END
iPrintReport(vRepName,vParams)
Posté le 19 juin 2006 - 12:20
Hi Mat
This is a solution already thought but did you had the same problem? This happends only when you use the preview facility. in the orher case direct printing there is not a problem.
Regds
Henri Parianos
before we got to point b I have to cancel the report (preview) at that moment
then the program goes thru the got focus process of the window (so far so good)
then by using a variable I make that the program goes to point b.
and when the first command is executed (ipreview) then the program hangs. >
I put all into one print job in the following way, meaning no worry about closing preview, etc.

Regards
Mat

// opening of the master report
PROCEDURE RepProcessing(vParams)
vFirst is boolean = True
vRepType is int = Open(winProcMenu)
IF vRepType = 0 THEN iCloseReport()

//in the body code of the master report
iNestedHeaderFooter(True)
SWITCH vRepType
CASE 1 : DoReport("RepProcResult")
CASE 2 : DoReport("RepProcResult")
DoReport("repProcUsedProd")
END

// local procedure of master report
// PROCEDURE DoReport(vRepName)
//iInitReportQuery(vrepname,winProcessing.pID,winprocessing.pid) moved to each report (problem WD9)
IF vFirst THEN
vFirst = False
ELSE
iPageEnd()
END
iPrintReport(vRepName,vParams)
Posté le 19 juin 2006 - 12:46
Hi Mat
This is a solution already thought but did you had the same problem? This happends only when you use the preview facility. in the orher case direct printing there is not a problem.


Salut Henri,
there is no problem, the master report is launched
iPreview()
iPrintReport(myMasterReportName)
the two nested reports are then opened in ONE preview.
Regards
Mat
Posté le 19 juin 2006 - 18:58
Hi Mat
This is a solution already thought but did you had the same problem? This happends only when you use the preview facility. in the orher case direct printing there is not a problem.


Henri,
another thought that came to my mind is that we had problems with report previews when using queries as the data source, which is the standard in our case. Since WD9, a preview makes you lose the data source. That means, for example, that Windev will crash if you press a button in preview other than print, e.g. export to Word, Excel, PDF..., because it internally launches the report again. The same would of course be true if you launched the same preview twice.
The answer to that problem is generating the data source in each nested report, as mentioned in my first reply, i.e.
iInitReportQuery(vrepname,winProcessing.pID,winprocessing.pid) moved to each report (problem WD9)

Regards
Mat
Posté le 20 juin 2006 - 08:00
Hi Mat
First thanks for the answers but once again.
You start the first report. (Preview)
Then you cancel the report. (type X) on the screen.
Then you start the preview once again with other data.
and at that moment nothing happends (windev hangs).
Actualy the same happend when you close you print window and restart once again and then you don't have any problem.
That sounds to me that something is released when you close your print window.
Another thing is that the speed before actualy you get something on the printer is less than windev 5.5.
Is that possible?
Regds
Henri Parianos

Hi Mat
This is a solution already thought but did you had the same problem? This happends only when you use the preview facility. in the orher case direct printing there is not a problem.

Henri,
another thought that came to my mind is that we had problems with report previews when using queries as the data source, which is the standard in our case. Since WD9, a preview makes you lose the data source. That means, for example, that Windev will crash if you press a button in preview other than print, e.g. export to Word, Excel, PDF..., because it internally launches the report again. The same would of course be true if you launched the same preview twice.
The answer to that problem is generating the data source in each nested report, as mentioned in my first reply, i.e.
iInitReportQuery(vrepname,winProcessing.pID,winprocessing.pid) moved to each report (problem WD9)

Regards
Mat
Posté le 20 juin 2006 - 15:55
Hi Mat
First thanks for the answers but once again.
You start the first report. (Preview)
Then you cancel the report. (type X) on the screen.
Then you start the preview once again with other data.
and at that moment nothing happends (windev hangs).
Actualy the same happend when you close you print window and restart once again and then you don't have any problem.
That sounds to me that something is released when you close your print window.
Another thing is that the speed before actualy you get something on the printer is less than windev 5.5.

I don't remember having noticed differences to printing speed compared to WD5.5
I think we turn in circles. The problem you experiene is not a general one, maybe by specifying the following, we can find a solution:
1) type of data source: file, query, table control, memory zone, etc
2) You have three reports: master, nested1, nested2. Where and how do you compile the data source of nested1 and nested2.
Regards
Mat
P.S. keep smiling...