Generating PDF displays variable names and not values.

Hi,

I think this is probably a simple issue that I have but I’m getting nowhere fast with it. I have a one to many relationship between “record-collection” and “records” (1 record collection has many records). What I want is to do is generate a pdf of the records in my collection. When I try to add the variables to the pdf template I just get the variable names printed to the pdf file.

Also I want to display my list of records in between the buttons on the edit view so I can update any details easily. I’m not sure how to do this.

This is the code for my record collection edit view:


	<?php

	require_once 'include/MVC/View/views/view.edit.php';
	require_once('modules/AOS_PDF_Templates/formLetter.php');

	if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
	class RECOL_Record_CollectionViewEdit extends ViewEdit
	{
	    public function display()
	    {
	    	formLetter::DVPopupHtml('RECOL_Record_Collection');
	        parent::display();

	        $recordCollectionBean = BeanFactory::getBean('RECOL_Record_Collection', $_REQUEST['record']);
			$recordCollectionBean->load_relationship('recol_record_collection_recor_records_2');
			$recordsBeans = $recordCollectionBean->recol_record_collection_recor_records_2->getBeans();

			foreach($recordsBeans as $recordBean){
                            /*
                               Surely there is a better way to output html
                            */
				echo "<br />Name" . $recordBean->name;
				echo "<br />Description: ".$recordBean->description;
				echo "<br />Image: ".$recordBean->image_c;
				echo "<br /><img src=\"upload/".$recordBean->id."_image_c\" />";
				echo "<br /><br />";

			}

	    }

	}

I’ve attached a few screenshots to show what I mean.

Any help with this would be much appreciated.