1

I am using Forena reports to generate my custom reports. I want to use a custom PHP variable which increments its value under foreach loop in layout under (Create new reports through admin interface).

<?php $num = 0; ?>
<tr frx:foreach="*" id="promo_reports">
            <td><?php $num += 1; print $num; ?></td>
            <td>{fn}</td>
            <td>{ln}</td>
            <td>{em}</td>
            <td>{ph}</td>
            <td>{tr}</td>
            <td><img alt="" src="{site.base_url}/sites/default/files/{up}" /></td>
            <td>{coupon_code}</td>
</tr>

In the same way, how to use different tags for different document types. For example, while rendering the image in above td,

For document types doc and html, I want to use as below:

<td><img alt="" src="{site.base_url}/sites/default/files/{up}" /></td>

For document types xls and csv, I would like to use like below:

<td>{site.base_url}/sites/default/files/{up}</td>
  • 1
    Please extend your question to add an example of how you'd want the generated report to look like. That might help to further improve your question so that anybody who possibly doesn't understand/know Forena's "FRX template format", also understands the goal you're trying to achieve. Additionally, consider moving everything in your question starting from "In the same way,..." to a separate question, because that's not at all related to the custom PHP variables your asking about. – Pierre.Vriens May 12 '17 at 12:12
  • @Pierre, thanks again. I don't know why they put the question on-hold. But, my requirement is to add a dummy incremental column to get the incremental count of the rows. And populate the report based on the report type used. – Kiran May 12 '17 at 12:39
  • Kiran, please review this revision of your question, trying to clarify some things about "document types" (the terminology you used is not correct ...). If you "like" that revision, I suggested you perform a rollback of your question to that revision. – Pierre.Vriens May 13 '17 at 18:26
  • @Pierre.Vriens, rolled back to your version. – Kiran May 16 '17 at 10:33
  • Merci for taking my advise ... FYI: I also voted to re-open your question (some days ago). But it looks like I'm the only one who did so. Fingers crossed something will happen for this question to be reopened (there is not enough room in a comment to answering it ...). – Pierre.Vriens May 16 '17 at 10:40

Browse other questions tagged or ask your own question.