Makewebformtemplate problem

I’m trying out the makewebformtemplate statement. I use the exact code from the documentation. I get this error message: “Cannot generate HTML, database “Untitled” is not open.”
If I substitute the actual name of my DB for the “” in parameter 1, quoted or not quoted, I get the same error.
What am I missing?
(NB: this is not a curly quotes problem in spite of how it looks here.)

I believe the statement is named makeformwebtemplate, but you must have gotten that right in your code, or you would have gotten an error saying the statement didn’t exist.

The documentation for that statement doesn’t have any example code, so I’m guessing it’s the code in savewebtemplate that you actually copied. That code simply shows the formTemplate variable being declared with no value, and that would give you the error you describe. Here are the first few lines of the MAKEWEBFORMTEMPLATE procedure.

starttimecheck ""
let cvDictionary = catcherror("",parameter(1))
if cvDictionary = ""
    cvDictionary = initializedictionary(
        "DATABASE","Untitled",
        "FORM","Form_A"
    )
endif

//[--Initialize Variables--]
let targetDatabase = getdictionaryvalue(cvDictionary,"DATABASE")
if targetDatabase="" targetDatabase=dbname() endif
if (not arraycontains(info("files"),targetDatabase,cr()))
    rtnerror "ERROR: Cannot generate HTML, database “"+targetDatabase+"” is not open."
endif

If the parameter has no value, the procedure gives the database a default name of “Untitled” and the form is “Form_A”. If there is no open database named Untitled, you get the error you described.

So you need to use initializedictionary to give the formTemplate an initial value that contains the name of the database and the form.

Thank you, Dave,

I see where my mysterious error statement came from. You’re quite right, it was the code in the doc for savewebformtemplate that I copied. You’re also right that I had not initialized a dictionary for this purpose. But I think it’s fair to say that the documentation of that statement is misleading. Here it is:

"This statement saves the web template (a dictionary) associated with a form. This example creates a web template [i.e. a dictionary] from the currently open form, and then saves that template into the form. (italics mine)

local formTemplate
makeformwebtemplate formTemplate
savewebtemplate "","",formTemplate

From this I inferred that this statement was creating a web template dictionary and filling in the name of the form and the database appropriately. Apparently my inference was mistaken; but without your extensive knowledge of how Panorama works under the hood, I don’t know how I would have known that, and I’m not much further ahead. The documentation does not say, “First initialize a dictionary with such-and-such characteristics.”

So I’m still stymied, because the documentation doesn’t give me step-by-step instructions for creating a web front end for my DB. This is a perfect illustration of the larger problem I’ve raised in the thread I started on 10/27 that turned into a conversation with Jim Cook. I’m not a Pan newbie; I’ve been using it almost since the beginning and at one point I built a complex multi-user relational DB that worked a treat on both Mac and Windows platforms. But in order to make use of the web-publishing feature, I need to be able to figure it out. There are a few of my senior colleagues on this forum for whom it’s a matter of course; but if Panorama’s promise is going to be fulfilled, there can’t be a major feature of the program that’s as inaccessible to experienced users as this is to me.

I think I remember that Jim said during the last tutorial workshop that he wasn’t going to write the web publishing doc because he didn’t want to get involved in teaching people to write HTML. Something like that… But that’s not what’s needed. It’s about understanding how Pan works. I’m willing to gratefully take the mechanics of the HTML rendering for granted as I do so much of the rest of how Pan does its magic in the black box.

I repeat from my other thread that if Jim isn’t going to write this doc and my larger question exceeds the bounds of what should be addressed in this thread, I’m willing to pay someone for some tutoring. I don’t think it would take much. At present I’m groping around in the dark, and lighting a match in one corner of the cavern/maze as David and James have generously done isn’t going to get me where I need to go.

With sincere respect for my more knowledgable colleagues,
Bill Conable

By the way, neither my 11/3 question nor David’s response appeared in my copy of the forum emails, nor did I get a notification of David’s response in my email, though Watching is checked for the question. Is it just that the software hasn’t got round to it yet, or is there some problem with the forum?

FWIW, I am getting these posts via my preferred email delivery notification.

I’d chime in on this if I had more experience with the built in form generation of Panorama. With Pan 6 I did a bit of it and it was truly impressive in its capabilities (No surprise in that) But my preference has always been to build HTML pages outside of Panorama, then use its also impressive ability to merge data with those pages.

Once the basic info on web publishing is available it has been my intention to share my processes for those willing to delve into HTML, and maybe into CSS, javascript and PHP along with it.

Thanks, James, I’ll look forward eagerly to anything you choose to share. Basic point for JR, of course, is unchanged. If you build it they will come, but not if they can’t find it….I do understand about priorities and am awed day in and day out at Jim’s abilities and work ethic.