IF Last field No is blank...

can you help me with this, im a a bit brain dead this morning :slight_smile: what would the code be for the following. IF LastFieldNo (is blank) THEN BlankID := ID + 1; ELSE CurrReport.SKIP; What i want the report to do is output a line to screen when then value is blank. If it isnt blank then Skip the current line. cheers

what’s the typo ok the field? maybe you can use: IF LastFieldNo =’'THEN BlankID := ID + 1; ELSE CurrReport.SKIP;

Well… .I’m not totally sure what you intentions are, but for what you say you pretend to have a line that is printed on the report only when a condition is met. Why don’t you create a new body section for that line and on the onPresection code for that section use something like. // if lastfieldno is an integer CurrReport.SHOWOUTPUT(LastfieldNo = 0); // if lastfieldno is a code CurrReport.SHOWOUTPUT(LastfieldNo = ‘’);

cheers, LastFieldNo = “Integer” what i want to do is a report that shows ‘Free’ Object IDs within a Customers Range. i.e if the range is 50,000 to 50,100 and 50,060…50,070 are free then these will be printed on the report. it almost works.

That’s more or less easy… just apply the logic of printing everything but what you find already on the database. If you use an integer section for the object numbers, just have an object record that you use to find if the object is already existing on the database, and if so, skip that number.It will be something like: myRecordObject.SETRANGE(“ID”,Number); IF (myRecordObject.FIND(’-’)) THEN CurrReport.SKIP;

thanks, (ALfonso) just tried your last suggestion, it runs but gives me 0 pages… Think its because there are no entries at all on the object tables for the “free” Object ID’s. so there is nothing to output. THink i will need to create an integer that takes the value of the last Object ID +1 then output this to screen.

quote:


Originally posted by Mark Williams (ALfonso) just tried your last suggestion, it runs but gives me 0 pages… Think its because there are no entries at all on the object tables for the “free” Object ID’s. so there is nothing to output. THink i will need to create an integer that takes the value of the last Object ID +1 then output this to screen.


If you read my post again you’ll see that I was refering to use an integer section for getting the numbers where to filter by. Remember that you should check for empty numbers between several objects… (like if you’ve reports 50000,50001,50003 and 50004… you’ll have a free spot on 50002). So the best way is, knowing your license allowed ranges, filtering on the numbers you’re wanting to check (let’s say 50000…50200) and the type of object (use a variable to get the filters for the type).