Embedding Views in Web Pages

Embedding Views in Web Pages, Web Applications and Blogs

Zoho Reports allows you to easily embed any view such as a table, report or dashboards in a website, web application, blog or an intranet page. You can embed views with a secured login (with login) or a private permalink (without login) or with public access. Users visiting the webpage will be able to see the latest live version of the view and any changes that you make to the view will automatically get reflected in the embeded version as well.

  1. What are the reports that I can embed in my website/blog?
  2. What are the access modes available when embedding a report/dashboard?
  3. What is the difference between embedding with secured login and private URL/permalink?
  4. How to embed a report/dashboard with Secured login?
  5. How to embed a report/dashboard with Private URL/permalink?
  6. How to embed a report/dashboard with Public access?
  7. What are the interaction options that are supported in an embedded report/dashboard?
  8. I regenerated the random key, I cannot access my previously embedded views. What should I do?
  9. What are the permissions that can be granted while embedding the report/dashboard?
  10. How do I edit the permission of the embedded view?
  11. How do I remove the access of the embed reports?
  12. Can I pass a dynamic filter while embedding the view?

1. What are the views that I can embed in my website/blog?

You can embed all the views such as tables, charts, pivots, tabular view, summary view, query tables and dashboards that you create using Zoho Reports. To embed a view created in Zoho Reports, you need to get the corresponding HTML code snippet generated for the view by Zoho Reports and paste them within the <body>...</body> HTML tags of the destination page. Refer to this question to learn about generating a HTML snipet.

2. What are the access modes available when embedding a report/dashboard?

The following are the three access models that you can choose while embedding a report/dashboard.

  1. Embedding with Secured Login (with login): This is the most secure mode of embedding a view. Only the users with whom you have shared the report will be able to view it upon logging into Zoho Reports.
  2. Embedding with Private permalink (without login)When this setting is selected Zoho Reports will generate a embed URL (within an iframe code) which will contain a big randomly generated private key (private link), making them secure and very hard (if not impossible) to guess. Users can view the embedded report without logging in to Zoho Reports. Please do note that this optionis available only in the premium and enterprise plans of Zoh Reports.
  3. Embedding with Public AccessIn case you want your embedded report to be accessible to all the users who visit your web page and do not require any random key based link generation or logging into Zoho Reports, you can use this access mode.

3. What is the difference between the three embedding modes?

Embedding with secured login allows the highest level of security to the embedded view. When you embed the view with "Private Access with Login", then it would prompt for the users to login to Zoho Reports to access the embedded view. Also, only users to whom you have shared the view would be able to access the embedded view, on successful login. 

When you embed a report with "Private Access without Login", Zoho Reports will generate a private permalink making it secure and very hard to guess. Users need not login to Zoho Reports to view the embedded report. Although this is secure, the randomly generated key is not impossible to guess.

In case you want your embedded report to be accessible to all the users who visit your web page and do not require any random key based link generation or logging into Zoho Reports, you can use the public access mode.

4. How to embed a report/dashboard with Secured login?

5. How to embed a report/dashboard with Private URL/Permalink?

6. How to embed a report/dashboard with Public access?

7. What are the interaction options available while embedding a report/dashboard?

Zoho Reports allows you to embed reports/dashboards in an interactive mode. When you embed a report in interactive mode in a web page, then users visiting the web page can view and interact with the chart as you could do when you view the report within the Zoho Reports user interface. The following interactions are possible when a chart is embedded in interactive mode:

1. Tooltips & highlights.  

2. View the underlying data  

3. Drill down 

4. Change chart type  

5. Apply User Filters, if the chart contains user filters

6. Interact with legend 

You can also embed the reports as a image. This feature is only available for charts. As a result of this, the chart will be generated as a static image and hence will load faster. 

8. I regenerated the random key, now I cannot access my previously embedded views or URL's of that report/dashboard. What should I do?

When you reset/regenerate the random key, the previously shared URL's/Embeds will become invalid. You will have to regenerate the new embed snippet and update the page.

9. What are the Permissions that can be granted while embedding the report/dashboard?

The following permissions can be granted while sharing the URL of a report/dashboard.

10. How do I edit the embed permissions?

You can edit the previously granted permissions by following the below steps:

Editing Permissions for Secured Login:

  1. Open the corresponding report that has been embedded and invoke the Share > Edit Shared Details.
  2. Click the Edit Permission link next to the Member/group name to edit the permissions.

\

Editing Permissions for Private Permalink:

  1. Open the corresponding report that has been embedded and invoke the Share > Edit Shared Details.
  2. Click the Edit Permission link next to private link to edit the permissions.

Editing Permissions for Public users:

  1. Open the corresponding report that has been embedded and invoke the Share > Edit Shared Details.
  2. Click the Edit Permission link next to public visitor to edit the permissions.

 

11. How do I remove the access of the embed view?

You can easily remove the permissions by following the below steps:

