Forum for discussing general topics related to Couch.
9 posts Page 1 of 1
Two very important things:
1. I am in love with CouchCMS
2. This is my 1st post, hope I am not doing the posting on a wrong thread (new thread)

I have lately been working with databound forms feature of Couch. I searched for what is my current requirement, but didnt find anything that could solve my problem. The problem description is:

Problem Statement:
Generating a report from the data collected by the DataBound Forms, so that they can be printed by:
(a) selecting a range for printing (Entire report or selective range)
(b) printing at the click of a button
(c) saving the report in the pdf format (automatically)
so that the Data Saved in DataBound Forms can be saved or printed out for evaluating for personal/company/organizational/commercial purposes.

Expecting an early reply. Please.
Image
where innovation meets technology
Hello and welcome genxcoders.
I am so glad you liked Couch :)

Data-bound forms create regular cloned pages so we can always list them on the front-end using cms:pages tag. Using the technique described at viewtopic.php?f=8&t=7620 we can create a 'filtered' search to fine-tune exactly what gets ouputted.

So, as the first step in solving your problem - we'll have to use the technique above to 'generate' and show the reports on the front-end like a regular webpage.

The second step then would be to either print the webpage we got above or save it as PDF.

Printing is trivial as that is built into all browsers (requires only setting a stylesheet specific to print and using JS to send the output to printer).
Converting to PDF, however, will require using third-party PDF library.

Anways, I suggest you please complete the first step (showing the report as a webpage) and we can come to the second step latter.

Do keep us posted.
Thanks.
@KK

Thanks for the quick reply.
I will try the first step now and get back soon.
Image
where innovation meets technology
Converting to PDF, however, will require using third-party PDF library.
I realized that the statement is not strictly true - Chrome, while printing, natively gives an option to save the print output as PDF. So, even that is trivial now.
Oops!

I am stuck again.
I am able to submit the DataBound Form. But it is not getting saved at the back-end.

Please help me step-by-step.
Image
where innovation meets technology
Please help me step-by-step.
For that I'll have to take a look at your code.
This is my code:

<?php require_once( 'couch/cms.php' ); ?>
<cms:template title='Event Registration Form' clonable='1'>
<cms:editable name='first_name' required='1' type='text' />
<cms:editable name='last_name' required='1' type='text' />
<cms:editable name='college_name' required='1' type='text' />
<cms:editable name='email' required='1' validator='email' type='text' />
<cms:editable name='mob_num' required='1' type='text' />
<cms:editable name='event' required='1' type='checkbox'
opt_values=' Event One | Event Two | Event Three | Event Four | Event Five | Event Six'
/>
<cms:editable name='paper' required='0' allowed_ext='pdf, doc, docx' max_size='1024' type='securefile' />
</cms:template>
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><![endif]-->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<meta content="black" name="apple-mobile-web-app-status-bar-style">

<title>Soap</title>
<meta name="description" content="">

<link href="css/bootstrap.min.css" media="screen" rel="stylesheet">
<link href="css/styles.css" media="screen" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/normalize.min.css">
<link rel="stylesheet" type="text/css" href="css/main.css">
<link rel="stylesheet" type="text/css" href="css/flexslider.css">
<link rel="stylesheet" type="text/css" href="css/font-awesome.css">
<link rel="stylesheet" type="text/css" href="js/fancybox/jquery.fancybox63b9.css?v=2.1.4" media="screen" />
<link rel="stylesheet" type="text/css" href="rs-plugin/css/settings.css" media="screen" />
<script src="js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script>
</head>
<body>

<!--[if lt IE 7]>
<p class="chromeframe">You are using an outdated browser. <a href="http://browsehappy.com/">Upgrade your browser today</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to better experience this site.</p>
<![endif]-->


<!-- Start Outter Wrapper -->
<div class="outter-wrapper">

<!-- Start Main Navigation -->
<div class="header-container wrapper">
<header class="clearfix">
<a href="index.html" class="logo"><img src="img/logo_2x.png" alt="Logo" /></a>
<nav id="nav-wrap">
<ul class="nav" id="nav">
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="event.html">Event</a></li>
<li><a href="registration.html">Registration</a></li>
<li class="last"><a href="contact.html" class="active">Contact</a></li>
</ul>
</nav>
</header>
</div>
<!-- End Main Navigation -->
</div>
<!-- End Outter Wrapper -->




<!-- Start Outter Wrapper -->
<div class="outter-wrapper feature map">
<!--<iframe width="100%" height="550" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com.au/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=San+Diego,+CA,+United+States&amp;aq=0&amp;oq=san+die&amp;sll=-25.335448,135.745076&amp;sspn=83.735932,130.605469&amp;ie=UTF8&amp;hq=&amp;hnear=San+Diego,+California,+United+States&amp;ll=32.715329,-117.157255&amp;spn=0.164801,0.255089&amp;t=m&amp;z=13&amp;output=embed"></iframe>-->
</div>
<!-- End Outter Wrapper -->




<!-- Start Outter Wrapper -->
<div class="outter-wrapper">
<!-- Start Main Body -->
<div class="main-container">
<div class="main wrapper clearfix">
<!-- Start Main Content -->

<div class="main-content full">
<h1>Get in touch</h1>
<p class="lead">Hello? Who's there, I'm talkin? Hello? Who is this? Baxter... is that you? Baxter! Bark twice if your in Milwaukee... </p>

