NetTalk Central

Author Topic: How to filter Export to Excel file  (Read 3245 times)

Poul Jensen

  • Full Member
  • ***
  • Posts: 186
    • View Profile
    • Email
How to filter Export to Excel file
« 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
« Last Edit: September 15, 2019, 12:40:45 AM by Poul Jensen »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11176
    • View Profile
Re: How to filter Export to Excel file
« Reply #1 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

Poul Jensen

  • Full Member
  • ***
  • Posts: 186
    • View Profile
    • Email
Re: How to filter Export to Excel file
« Reply #2 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