Automating html wizard


#1

Just playing around with Pan 6’s Text Export Wizard, creating an html table. I did all the prep work in designing the table, but was wondering if there is a way to call up the table through a procedure, rather than having to manually click on Wizard, then Import-Export, then Excel Wizard and finally Text Export Wizard. Just wondering…


#2

The Text Export Wizard uses the htmldatatable statement to perform the HTML export, and you can write your own procedure using this statement to export HTML without having to go thru the wizard. I don’t have the page number for this statement in the Panorama 6 documentation handy, but this version is nearly (exactly?) identical in Panorama X, so here is the link to that documentation.


#3

Thank you Jim…


#4

Note that the Options explanation for htmldatatable statement has several typographical errors…


#5

Craig, you can easily submit your corrections via the Corrections menu. The method is described in the Help File under the Panorama Help Wizard topic:

The simple method used is described in the text under the Advanced: Submitting Corrections heading. It is all relatively simple and saves Jim some time doing the corrections himself even though he will review them before actually making the correction.


#6

Seems I am unable to even get the posted example to work properly, as I get this in the first column…
No records matched your selection criteria.
Press your browser’s Back button to try another selection.

I can set up the html code when using the wizard, no problem.

I used the sample code:

local cgiHTML
htmldatatable cgiHTML
filesave "table.html",cgiHTML
openurl "file://"+dbinfo("folder","")+"table.html"

#7

Confirming Pete’s observation. Posted example gives no records, although I had all 1700+ records selected.


#8

Prior to the htmldata statement add the lines

fileglobal cgiSelectedRecordCount
cgiSelectedRecordCount=info("selected")

The custom statement sets that variable to 0 if it doesn’t already have a value.


#9

Sorry to bother you, but my learning curve stinks. I posted this and I can’t even get a green OK.
Is the code you suggested only for Pan X or also for Pan 6?
I am doing this to try and learn some things I haven’t done before.

local cgiHTML
fileglobal cgiSelectedRecordCount
cgiSelectedRecordCount=info(“selected”)
htmldatatable cgiHTML
filesave “table.html”,cgiHTML
openurl “file://”+dbinfo(“folder”,"")+“table.html”


#10

I did dave’s fileglobal add and initialization and it worked for me. If you have thousands of records and many fields, it can take a while to generate.

Try selecting a small subset to see if it works.


#11

Was it in Pan 6? and with the code I posted? I only have 14 records I want to select, but I can’t even get passed having the procedure being accepted at workable. So I must be doing something incorrectly


#12

It worked for me in Pan X.


#13

I’m trying to still use it in Pan 6…


#14

Oops. Missed your usage need.


#15

That is ok. I will also try it on Pan X. And it does work there. So I might try and figure out why it doesn’t work on Pan 6, but at least I am up on the horse. Now to learn to modify it so it looks the way I would like it to be. Thanks for your input, along with the always dependable Dave.


#16

I’ve posted corrections for them.


#17

I think the problem is the openurl statement, which did not exist in Panorama 6. Instead, use the shellopendocument statement.


#18

Seems to be this line
htmldatatable cgiHTML

When I get to it, I get a missing parameter message


#19

I probably shouldn’t have pointed you to the Panorama X documentation, there are some differences, and one difference is that the options parameter is optional in Panorama X, but not in 6. So the sample code for X doesn’t work. At a minimum, the 4th line needs to be:

htmldatatable cgiHTML,""

But once you fix that, you’re going to find that openurl is also a problem.

If you really want to do this in Panorama 6, you should probably find the Panorama 6 documentation for the htmldatatable and shellopendocument statements. Obviously my strong recommendation would be to transition to Panorama X as soon as possible.


#20

I agree with your suggestion, but I am like an old dog who has trouble learning new tricks.

Or more like an old racing horse been out in the pasture too long.

As I noted, it works fine in Pan X, but have spent most of my Pan career in the earlier versions.

Lots of these new codes spin my head. I also have not spent a lot of time in Pan X yet, due to what I have described above, but I hope to transition sooner than later. I have the patience, but spending time down in Florida with the fish calling and the sun shining takes time away from sitting down and learning new code.

I do appreciate your help for sure and your continued move forward with Pan X.

Thanks.