Focal Point
[CLOSED] Can I insert code to warn when...

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

February 21, 2019, 01:20 PM
RobertF
[CLOSED] Can I insert code to warn when...
We created a data mart (sql table) and accompanying master file. It is quite large (8M+ rows)

The user uses selection dropdowns to extract a portion of the data mart into an Excel spreadsheet output.

At times the user will simply select an unreasonable amount of rows for output..sometimes more than Excel can hold.

Is it possible, based on the number of rows returned by the fex, the throw out a message as to how many rows are returned or better yet if above some threshold we determine, to stop the report from being generated at all?

Something like:

Grab Selection
Execute report
if number of row returned > 200,000 Pop up a message.."Too much Data" otherwise open the report.

I figure after creating the report, I could create a second report consisten of a simple message and then imbed an IF/ELSE that determines which code to run...based on the number of rows returned...but how do I make a variable or something to capture: RowsReturned?

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


WebFOCUS 8206.08
Windows, All Outputs
February 21, 2019, 01:23 PM
S.J. Kadish
Have you tried a message based on &RECORDS when maxing out?


Sandy Kadish
Dev: 8.2.04- PostgreSQL
Test: 8.2.04 - PostgreSQL
Prod: 8.2.04 - PostgreSQL
February 21, 2019, 01:37 PM
MartinY
You must pay attention to the variable taken to test the result. I think you should use &LINES instead of &RECORDS

&RECORSD will give you the number of record processed by the internal matrix depending on WHERE clause

&LINES will give you the number of record in the output result

See below sample
TABLE FILE CAR
SUM SEATS
BY COUNTRY
WHERE COUNTRY EQ 'ENGLAND' OR 'FRANCE';
ON TABLE HOLD
END
-RUN
-TYPE record: &RECORDS, lines: &LINES



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
February 21, 2019, 01:49 PM
Doug
Yes to Martin's 'Notice' as to pay attention to &RECORDS and &LINES.
You'll have to 'pre-process' your TABLE FILE to a HOLD FILE to check that value and follow that with a -IF &LINES.EVAL GT 123456 THEN GOTO :TooManyRecords ELSE GOTO :Continue;.

The -:TooManyRecords label / section will need a display message followed by -GOTO :TheEnd.

Or, something along those lines. I did that using a Reporting Object except that I had a WHERE statement that limited the output to 50000 records and set a &Message that was added to a Red Line in the HEADING.

It all depends on how far you want to go with this. The options are limited only by your imagination Smiler
February 21, 2019, 03:02 PM
RobertF
ok, I'll give it a whirl...


WebFOCUS 8206.08
Windows, All Outputs