<!-- Start Form -->
<cms:set submit_success="<cms:get_flash 'submit_success' />" />
<cms:if submit_success >
<h4>Success: Your application has been submitted.</h4>
</cms:if>

<cms:form
masterpage=k_template_name
mode='create'
enctype='multipart/form-data'
method='post'
anchor='0'
>

<cms:if k_success >

<cms:check_spam email=frm_email />

<cms:db_persist_form
_invalidate_cache='0'
_auto_title='1'
/>

<cms:set_flash name='submit_success' value='1' />
<cms:redirect k_page_link />
</cms:if>

<cms:if k_error >
<div class="error">
<cms:each k_error >
<br><cms:show item />
</cms:each>
</div>
</cms:if>
<!--<form method="post">-->
<cms:input name="first_name" type="bound" placeholder="First Name" />
<br />

<cms:input name="last_name" type="bound" placeholder="Last Name" />
<br />

<cms:input name="college_name" type="bound" placeholder="College Name" />
<br />

<cms:input name="email" type="bound" placeholder="Email Address" />
<br />

<cms:input name="mob_num" type="bound" placeholder="Mobile Number" />
<br />

<h3>Select Events to Participate</h3>
<cms:input type="bound" name="event" value="checkbox" id="CheckboxGroup1_0" />
<br /><br />

<h3>Attach a Copy of Your Paper (Only for students participating in Paper Presentation)</h3>
<cms:input name="paper" type="bound" />
<p>Word or PDF Documents Only</p>
<br />

<div class="<cms:if k_error_human >has-error</cms:if>">
<label class="control-label" for="human">Are you HUMAN?</label>
<cms:input id="human" name="human" type="text" required='1' validator='regex=/^blue$/i' placeholder='What colour is a blue apple? (4 characters required)' />
</div>

<cms:if "<cms:not submit_success />" >
<cms:input name="button" class="btn" type="submit" value="Confirm Registration" id="send" />
</cms:if>
</cms:form>
<div id="response"></div>

<!-- Finish Main Content -->
</div>
</div> <!-- #main -->
</div> <!-- #main-container -->





<!-- Start Widget Footer -->
<div class="widget-footer main clearfix">
<div class="wrapper clearfix">

<!-- Start Column -->
<div class="third">
<h4>Address</h4>
<p><em>Donec id elilit non mi porta gravida at eget metus. Donec ullamcorper nulla non metus auctor fringilla. Vivamus sagittis lacus vel.</em></p>
</div>

<!-- Start Column -->
<div class="third">
<h4>College Contact</h4>
<ul>
<li><a href="#">Stay Classy San Diego Stay Classy San Diego</a></li>
<li><a href="#">I love scotch</a></li>
<li><a href="#">A channel 4 exclusive</a></li>
<li><a href="#">Get a grip man</a></li>
</ul>
</div>

<!-- Start Column -->
<div class="third">
<h4>Event Contact</h4>
<p class="tweet">Donec id porta gravida at eget <a href="#">#metus #metus</a> auctor fringilla donec id elit non mi porta.</p>
</div>

</div>
</div>
<!-- End Widget Footer -->




<!-- Start Footer -->
<footer>
<div class="clearfix">
<div class="foot right">
<!-- Social Media icons -->
<ul class="social-link">
<li><a href="#"><em class="icon-dribbble"></em></a></li>
<li><a href="#"><em class="icon-facebook"></em></a></li>
<li><a href="#"><em class="icon-twitter"></em></a></li>
<li><a href="#"><em class="icon-skype"></em></a></li>
<li><a href="#"><em class="icon-linkedin"></em></a></li>
</ul>
</div>
<!-- Copyright Info -->
<div class="foot left">&copy; Copyright Soap 2013</div>
</div>
</footer>

<!-- Finish Outer Wrapper -->
</div>




<!-- Start Scripts -->
<script type="text/javascript" src="js/vendor/jquery-1.8.3.min.js"></script>

<script type="text/javascript" src="js/fitvids.min.js"></script>
<script type="text/javascript" src="js/fancybox/jquery.fancybox63b9.js?v=2.1.4"></script>
<script type="text/javascript" src="js/placeholder.js"></script>
<script type="text/javascript" src="js/jquery.flexslider-min.js"></script>
<script type="text/javascript" src="js/mosaic.1.0.1.min.js"></script>
<script type="text/javascript" src="js/cleantabs.jquery.js"></script>
<script type="text/javascript" src="rs-plugin/js/jquery.themepunch.plugins.min.html"></script>
<script type="text/javascript" src="rs-plugin/js/jquery.themepunch.revolution.min.js"></script>
<script type="text/javascript" src="js/rs-slider.js"></script>
<script type="text/javascript" src="js/contact.js"></script>
<script type="text/javascript" src="js/jquery.form.js"></script>
<script type="text/javascript" src="js/jquery.validate.min.js"></script>
<script type="text/javascript" src="js/main.js"></script>


<!-- Start Google Analytics -->
<script>
var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>

</body>
</html>
<?php COUCH::invoke(); ?>
Image
where innovation meets technology
Hi,

I tested you template on my machine and everything is working just fine (i.e. submitting form results in creation of cloned page in admin).

Could be some issue with the JS files your template is using - try disabling JavaScript in your browser and submit the form.

Thanks.
Finally am done with it...

The form is all ready and running...
Now set for the next step... Awaiting!!!
Image
where innovation meets technology
9 posts Page 1 of 1
cron