Add logo to reports

(Anton) #1

Is there any way of adding a clinic logo to reports? I found some 10 year old threats related to this, as far as I understand some heavy customization was required for this. Does this have changed, is there a way to add a logo to (patient) reports?

(ViSolve) #2

Yes it’s possible to add logo in reports.
We have simple solution to display logo in PDF Reports.
In the file interface/patient_file/report/custom_report.php, include an img tag to display logo as shown below (Approx line No: 217)

echo “<img src='images/try.png '>”;

Let us know if you have any clarifications.


(Anton) #3

Thanks! In this file, around line 217, I see the following code, differing a bit from your tag:

// Setup Headers and Footers for mPDF only Download
// in HTML view it’s just one line at the top of page 1
echo '<page_header style=“text-align:right;” class=“custom-tag”> ’ . xlt(“PATIENT”) . ‘:’ . text($titleres[‘lname’]) . ', ’ . text($titleres[‘fname’]) .$
echo ‘<page_footer style=“text-align:right;” class=“custom-tag”>’ . xlt(‘Generated on’) . ’ ’ . text(oeFormatShortDate()) . ’ - ’ . text($facility['name$

// Use logo if it exists as 'practice_logo.gif' in the site dir
// old code used the global custom dir which is no longer a valid
$practice_logo = "";
$plogo = glob("$OE_SITE_DIR/images/*");// let's give the user a little say in image format.
$plogo = preg_grep('~practice_logo\.(gif|png|jpg|jpeg)$~i', $plogo);
if (! empty($plogo)) {
    $k = current(array_keys($plogo));
    $practice_logo = $plogo[$k];

So, would I add the tag you posted in the page_header line? Or as practice_logo just below?
I guess I place the image in the same folder as this script, or does something (e.g. access rights) speaks against this?

(ViSolve) #4

To make it simpler, don’t make any changes in the file interface/patient_file/report/custom_report.php.
Place your image in sites/default/images/ directory. Make sure that image name should ends with “practice_logo”.
Kindly ensure that image type is “gif|png|jpg|jpeg”
Let us know if you have any clarifictaions.


(Anton) #5

Thanks, that worked great!