Discussions

 View Only
Expand all | Collapse all

Table Report in HTML

  • 1.  Table Report in HTML

    Posted 11-05-2019 10:42
    Looking to add a table report to an HTML page. I cannot seem to find any examples and have played with the options that are available with no success. If anyone is willing, looking to add a table report to an HTML page.

    ------------------------------
    Chad
    ------------------------------


  • 2.  RE: Table Report in HTML

    Posted 11-05-2019 10:49
    Check out the Quick Base University and API guide.

    https://help.quickbase.com/api-guide/gen_results_table.html

    ------------------------------
    Everett Patterson
    ------------------------------



  • 3.  RE: Table Report in HTML

    Posted 11-05-2019 10:54
    Hi Chad,

    Have you tried making use of the API for API_GenResultsTable that would be the call that is used to embed a table into an HTML page. The documentation I linked would go over what other parts are needed to make the call. I hope that suggestions is helpful.

    ------------------------------
    Evan Martinez
    Community Marketing Manager
    Quick Base
    ------------------------------



  • 4.  RE: Table Report in HTML

    Posted 11-05-2019 11:46
    Evan, Thanks for your help sir! I have, I just cannot seem to get it to actually generate and display the report. I think I am missing a step, and since I have not actually seen a working example, trying to trouble shoot to find the issue.

    ------------------------------
    ProjectsForce
    ------------------------------



  • 5.  RE: Table Report in HTML

    Posted 11-05-2019 14:15
    Hi Chad,

    Do you have an example of the API set up you are using right now? You would just want to replace any UserIDs, Auth Tickets or App IDs with XXXX and same for something like your app URL. Then we can see if something might be missing from the syntax of the URL. Should be something like the below example. 

    <html>
    <head>
    <script lang="javascript" src="https://quickbase.com/db/5rh82jcq?a=API_GenResultsTable
          &ticket=auth_ticket&apptoken=app_token
          &qid=5&jht=1">
    </script>
    <style>
       td.m { font-family:verdana; font-size:70%; }
       td.hd { font-family:verdana; font-size:70%; font-weight:bold;
        color:white;}
    </style>
    </head>
    <body>
    <h1>Example</h1>
       <table cellpadding=5 bgcolor=lightgreen>
          <tr>
             <td valign=top nowrap><b>A Quick Base table<br>embedded in
                a<br>page of HTML
             </td>
             <td>
                <script lang="javascript">
                   qdbWrite();
                </script>
             </td>
          </tr>
       </table>
    </body>
    </head>
    </html>


    ------------------------------
    Evan Martinez
    Community Marketing Manager
    Quick Base
    ------------------------------



  • 6.  RE: Table Report in HTML

    Posted 11-05-2019 14:19
    Evan, this is exactly what I was trying to use, but it just returns a green box with the text in it stating a Quickbase table in a page. I do not know how to add the Clist to it or to identify the fields I want to make up the report.

    ------------------------------
    ProjectsForce
    ------------------------------



  • 7.  RE: Table Report in HTML

    Posted 11-05-2019 14:31
    Hi Chad,

    What could help is to actually build a report that is set up the way you want it to display on your HTML in the table in Quick Base, then you would make sure specifically this part:

    &qid=5


    is set to the correct report qid. You can see the QID of a report when you look at the URL in Quick Base when you have the Report open. So seeing a report URL it would look like https://myaccount.quickbase.com/db/XXXXXXXX?a=q&qid=1. Do you have your qid set to an existing report that has the data you want to pull?



    ------------------------------
    Evan Martinez
    Community Marketing Manager
    Quick Base
    ------------------------------



  • 8.  RE: Table Report in HTML

    Posted 11-05-2019 14:38
    This is how I have it right now.

    <html>
    <head>
    <script lang="javascript" src="https://xxxxx.quickbase.com/db/xxxxx?a=API_GenResultsTable
    &apptoken= xxxxx
    &qid=5&jht=1">
    </script>

    ------------------------------
    ProjectsForce
    ------------------------------



  • 9.  RE: Table Report in HTML

    Posted 11-05-2019 14:43
    Hi Chad,

    yeah the QID=5 is where you are dictating what report in Quick Base you want to use. In my example I would change the 5 to a 1 to use the report that URL goes to. So you would want to build the report in Quick Base that you like, then you would look at the URL of that report when viewing it and find the QID, then once you have that reports specific QID you plug it into the API call instead of the 5, so if it was report 23 you would be 23 in instead of 5.

    ------------------------------
    Evan Martinez
    Community Marketing Manager
    Quick Base
    ------------------------------



  • 10.  RE: Table Report in HTML

    Posted 11-05-2019 14:48
    I really appreciate your help. This is what I have and what I get. 

    <html>
    <head>
    <script lang="javascript" src="https://xxxxx.quickbase.com/db/xxxxx?a=API_GenResultsTable
    &apptoken= xxxxx
    &qid=41&jht=1">
    </script>
    <style>
    td.m { font-family:verdana; font-size:70%; }
    td.hd { font-family:verdana; font-size:70%; font-weight:bold;
    color:white;}
    </style>
    </head>
    <body>
    <h1>Example</h1>
    <table cellpadding=5 bgcolor=lightgreen>
    <tr>
    <td valign=top nowrap><b>A Quick Base table<br>embedded in
    a<br>page of HTML
    </td>
    <td>
    <script lang="javascript">
    qdbWrite();
    </script>
    </td>
    </tr>
    </table>
    </body>
    </head>
    </html>

    When I add this, this is what I get:


    ------------------------------
    ProjectsForce
    ------------------------------



  • 11.  RE: Table Report in HTML

    Posted 11-06-2019 08:55
    Hi Chad,

    So the other part is styling for that example table, I realize I should have taken that out of my example since I was more focused on the formatting for the request. You can instead format your request like this:

    <script src="https://xxxxx.quickbase.com/db/xxxxx?act=API_GenResultsTable&apptoken=dr96jzmbvukuwsckbtrzxc9uqt2x&qid=52&jht=1" lang="text/javascript">
    </script>
    <script lang="text/javascript">qdbWrite();</script>

    so you would just need to make sure your app token, etc was all set with your URL and instead of building that table below with html use the script snippet at the end there. You would also want to make sure in this instance that you have an everyone on the internet role that is set to view the data you are pulling out to that table since it looks like your request isn't using an Auth ticket. The steps would be:

    1. Add the Everyone on the Internet to your target application. Make sure it has "view" role permissions to the data you need to display elsewhere. Alternatively, if you don't want to open your application to everyone in the world you would have to utilize the API_Authenticate command whenever you query your database.
    2. Create a token in your target application
    3. Create a report in your target application and select the appropriate filter, sorting & grouping, and columns to display section you would like to appear in your report. Save this report and mentally or physically note the qid generated.
    4. Paste that code into the site you need your embedded report to appear
    5. Replace the DBID (currently xxxxxx) with your table ID, the report ID (currently 52) with your report ID, and your application token with the token you just created.
      Important: If your code is in a website other than on quickbase.com, make sure to include  before your table ID.


    ------------------------------
    Evan Martinez
    Community Marketing Manager
    Quick Base
    ------------------------------



  • 12.  RE: Table Report in HTML

    Posted 12-08-2020 09:30
    Your final code here worked great. however, is it possible to convert this to be using an embedded report link? The report needs to filter to the related case i am on and the code above shows the entire report. How could i tweak this to account for that?

    ------------------------------
    Bob Salaj
    ------------------------------



  • 13.  RE: Table Report in HTML

    Posted 02-14-2022 10:46
    For anyone interested in more opportunities to use HTML in apps - consider upvoting my request to QuickBase to allow for HTML in report descriptions: https://feedback.quickbase.com/app/#/case/141736?expires=1645443785&signature=52badc31ec79ec212b38&url=case%2F141736&user=18936067

    Right now reports can only be manually typed from report settings - it would be great for users and admin to allow for formatting of those descriptions (EX: bolding to emphasize some text) and, ideally, to allow an Admin to point to an HTML code page for report descriptions. I have many reports that are very similar, it would be great to be able to update their descriptions in one place.

    ------------------------------
    Chyanne
    ------------------------------