Master Posted December 13, 2013 Report Share Posted December 13, 2013 How can I add a print button to my page? Quote Link to comment Share on other sites More sharing options...
MayMusic Posted December 13, 2013 Report Share Posted December 13, 2013 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/ Benades 1 Quote Link to comment Share on other sites More sharing options...
PeterJSY Posted January 12, 2014 Report Share Posted January 12, 2014 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 Quote Link to comment Share on other sites More sharing options...
eetimm Posted January 16, 2014 Report Share Posted January 16, 2014 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 Quote Link to comment Share on other sites More sharing options...
perland Posted March 10, 2014 Report Share Posted March 10, 2014 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. Heineperson and Sunlark 2 Quote Link to comment Share on other sites More sharing options...
Sunlark Posted February 12, 2015 Report Share Posted February 12, 2015 Thanks, Perland! I just tried your suggestion and it worked great! Quote Link to comment Share on other sites More sharing options...
Olinelooo Posted April 23, 2016 Report Share Posted April 23, 2016 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.???? bmr calculator to lose weight Quote Link to comment Share on other sites More sharing options...
telepet Posted March 27, 2017 Report Share Posted March 27, 2017 <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? Quote Link to comment Share on other sites More sharing options...
shaferam Posted December 18, 2017 Report Share Posted December 18, 2017 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? Medron 1 Quote Link to comment Share on other sites More sharing options...
Heineperson Posted August 15, 2018 Report Share Posted August 15, 2018 Thank you @perland for this post!! It's exactly what I needed. Quote Link to comment Share on other sites More sharing options...
ManokNaPula Posted January 15, 2019 Report Share Posted January 15, 2019 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 Quote Link to comment Share on other sites More sharing options...
telly Posted April 25, 2021 Report Share Posted April 25, 2021 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/. Quote Link to comment Share on other sites More sharing options...
Kurumi Posted December 24, 2021 Report Share Posted December 24, 2021 Hi everyone! Just an update: Caspio has finally released a feature to show document generation, initially supporting custom PDF templates. You can upload your own fillable PDF file and map each field to a Caspio table. It is available in R30 version: https://howto.caspio.com/release-notes/caspio-30-0/ Quote Link to comment Share on other sites More sharing options...
Kurumi Posted March 31, 2022 Report Share Posted March 31, 2022 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/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.