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.
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.
The following are the three access models that you can choose while embedding a report/dashboard.
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.
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.
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.
The following permissions can be granted while sharing the URL of a report/dashboard.
You can edit the previously granted permissions by following the below steps:
You can easily remove the permissions by following the below steps:
Open the corresponding report that has been embedded and invoke the Share > Edit Shared Details.
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.
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
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
When you embed the above code snippet into a web page, the table view displayed will contain only the values matching the Region South.
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>)"|
|Column name||Refers to the name of the column on which you are applying the criteria|
|SQL Expression|| |
Any valid SQL Expression.
Supported Arithmetic Operators are: +, -, *, /
|SQL Function call||In-built standard functions from Oracle, MS SQL Server, MySQL, DB2, Sybase, ANSI SQL, Informix and PostgreSQL databases |
Eg.: year(date_column) = 2016
|Relational operator||Any relational operator to compare values supported in an SQL SELECT Query WHERE clause. The following operators can be used: |
|Value||Refers 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:
Refer to the SQL SELECT WHERE clause documentation to know more on how to construct the filter criteria.