NetTalk Central

Author Topic: Export to Excel Problems  (Read 2760 times)

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Export to Excel Problems
« on: August 15, 2015, 12:43:39 AM »
I ran into this problem in one of my apps so I modified Web2 to check whether it was in my app or generic.
I added xfiles to the application and created a local variable in the MailboxesBrowseControl  called Local:Test
In the StartofValidateRecord embeditor point I added code to set local:test to a value if the mai:SizeLimit was 0
Added an export button and the local:test field to the browse
Running the app and the browse displays the correct message in the local:test field.
However the values don't display in the export file.

While doing this I noticed that the heading displays incorrectly (I didn't change this this was how it was in the basic example)



[attachment deleted by admin]
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11204
    • View Profile
Re: Export to Excel Problems
« Reply #1 on: August 16, 2015, 10:25:53 PM »
The loop for the browse is different to the loop for the export.
So the code in the ValidateExport for the browse loop is not the same embed as ValidateExport for the export loop.

I'll consider the implications of placing that embed in both places, so the same code is used, but for now you should just duplicate the code in the ExportToExcel routine.

cheers
Bruce

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Export to Excel Problems
« Reply #2 on: August 17, 2015, 12:15:17 AM »
Thanks Bruce. I will do that.
I have a number of browses where I either use a local variable or a template expression on the browse and this would be a pain to have to go in each time to code for them, especially if at a later stage you do modify the Export loop and I then have to find and remove them.
To a large extent I am using the Browse/Export paradigm  to generate Excel reports rather that generating them though a Form/MakeFile method so this is important to me.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Export to Excel Problems
« Reply #3 on: August 19, 2015, 01:59:33 AM »
Hi bruce
Got this to work by duplicating the code I had in the  ValidateRecord inside the browse loop.
I place it in a procedureRoutine and called it from both locations so at least if I add additional calculated variables this will cover both the browse and the export

Is it necessary to open/close files for each exported record or can I open them once at the beginning of the export loop and close them at the end?
I have removed the open/close files on the code I created and there doesn't seem to be an issue. I just want to be sure that it won't bite me at a later stage.
« Last Edit: August 19, 2015, 02:09:54 AM by terryd »
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11204
    • View Profile
Re: Export to Excel Problems
« Reply #4 on: August 20, 2015, 06:39:22 AM »
Hi Terry,

The Export loop is a very tight loop - no events or threads there, so you don't ned to open or close files inside the loop.

cheers
Bruce