Jump to content
  • 0

Difficulty with structuring report


waltmayo
 Share

Question

What I'm about to ask for is very common in normal coding... one table for demographics... one table for products purchased. I need a report that ends up like this:

Buyer Name

Buyer Address

Buyer Phone

- - - - - - - - - - -

Item Purchased #1

Item Purchased #2

Item Purchased #3 (and on and on).

I understand how to create a view linking two tables by say... BuyerID... but can't figure out how to list the demographics just ONCE and then the products purchased in a report where multiple buyers are listed... each with their demographics, then purchased items below.

Help!

Walt

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

This tutorial will help you to create your report: http://howto.caspio.com/deployment/ifra ... table.html

In your example you can create a predefined tabular report which is based on ITEM table and is filtered by BuyerID, which is the join field. Get the iframe deploy code of this page.

Create a list report which is based on BUYER table. In Configure Result Page Fields screen add the information from buyer you would like to show and also add an HTML block to paste the iframe code of the previous report page from step 1. You need to pass the BuyerID through the link in here as described in the tutorial.

This way you will get the exact report you would like to have and no need to create view.

Good Luck :!: :!: :!: :!:

Link to comment
Share on other sites

  • 0
On 12/6/2012 at 11:50 AM, MayMusic said:

This tutorial will help you to create your report: http://howto.caspio.com/deployment/ifra ... table.html

In your example you can create a predefined tabular report which is based on ITEM table and is filtered by BuyerID, which is the join field. Get the iframe deploy code of this page.

Create a list report which is based on BUYER table. In Configure Result Page Fields screen add the information from buyer you would like to show and also add an HTML block to paste the iframe code of the previous report page from step 1. You need to pass the BuyerID through the link in here as described in the tutorial.

This way you will get the exact report you would like to have and no need to create view.

Good Luck :!: :!: :!: :!:

I tried this solution but the boxes on the list report arent large enough to display the tabular report.  Specifically they seem to max out in height so that I'm having to scroll with in the frame.  Is there a way to force the boxes on the list report to adjust their height appropriately?

 

Link to comment
Share on other sites

  • 0

@benrob

You may use this code in the Result set of the Report:

1. Header -

</header>
<div id="wrapper">
<header>

2. Footer -

</footer>
</div>
<footer>

<script type="text/javascript">

document.addEventListener('DataPageReady', resizeHandler)

function resizeHandler(event) {
 let heightVal = document.getElementById('wrapper').offsetHeight + 150;  // Change 150 according to the height of the search form
 var localWindow = window.parent.document.querySelector('iframe[name="Search and Report"]').style; // Change the name of the DataPage
 localWindow.height = heightVal + 'px';
 document.removeEventListener('DataPageReady', resizeHandler)
};

</script>

If you still see scroll, change the 150 value as mention in the code.

Also, you need to use the name of your DataPage instead of "Search and Report"

Link to comment
Share on other sites

  • 0
3 hours ago, Hastur said:

@benrob

You may use this code in the Result set of the Report:

1. Header -


</header>
<div id="wrapper">
<header>

2. Footer -


</footer>
</div>
<footer>

<script type="text/javascript">

document.addEventListener('DataPageReady', resizeHandler)

function resizeHandler(event) {
 let heightVal = document.getElementById('wrapper').offsetHeight + 150;  // Change 150 according to the height of the search form
 var localWindow = window.parent.document.querySelector('iframe[name="Search and Report"]').style; // Change the name of the DataPage
 localWindow.height = heightVal + 'px';
 document.removeEventListener('DataPageReady', resizeHandler)
};

</script>

If you still see scroll, change the 150 value as mention in the code.

Also, you need to use the name of your DataPage instead of "Search and Report"

Thanks for the help.  It works fine in Preview but not on the Deployed page on my site.  I'm running in to the same error that I see with other solutions.   From what I understand it's not allowing the javascript to run from caspio.

Uncaught DOMException: Blocked a frame with origin "https://c0abk755.caspio.com" from accessing a cross-origin frame.

 

Link to comment
Share on other sites

  • 0

@benrob

You an try the following:

1. Place this code outside of the iFrame deployment above the deploy code:

<script type="text/javascript">
	window.addEventListener("message", receiveMessage, false);
	function receiveMessage(event) {
		document.querySelector('iframe[name="Search and Report"]').height = event.data
	}
</script>

2. Insert this code into the Result set of the Report:

Header:

</header>
<div id="wrapper">
<header>

Footer:

</footer>
</div>
<footer>

<script type="text/javascript">

document.addEventListener('DataPageReady', resizeHandler)

function resizeHandler(event) {
 let heightVal = document.getElementById('wrapper').offsetHeight + 150;
 parent.postMessage(heightVal, '*');
 document.removeEventListener('DataPageReady', resizeHandler)
};

</script>

Do not forget to  use the name of your DataPage instead of "Search and Report"

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...
 Share

×
×
  • Create New...