Well known by most but this serves as a quick reminder to myself and anyone else on how to embed a form or a report into a Zoho Creator page.
Why?
Cos
How?
The below is a template snippet for a Zoho Creator page. We set the parameters of the form/report. Then this shows how to embed using a DIV layer which allows for CSS styling. The last part shows how to embed using an IFRAME tag which isn't great for CSS styling as you can't do cross-dom acoss child iframes; but it does let you use OpenURL(v_Url, "iframe", "iframe_name") which is good if you have multiple iframes on a page and you only want part of the page to display different content dynamically or on click of a button:
copyraw
<%{ l_FormParams = List(); l_FormParams.add("zc_Header=false"); l_FormParams.add("zc_Footer=false"); v_FormParams = l_FormParams.toString("&"); // l_ReportParams = List(); l_ReportParams.add("zc_Header=false"); l_ReportParams.add("zc_Footer=false"); v_ReportParams = l_ReportParams.toString("&"); %> // embeds using DIV: allows for CSS styling // embed a form <div class='my-form' elName='zc-component' formLinkName='Schedule_Week' params='<%=v_FormParams%>'>loading ...</div> // embed a report <div class='my-report' elName='zc-component' viewLinkName='Schedules' params='<%=v_ReportParams%>'>loading ...</div> // // embed using IFRAME: allows for content refreshing with openUrl to target iframes on a page // embed a form <iframe name='my-form' height='500px' width='100%' frameborder='0' allowTransparency='true' scrolling='auto' src='https://<base_url>/<account_owner_name>/<app_link_name>/form-embed/<form_link_name>'></iframe> // // embed a report <iframe name='my-report' height='500px' width='100%' frameborder='0' allowTransparency='true' scrolling='auto' src='https://<base_url>/<account_owner_name>/<app_link_name>/report-embed/<report_link_name>'></iframe> <%}%>
- <%{
- l_FormParams = List();
- l_FormParams.add("zc_Header=false");
- l_FormParams.add("zc_Footer=false");
- v_FormParams = l_FormParams.toString("&");
- //
- l_ReportParams = List();
- l_ReportParams.add("zc_Header=false");
- l_ReportParams.add("zc_Footer=false");
- v_ReportParams = l_ReportParams.toString("&");
- %>
- // embeds using DIV: allows for CSS styling
- // embed a form
- <div class='my-form' elName='zc-component' formLinkName='Schedule_Week' params='<%=v_FormParams%>'>loading ...</div>
- // embed a report
- <div class='my-report' elName='zc-component' viewLinkName='Schedules' params='<%=v_ReportParams%>'>loading ...</div>
- //
- // embed using IFRAME: allows for content refreshing with openUrl to target iframes on a page
- // embed a form
- <iframe name='my-form' height='500px' width='100%' frameborder='0' allowTransparency='true' scrolling='auto' src='https://<base_url>/<account_owner_name>/<app_link_name>/form-embed/<form_link_name>'></iframe>
- //
- // embed a report
- <iframe name='my-report' height='500px' width='100%' frameborder='0' allowTransparency='true' scrolling='auto' src='https://<base_url>/<account_owner_name>/<app_link_name>/report-embed/<report_link_name>'></iframe>
- <%}%>
Source(s)
- Zoho Creator: Navigational URLs
- Zoho Creator: Functionality based URLs
- Zoho Creator: Style based URLs for Embedded forms
Category: Zoho :: Article: 813
Add comment