Jump to content
  • 0

How To Show Sums


georgeadams

Question

I need to be able to show a form that includes data from a primary table and then an HTML table of a related child table.  I do not see any instructions on how to do this.  Is this possible with Caspio?  Or do I need to create an external HTML page to handle this that merges two different datapages?

 

On a related now, I want to also show a summary report that shows info from the primary table, and then shows counts from the related child table.  For example, I want something like this:

 

name, count of orders, sum of order totals, data of last order

 

How can  I accomplish this?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

You can simply embed a DataPage in another DataPage using frame deploy code and if you would like to get the related data you need to pass the unique ID through the link source of the iframe. For instance:

 

<iframe name="Contacts - Add" title="Contacts - Add" src="http://b2.caspio.com/dp.asp?AppKey=11333000efc24590499bb5b3&ID=[@field:IDFIELDNAME]">Sorry, but your browser does not support frames.</iframe>

 

In the results page, add a calculated field to count the number from another table. The formula is SQL COUNT Function as below:
 

SELECT COUNT(expression)
FROM tables
WHERE predicates

For instance :

select count(Order_id) from Order where Customer_ID=[@field:Customer_id]

Link to comment
Share on other sites

  • 0

Hi MayMusic,

 

How do you embed a datapage into another datapage?

 

I am trying to create one datapage that pulls and displays record count info from multiple datapages.

 

You can simply embed a DataPage in another DataPage using frame deploy code and if you would like to get the related data you need to pass the unique ID through the link source of the iframe. For instance:

 

<iframe name="Contacts - Add" title="Contacts - Add" src="http://b2.caspio.com/dp.asp?AppKey=11333000efc24590499bb5b3&ID=[@field:IDFIELDNAME]">Sorry, but your browser does not support frames.</iframe>

 

In the results page, add a calculated field to count the number from another table. The formula is SQL COUNT Function as below:
 

SELECT COUNT(expression)
FROM tables
WHERE predicates

For instance :

select count(Order_id) from Order where Customer_ID=[@field:Customer_id]

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...