NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Poul Jensen on September 14, 2019, 09:40:38 PM

Title: How to filter Export to Excel file
Post by: Poul Jensen on September 14, 2019, 09:40:38 PM
Hi,

In my browse I often use below CASE to validate records in embed:
3 Inside Browse Loop  -->  1 Validate Record.

  CASE p_web.GSV('VareFiltrer')
  OF 0
      IF ~INSTRING(l:RestsalgTegn, APPvar:Varetekst, 1)
          CYCLE
      END           
  OF 1
      IF ~INSTRING('GAVE', UPPER(APPvar:Varenummer), 1)
          CYCLE
      END
  END

But same code (with EXIT instead of CYCLE) does not work in embed:
06 Start of "ExportToExcel routine ValidateRecord"

How to do this ?

Cheers
/Poul
Title: Re: How to filter Export to Excel file
Post by: Bruce on September 16, 2019, 09:38:56 PM
Hi Poul,

I recommend you look at your embed code "in context".
In there words see it inside the export loop itself so you can see what is happening.
Then debug in the normal way.

You should be in the embed point
! Start of "ExportToExcel routine ValidateRecord"

PS - Not why you'd use Exit there instead of Cycle?

cheers
Bruce
Title: Re: How to filter Export to Excel file
Post by: Poul Jensen on September 17, 2019, 02:45:46 AM
Hi Bruce,

The reason I could not get the validation to work with Excel export turned out to be due to the p_web.GSV('VareFiltrer') session value somehow being reset between validating the browse and exporting to Excel.
I saved the value to anoter sessionvalue and used that in the Excel validate routine.

And my bad about the EXIT vs. CYCLE.

Cheers
/Poul