Jump to content

Print Button


Recommended Posts

Here are the steps you can take:

  • Navigate to the DataPages listing in an app, select a DataPage you would like to add a PrintWhatYouLike link, and click Edit.
  • Proceed to the Configure Fields screen. Insert a Header & Footer section to your DataPage. Copy and paste the following code into the header or footer sections or both.
<a href="javascript:(function(){
if(window['ppw']&&ppw['bookmarklet']){
ppw.bookmarklet.toggle();
}
else{
window._pwyl_home='http://www.printwhatyoulike.com/';
window._pwyl_pro_id=null;
window._pwyl_bmkl=document.createElement('script');
window._pwyl_bmkl.setAttribute('type','text/javascript');
window._pwyl_bmkl.setAttribute('src',window._pwyl_home+'static/compressed/pwyl_bookmarklet_10.js');
window._pwyl_bmkl.setAttribute('pwyl','true');document.getElementsByTagName('head')[0].appendChild(window._pwyl_bmkl);
}})();
alert('Using the panel on the Left 
The background, images and margins can be hidden if needed. 
Select an area you would like to print and click Isolate.
Select an area and click Remove to remove any unwanted sections.



Click Print or Save As when finished.

');

">Print this Data</a>
  • Click Finish.

Basic Print Button

If you would like a basic print button that will print out everything on the current webpage, you can just insert the following code into the header or footer of your DataPage:

<input type="button" value=" Print this page " onclick="window.print();return false;" />

Which creates a regular HTML button: Print this page 

 

Here is the website where I got the code from : http://www.printwhatyoulike.com/

Link to comment
Share on other sites

  • 5 weeks later...

Hi

 

Thanks for the options.

 

The http://www.printwhatyoulike.com/ site shows up as Annonymiser/Proxy on the corporate networks so this method cannot be used in this case.

 

The <input type="button" value=" Print this page " onclick="window.print();return false;" /> works fine for simple forms.

 

However, I have an application form with one text field up to 2000 characters but a text box that only show 400 characters at a time. So the Print option truncates the text after 400 characters.

 

My logic is saying to copy the DataPage then make the larger text field displays to show the whole of the possible text inserted. So if 2000 characters available, the text box must show the 2000 characters.

 

This should work but it is not very slick as there will be occasions when there are say 100 characters used of the 2000 available and then on printing there will be loads of white space.....

 

Would using html code to insert the results of a field be a better idea? A print button would load a new DataPage or HTML page to fill in the data from the application.

 

Your thoughts and coding suggestions greatly appreciated.

 

Regards

 

Peter

Link to comment
Share on other sites

Just off the top of my head, but you might look into building the second page you mentioned, and use a calculated field to display the data.  There are a few formulas available in calculated fields that will let you trim the leading and following spaces of a field.

 

I do not know if Caspio actually pads out a 2,000 character text field with spaces, but maybe the trim function will return only the text string.

 

Hope this helps, I have not checked any of it out myself...

 

ET

Link to comment
Share on other sites

  • 1 month later...

If you just want to print the <form id="caspioform" ... a simple way will be to create a footer in your report form and copy the code below.

 

 

<input type="button" onclick="printDiv('caspioform')" value="Print caspioform" />

 <script>
function printDiv(divName) {
     var printContents = document.getElementById(divName).innerHTML;
     var originalContents = document.body.innerHTML;
     document.body.innerHTML = printContents;
     window.print();
     document.body.innerHTML = originalContents;
}

</script>

VK.

Link to comment
Share on other sites

  • 11 months later...
  • 1 year later...
  • 11 months later...
<input type="button" onclick="printDiv('caspioform')" value="Print caspioform" />

 <script>
function printDiv(divName) {
     var printContents = document.getElementById(divName).innerHTML;
     var originalContents = document.body.innerHTML;
     document.body.innerHTML = printContents;
     window.print();
     document.body.innerHTML = originalContents;
}

</script>

I'm trying to print out a tabular results screen using the above code.  Using 'caspioform' as the variable, I seem to be pulling the URL.  Anyone have any ideas on how to print out just the table of the results screen?

Link to comment
Share on other sites

  • 8 months later...
On 3/10/2014 at 3:19 PM, perland said:

If you just want to print the <form id="caspioform" ... a simple way will be to create a footer in your report form and copy the code below.

 

 

<input type="button" onclick="printDiv('caspioform')" value="Print caspioform" />

 <script>
function printDiv(divName) {
     var printContents = document.getElementById(divName).innerHTML;
     var originalContents = document.body.innerHTML;
     document.body.innerHTML = printContents;
     window.print();
     document.body.innerHTML = originalContents;
}

</script>

VK.

This is great! Thank you! Is there a way to get it to print the header as well as the table?

Link to comment
Share on other sites

  • 7 months later...
  • 4 months later...

Hello there!

I found a post similar to your inquiry. 

Check this out:

On 1/8/2019 at 10:36 PM, QueenB said:

Is there an easy way to add a print button to a results page from a search and report DataPage? What about formatting the result for a label? Use a view?

Also you can check this documentation in Caspio’s Help center: https://howto.caspio.com/release-notes/caspio-bridge-13-0/

This release includes a new feature of PDF Download option that allows you to download your displayed reports from Results Page as a PDF File. 

However, this feature only available in the ‘Results Page’ of the [search and report DataPages].

I hope this helps 

Link to comment
Share on other sites

  • 2 years later...

hi @Master,

I want to update you on their PDF generator it is now available in results page and details page,  check this documentation in Caspio’s Help center: https://howto.caspio.com/release-notes/caspio-bridge-26-0/ .For more information regrading the said feature you may check this link: https://howto.caspio.com/datapages/pdf-download/pdf-download/.
 

Link to comment
Share on other sites

  • 7 months later...
  • 3 months later...

Hi everyone!  Caspio has new update and enhancement about PDF Documents. You can now insert PDF documents on results pages in addition to details pages. You can now as well customize the “Download PDF” action link using the associated style and localization, or create a custom display during DataPage configuration.

It is available in R31 version: https://howto.caspio.com/release-notes/caspio-31-0/

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
Reply to this topic...

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