Removing the Permissions of Secured Login:

  1. Open the corresponding report that has been embedded and invoke the Share > Edit Shared Details.
  2. Click Remove to remove the permission.

\

Removing the Permissions of Private Permalink:

  1. Open the corresponding report that has been embedded and invoke the Share > Edit Shared Details.
  2. Click Remove to remove the permission.

Removing the Permissions of Public Access:

  1. Open the corresponding report that has been embedded and invoke the Share > Edit Shared Details.

  2. Click Remove to remove the permission.

12. Can I pass a dynamic filter while embedding the view?

Zoho Reports offers a powerful feature of applying dynamic filters when you embed any view into your Web page. Using this feature, you can embed the same view in web pages applying different set of filter criteria, to suit the allowed permission, context and profile of the user who is viewing the page.

For example, an embedded sales report can have a 'Region' based criteria in each page that it's embedded, creating a scenario such that, when a sales person from say Region South views his/her accessible page, will only see the Sales from that region in the report embedded. A similar setup can be applied for sales person from other regions.

Filters can be applied by passing the required filter criteria to the parameter named ZOHO_CRITERIA and appending it as part of the Embed URL present in the HTML <iframe> code snippet. The embedded view's data is filtered and displayed based on the criteria specified, whenever the web page is loaded in the browser.

Example:

The generated HTML code snippet for embedding your view with the <iframe> tag would look like something given below (the following code snippet is for a Table):

<iframe frameborder=0 width="400" height="300" src='http://reports.zoho.com/ZDBDataSheetView.cc
OBJID=19601000000386026&STANDALONE=true&WIDTH=400&HEIGHT=300&ZDB_THEME_NAME=blue
&DATATYPESYMBOL=false&REMTOOLBAR=true&SEARCHBOX=true'></iframe>

The above snippet displays a "Sales" table when embedded. To limit the view to just show the Sales in the South Region, add the parameter &ZOHO_CRITERIA=("Region"='South') to the <iframe> code snippet. In this parameter "Region" is the column name in the view, which is filtered to display values matching the region South. The parameter should also be encoded. You can use this tool or any other tool that is available on the internet to encode.

The complete code snippet with this parameter is given below:

<iframe frameborder=0 width="400" height="300" src='http://reports.zoho.com/ZDBDataSheetView.cc?OBJID=19601000000386026&ZOHO_CRITERIA=(%22Region%22%3D%27South%27)&STANDALONE=true
&ZDB_THEME_NAME=blue&DATATYPESYMBOL=false&REMTOOLBR=true&SEARCHBOX=true'></iframe>

When you embed the above code snippet into a web page, the table view displayed will contain only the values matching the Region South.

Filter Criteria Format

The filter criteria that is passed follows the same format as that of the SQL SELECT Query's WHERE clause. You can also use SQL in-built functions as part of the criteria. These built-in functions should be the functions supported by any of Oracle, MS SQL Server, MySQL, DB2, Sybase, ANSI SQL, Informix and PostgreSQL databases. 

The generalized format of simple criteria is given below.

ZOHO_CRITERIA="(<column name/SQL expression/SQL function calls> <relational operator> <value/column name/SQL expression/SQL function calls>)"

Description:

Column nameRefers to the name of the column on which you are applying the criteria
SQL Expression

Any valid SQL Expression.

Eg: "Sales"-"Cost">1000

Supported Arithmetic Operators are: +, -, *, /

SQL Function callIn-built standard functions from Oracle, MS SQL Server, MySQL, DB2, Sybase, ANSI SQL, Informix and PostgreSQL databases 
Eg.: year(date_column) = 2016
Relational operatorAny relational operator to compare values supported in an SQL SELECT Query WHERE clause. The following operators can be used:
  • =
  • !=
  • <
  • >
  • <=
  • >=
  • LIKE
  • NOT LIKE
  • IN
  • NOT IN
  • BETWEEN
ValueRefers to the exact value to match

Eg.: "Department" = 'Finance"

here 'Finance' is a literal value to match.

You can also define filters containing multiple columns as the example given below
((Region='South' AND "Sales" < 10000) OR ("Region='West' AND "Sales" < 10000))

Notes for Criteria formation:
  • You can combine any number of criteria defined in the above specified format using Logical Operators like AND and OR to form complex criteria, the same way as in SQL SELECT WHERE clause. Also use Braces '()' to group the criteria for ordering.
  • Enclose string literals (i.e. values) in single quotes.
  • Enclose column names in double quotes.
    • Eg.: ("Date Of Birth" = '2016-01-31 00:00:00')
  • Currency symbols (or) percent symbol can't be used in criteria
    • Eg.: currency_column = 75.66 is valid
    • Eg.: percent_column = 100 is valid
    • currency_column = 75.66$ (or) percent_column = 100% is not valid

Refer to the SQL SELECT WHERE clause documentation to know more on how to construct the filter criteria.