Focal Point
[CLOSED] Map layer refresh issue for ESRI map.

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7447023196

May 21, 2019, 05:50 PM
srajeevan
[CLOSED] Map layer refresh issue for ESRI map.
Hi,

I wrote the below code.
I am trying to get answer to the issue i have and i replicated the scenario with CAR file as shown below.
I am generating a report with READMIT and RECORDLIMIT of 50 in XML output format.
I want to check for no of lines and if &LINES GT 0 THEN generate an XML output report(with 5 as limit) ELSE generate an XML output report with 10 as limit.

Here is the code.

  
TABLE FILE CAR
SUM SALES 
BY CAR
BY COUNTRY
WHERE RECORDLIMIT EQ 50
WHERE READLIMIT EQ 50
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT XML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/warm.sty,
$
ENDSTYLE
END

-IF &LINES GT 0 THEN GOTO :LBL1
-:LBL2
TABLE FILE CAR
PRINT
*
ON TABLE PCHOLD FORMAT XML
WHERE RECORDLIMIT EQ 5
WHERE READLIMIT EQ 5
END

-:LBL1
TABLE FILE CAR
PRINT
*
ON TABLE PCHOLD FORMAT XML
WHERE RECORDLIMIT EQ 10
WHERE READLIMIT EQ 10
END


This is what i want in ideal case,but &LINES wont work with XML format i think(tested and not working for me).

The XML output goes to an ESRI map and for some reason map is not refreshing when it has to branch.
So map layer always gets stuck on the initial XML output.

If HOLD first,i can use &LINES ,but the map layer gets stuck with whatever the xml it generates first.


I have posted similar post,but to make it more clear i post this question again.

This message has been edited. Last edited by: FP Mod Chuck,


WF8206,Windows 7,8,10
HTM,PDF,EXCEL
May 23, 2019, 02:11 PM
FP Mod Chuck
Better open a case on this one...


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
May 23, 2019, 02:48 PM
MartinY
What you need to do is to test the result of your first TABLE FILE first, then branch to proper step.
But except if your input file (CAR) is empty, since you don't have any WHERE clause in the first TABLE FILE, you will always have &LINES GT 0
Is it possible that you had simplified too much your need in the sample code ?

The problem is that if you try to test &LINES of a PCHOLD FORMAT XML output, you will already have that XML returned. So, none of the labeled steps result will be returned.
See below sample
TABLE FILE CAR
SUM SALES
BY COUNTRY
BY CAR
BY MODEL
WHERE COUNTRY EQ 'ENGLAND';
ON TABLE PCHOLD FORMAT XML
END
-RUN

-IF &LINES GT 0 THEN GOTO :LBL1;
-:LBL2
TABLE FILE CAR
PRINT *
WHERE RECORDLIMIT EQ 5
WHERE READLIMIT EQ 5
ON TABLE PCHOLD FORMAT XML
END
-RUN
-GOTO XEND

-:LBL1
TABLE FILE CAR
PRINT *
WHERE RECORDLIMIT EQ 10
WHERE READLIMIT EQ 10
ON TABLE PCHOLD FORMAT XML
END
-RUN
-XEND


Your option to be able to branch to step is the below
TABLE FILE CAR
SUM SALES
BY COUNTRY
BY CAR
BY MODEL
-*WHERE COUNTRY EQ 'ENGLAND';
WHERE COUNTRY EQ 'W GERMANY';
ON TABLE HOLD
END
-RUN

-IF &LINES GT 4 THEN GOTO :LBL1;
-:LBL2
TABLE FILE CAR
PRINT *
WHERE RECORDLIMIT EQ 5
WHERE READLIMIT EQ 5
ON TABLE PCHOLD FORMAT XML
END
-RUN
-GOTO XEND

-:LBL1
TABLE FILE CAR
PRINT *
WHERE RECORDLIMIT EQ 10
WHERE READLIMIT EQ 10
ON TABLE PCHOLD FORMAT XML
END
-RUN
-XEND


Or
TABLE FILE CAR
SUM SALES 
BY CAR
BY COUNTRY
-*WHERE COUNTRY EQ 'ENGLAND';
WHERE COUNTRY EQ 'W GERMANY';
ON TABLE HOLD FORMAT XML
END
-RUN

-IF &LINES GT 4 THEN GOTO :LBL1;
-:LBL2
TABLE FILE CAR
PRINT *
WHERE RECORDLIMIT EQ 5
WHERE READLIMIT EQ 5
ON TABLE PCHOLD FORMAT XML
END
-RUN
-GOTO XEND

-:LBL1
TABLE FILE CAR
PRINT *
WHERE RECORDLIMIT EQ 10
WHERE READLIMIT EQ 10
ON TABLE PCHOLD FORMAT XML
END
-RUN
-XEND


Note that you are missing a semicolon at end of the IF statement and GOTO XEND after LBL2

But I don't understand why you need to test an XML file at first step or generates an XML file that you don't care


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007