I am trying to use a custom template for one of the reports. It’s a straightforward Summary report based on a View that I created.
The SQL for the View is the following. There is no issue with SQL as I have executed it successfully in MySQL Workbench.
SELECT o.order_id AS OrderID, u.user_name AS Name, u.user_phonenumber AS Phone,
u.user_email AS Email, ua.address AS DeliveryAddress,
Date_Format(From_UnixTime(o.order_id), ‘%Y %D %M %h:%i:%s %x’) AS OrderDate,
o.order_total AS OrderTotal, m.menuitem_name AS ItemName,
omi.menuitem_purchase_price AS ItemPrice, omi.quantity AS ItemQuantity,
(omi.menuitem_purchase_price * omi.quantity) AS ItemExtendedPrice
FROM (((orders o LEFT JOIN
user u ON o.user_id = u.user_id) LEFT JOIN
user_address ua ON o.delivery_address_id = ua.address_id) LEFT JOIN
order_menuitems omi ON o.order_id = omi.order_id) LEFT JOIN
menuitems m ON omi.menuitem_id = m.menuitem_id
Now, in the custom template header of the summary report, I want to print out values of fields and I used the following syntax:
{{: Name }}
If I put it that way, it does not print out the value of the field at all.
I have another field called ‘Phone’ (from the SQL above) and I print it out the same way {{:Phone}} and the value DOES GET PRINTED OUT!!!
Could you please tell me how to render value of a variable using jsRender tag? Just one example would suffice. I thought that enclosing a variable name inside {{: }} would do the job as it is done in the tutorial that is there on the phpmaker website. If it is any different, could you please give one example?
I looked up documentation on jsRender tags and I am correctly using them. It’s just that variable “Phone” get printed out, but variable “Name” does not! And, the difference that I found was that while Phone is a varchar(15), Name is a varchar(500). When I create the view and report, it chooses “TEXTAREA” as the edit tag for Name while it chooses “TEXT” for “Phone”.
Also, by default, “Name” is not selected to be part of list page in the view, while “Phone” is by default selected.
That is my research so far. Any ideas why “Name” is not getting printed in the custom report? Any pointers would be greatly appreciated.