Export to HTML Issue

I am trying to export to an html format and the program goes into a loop after selecting the html option; the spinning beach ball just spins. Eventually the entire computer locks up and I have to reboot the system. I have the same problem when I try the function on a second computer, it also completely locks up, cannot perform force quit or anything, turning computer off for reboot is the only option. Text exports seem to work OK. Computer 1 is running Catalina, computer 2 is running High Sierra.

I assume you are talking about the Custom Text Export window?

What you are describing is not normal. What happens if you create a small new database? Please try that and see if that works.

If it does work, we’ll need to investigate what could be happening with your database. But one step at a time.

XYML Issue: Yes, custom text export. The database in question is only 285 records. I did it again and waited 4min 38seconds and it completed, I apparently exited too soon (nothing you wrote ever took that long :)) One of the fields was a note field and when I eliminated that field the conversion time was reasonable. So I guess this is on me and will be more patient next time. Thanks for your quick response.

I use the Custom Export Text on almost a daily basis with no hiccups or delays. In fact, I used the record button to automat the process. The only issue (not a real issue) is that when I create a new html file, clicking on that option, the saved file automatically makes it a txt file, so I have to change that manually. I reported this in another thread, but have not gotten any feedback on that. Generating the html file, once I have given it a name is instant. So, as Jim suggests, there must be something else going on. I would suggest that perhaps you do only a few records and set up a default html file and see how it works.

If I am understanding this correctly you are talking about the Save dialog that comes up when you click the little green icon at the top of the wizard. Here is a way to customize the wizard to use the applicable file extension if you feel comfortable messing with Jim’s code. With the Custom Text Export wizard open, choose “Open View…” from the View menu. Click the “Current Database” segment button at the top and then double click the exportButton procedure in the list to open it. Now scroll down to about line 43 that has this code:

savedialog fileChoice,
	"InitialPath",dbinfo("folder",targetDatabase),
	"FileName",targetDatabase+".txt",
	"Title","Export Text File",
	"Button","Export"

Replace this with:

if exportPanel contains "HTML"
    savedialog fileChoice,
    	"InitialPath",dbinfo("folder",targetDatabase),
    	"FileName",targetDatabase+".html",
    	"Title","Export Text File",
    	"Button","Export"
else
    savedialog fileChoice,
    	"InitialPath",dbinfo("folder",targetDatabase),
    	"FileName",targetDatabase+".txt",
    	"Title","Export Text File",
    	"Button","Export"
endif

Save the Text Export file and now you will have the file set to html for HTML operations and txt for all others. This will have to be redone with any update unless Jim makes the change in his master code.

Great idea Gary. However, I don’t think you want to check the contents of exportPanel, but rather of exportFormat. I also did the logic a bit differently to avoid the code duplication.

let exportExtension = ?(exportFormat contains "html",".html",".txt")
savedialog fileChoice,
    "InitialPath",dbinfo("folder",targetDatabase),
    "FileName",targetDatabase+exportExtension,
    "Title","Export Text File",
    "Button","Export"

I’ve made this change in the production version so it will be included in the next release.

Thank you Gary and Jim. Very nice fix. I appreciate it. I hope the initial poster can resolve his issues as well, as creating html pages has become easier on Pan X. I used Jim’s code and, of course, that works as offered. Again, thank you.

Thanks all. Applied the code for the .html extension. Works great. My problem appears to be the note field in my custom export, creating the export preview screen takes anywhere from 1 to 4 minutes to create on a 285 record file. When I remove the notes from the export (it is the last field if that helps), the preview screen takes seconds. Don’t really need the notes so eliminating that field so everything OK. Love these forums, …learning a lot.