NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: terryd 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]
-
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
-
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.
-
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.
-
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