Report Pages Lost or Duplicated in 11.1

I was able to reproduce duplicate WMFs in 11.1.13815 using a modified version of my Report Close Slow Test I’ll attach at the end.

After the Report is generated I call this function to check the Preview Queue for duplicate file names and WMFs missing i.e. ~Exists(). You could add this to your program to test real reports and know how often it is happening.

CheckForPagesLOSTorDUP      PROCEDURE(QUEUE PreviewQ)!,BOOL,PROC
PrevQ:FileName     PSTRING(256) 
DupCheckQ QUEUE,PRE(DupChkQ)
PageNo      LONG            !DupChkQ:PageNo
FileName    STRING(260)     !DupChkQ:FileName
    END
PgX     LONG
BadMsg  ANY
BadCnt  LONG
    CODE
    LOOP PgX=1 TO RECORDS(PreviewQ)
         GET(PreviewQ,PgX)
         PrevQ:FileName = CLIP(PreviewQ)
         IF ~EXISTS(PrevQ:FileName)       !Test OR PgX=33   !Problem: File not on disk?
            BadMsg=BadMsg &'<13,10>Page '& PgX &' file not found: '& PrevQ:FileName
            BadCnt += 1
         END

         DupChkQ:FileName=UPPER(PrevQ:FileName)
         GET(DupCheckQ,DupChkQ:FileName)                !Check if WMF Name for already in DupQ i.e. Duplicate
         IF ~ERRORCODE()                  !Test OR PgX % 22 = 0
            BadMsg=BadMsg &'<13,10>Pages '& PgX &' and '& DupChkQ:PageNo &' same: '& PrevQ:FileName
            BadCnt += 1
         ELSE
            DupChkQ:PageNo = PgX
            ADD(DupCheckQ,DupChkQ:FileName)
         END
    END
    IF ~BadCnt THEN RETURN False.
    
    BadMsg=BadCnt &' problems found in '& RECORDS(PreviewQ) &' page report:<13,10>'& BadMsg
    CASE Message(BadMsg,'Report Pages Lost or Duplicated - Process ' & Glo:ProcessID,ICON:NoPrint,'Close|Copy Text',,MSGMODE:CANCOPY)
    OF 2 ; SETCLIPBOARD(BadMsg)
    END
    RETURN True

One test showed 4 pages duplicated and displayed this:

The Previewer in this test lets you see the Queue and screen shot below shows those files appear twice. Note the Report pages have the “Process ID” so it would be possible to tell if the WMF file was from a different process. I did not check for that… yet.

To create more contention you can run multiple at the same time with the /GO common switch. I include a Run3.BAT that does START ReportPagesLostTest.exe /GO 3 times.

The other thing you can do is press the HALT button in preview to leave orphaned WMF files in the Temp folder. The main window has a Purge Temp button to clean that up.

Here’s my test project. Note the Build Clarion library version 11.1.13815 (from PROP:LibVersion) shows on Windows and Reports so you can try in 11.0 or 10.0 and be sure what version was tested.

ReportLostPagesTest.zip (10.5 KB)

ReportLostPagesTest-V2.zip (10.6 KB)

2 Likes