How to remove [] in qweb when print sql output - python-3.x

I run this code for odoo 12
i need the output just 2
but when i print, the print out show [2]
can someone help me to remove [] in qweb
get_report is method to print report
This my python code:
#api.multi
#Call when button 'Get Report' clicked
def get_report(self):
sql = """SELECT 1+1"""
self.env.cr.execute(sql)
res_one = self.env.cr.fetchone()
data = {
'ids': self.ids,
'model': self._name,
'form': {
'sql': res_one
},
}
###use self.env.ref('module_name.report_id') as reference. report_action() will call
###_get_report_values() and pass 'data{}' automatically.
return self.env.ref('trabaud.recap_report').report_action(self, data=data)
#api.multi
def _get_report_values(self, docids, data=None):
sql = data['form']['sql']
return {
'sql': sql
}
This My XML
<table style="width:100%;">
<tr style="text-align:center">
<td style="width:30%;"/>
<td style="width:15%; text-align:left; padding: 0px;">Kode Barang</td>
<td style="width:2%; text-align:left; padding: 0px;">:</td>
<td style="width:23%; text-align:left; padding: 0px;"><b><span t-esc="kode"/></b></td>
<td style="width:30%;"/>
</tr>
<tr style="text-align:center">
<td style="width:30%;"/>
<td style="width:15%; text-align:left; padding: 0px;">Lokasi</td>
<td style="width:2%; text-align:left; padding: 0px;">:</td>
<td style="width:23%; text-align:left; padding: 0px;"><b><span t-esc="gudang_name"/></b></td>
<td style="width:30%;"/>
</tr>
<tr style="text-align:center">
<td style="width:30%;"/>
<td style="width:15%; text-align:left; padding: 0px;">Tahun</td>
<td style="width:2%; text-align:left; padding: 0px;">:</td>
<td style="width:23%; text-align:left; padding: 0px;"><b><span t-esc="sql"/></b></td>
<td style="width:30%;"/>
</tr>
</table>
and this print out result (https://i.stack.imgur.com/PlSUe.png)

Related

TinyMCE paste from excel

I have a problem with TinyMCE editor which I cannot resolve.
If I copy a table from Excel and paste it into the editor it loses the formatting. I have set up extended_valid_elements as follows...
extended_valid_elements:"a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],table[style|class|border=2|width|cellspacing|cellpadding|bgcolor],colgroup,col[style|width],tbody,tr[style|class],td[style|class|colspan|rowspan|width|height|background|span|padding],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style|font-family|color]"
The HTML that is saved into the MySQL field is as follows
From Excel ...
<table style="border-collapse: collapse; width: 242pt;" border="2" width="322">
<tbody>
<tr style="height: 14.25pt;">
<td style="height: 14.25pt; width: 105pt;" width="140">Test</td>
<td style="width: 104pt;" width="138"></td>
<td style="width: 33pt;" width="44"> </td>
</tr>
</tbody>
</table>
From Word ...
<table style="width: 242.0pt; border-collapse: collapse;" border="2" width="0">
<tbody>
<tr style="height: 14.25pt;">
<td style="width: 105.0pt; padding: 0cm 5.4pt 0cm 5.4pt; height: 14.25pt;" width="140">
<p style="margin-bottom: .0001pt; line-height: normal;"><span style="font-size: 10.0pt; font-family: 'Arial',sans-serif; color: black;">Test</span></p>
</td>
<td style="width: 104.0pt; padding: 0cm 5.4pt 0cm 5.4pt; height: 14.25pt;" width="139"></td>
<td style="width: 33.0pt; background: #92D050; padding: 0cm 5.4pt 0cm 5.4pt; height: 14.25pt;" width="44">
<p style="margin-bottom: .0001pt; line-height: normal;"><span style="font-size: 10.0pt; font-family: 'Arial',sans-serif; color: black;"> </span></p>
</td>
</tr>
</tbody>
</table>
How can I make this work from excel without having to go through word first?
It would appear I have to use power paste which is a paid-for option ... I have a call setup with their sales team to see how much it will cost! Fingers crossed.

HTML table scraping - table object returned as 1 big cell instead of separate elements

I've been working on a webpage scraping program from within excel VBA (with lots of help from this forum).
I've gotten stuck at a table which shows a single row, which I need to automate clicking. I used the same method for a similar table earlier in the process and that worked fine:
setting the HTML table to IEtable object
using ietable.rows(1).click
This table however, returns as 1 cell containing the values of all the separate elements I see on the webpage and the .click function doesn't work.
This is the HTML code for the table I am trying to access:
<table id="tblPatientList" class="tblTabBody" style="height: 143px; width: 653px;" cellspacing="2" cellpadding="0">
<tbody>
<tr style="height: 100%; width: 100%;">
<td style="width: 649px; height: 100%;">
<div id="divPatientList" style="overflow: auto; width: 100%; height: 100%; background-color: white;">
<table id="dgrPatients" class="tblpat" style="border-width: 0px; width: 100%; border-collapse: collapse;" border="0" rules="all" cellspacing="0" cellpadding="1">
<tbody>
<tr class="headerBlue">
<td style="width: 5%;"> </td>
<td style="width: 15%;">Hosp No.</td>
<td style="width: 15%;">Surname</td>
<td style="width: 15%;">Forename</td>
<td style="width: 10%;">DOB</td>
<td style="width: 2%;">Sex</td>
<td style="width: 10%;">NHS Number</td>
<td style="width: 25%;">Address</td>
<td class="screenOnlyOutput" style="width: 5%;" align="center">List</td>
</tr>
<tr class="even" style="color: red;">
<td align="center"> </td>
<td><strong>12345678</strong></td>
<td>ANONYMOUS FIRST NAME</td>
<td>ANONYMOUS LAST NAME</td>
<td>dd/mm/yyyy</td>
<td align="center">M</td>
<td>123 456 7890 <img style="cursor: hand; vertical-align: middle; border: 0px;" title="Number present and verified" src="/icedesktop/dotnet/icedesktop/images/tick.gif" /></td>
<td>ANONYMOUS ADDRESS</td>
<td class="screenOnlyOutput" align="center"><input id="dgrPatients_ctl02_chkAddOrRemove" style="border: 0px; height: 12px;" name="dgrPatients$ctl02$chkAddOrRemove" type="checkbox" /></td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
This table always only returns 2 rows - a header and 1 data row. I try to click it with:
Set ieTbl = ieDoc.Document.frames(0).Document.all.tblPatientList
If Not ieTbl Is Nothing Then
ieTbl.Rows(1).Click
Set ieTbl = Nothing
End If
When I examine the ietable object in the immediate window, it only has 1 row and 1 column, containing all the separate cells on the html page in 1 cell in the ietbl object.
Why is it doing this?

How to add a button inside of 1 cell inside a table on SharePoint?

I'm trying to add a button that links out to another website inside of a cell in SharePoint but it keeps moving the button to either above or below the table and not inside of the cell.
Is it possible to do this with either an embed code or an HTML code that I could place within "Edit Source" under "Content Editor"?
Any help on this would be appreciated. I have been researching solutions all day.
The below is currently what is being used. Am I doing something wrong?
<span style="font-size: 10px;">
<font face="Verdana">
<a href="/sites/Global_OE/SitePages/Forms/ByAuthor.aspx">
<strong>
<input name="HONDA" type="button" value="Case for Change & Sponsorship " style="background-color: #336699; color: #ffffff;"/>
</strong>
</a>
</font>
</span>
<table cellspacing="0" width="100%" class="ms-rteTable-default">
<tbody>
<tr class="ms-rteTableEvenRow-default">
<td class="ms-rteTableEvenCol-default" style="width: 206px;">​<br/>​<br/></td>
<td class="ms-rteTableOddCol-default" style="width: 20%; text-align: center;">
<style="background-color: style="font-family: optima;">​<img src="/sites/Global_OE/homepagedraft/SiteAssets/SitePages/Test/Picture1.png" alt="Picture1.png" style="margin: 5px; width: 25px; height: 25px;"/><span class="ms-rteFontSize-4">Diagn​​ose & Scope</span>​<br/></style="background-color:></td>
<td class="ms-rteTableEvenCol-default" style="width: 20%;">
</td>
<td class="ms-rteTableOddCol-default" style="width: 20%;">
</td>
<td class="ms-rteTableEvenCol-default" style="width: 20%;">
</td>
</tr>
<tr class="ms-rteTableOddRow-default">
<td class="ms-rteTableEvenCol-default" style="width: 206px;">
</td>
<td class="ms-rteTableOddCol-default">
<p>
<span style="font-family: optima;">•Align to the business strategy</span></p>
<p>
<span style="font-family: optima;">•Align on what success looks like with leader and/ or sponsor</span></p>
</td>
<td class="ms-rteTableEvenCol-default">​</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
</tr>
<tr class="ms-rteTableEvenRow-default">
<td class="ms-rteTableEvenCol-default" style="width: 206px; text-align: center;">
<div>​OE </div>
<div> Getting Started & Tracking Progress<br/></div>
</td>
<td class="ms-rteTableOddCol-default">​​​​​​​​​​<br/></td>
<td class="ms-rteTableEvenCol-default">​</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
</tr>
<tr class="ms-rteTableOddRow-default">
<td class="ms-rteTableEvenCol-default" style="width: 206px; text-align: center;">​Change Management<sup>3
<br/></sup>(Complex Change)<br/></td>
<td class="ms-rteTableOddCol-default">​<br/></td>
<td class="ms-rteTableEvenCol-default">​</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
</tr>
<tr class="ms-rteTableEvenRow-default">
<td class="ms-rteTableEvenCol-default" style="width: 206px; text-align: center;">​Organization Design<br/></td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
</tr>
<tr class="ms-rteTableOddRow-default">
<td class="ms-rteTableEvenCol-default" style="width: 206px;">
<div style="text-align: center;">​Everyday Change </div>
<div style="text-align: center;">(Team Effectiveness)<br/></div>
</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
</tr>
<tr class="ms-rteTableEvenRow-default">
<td class="ms-rteTableEvenCol-default" style="width: 206px; text-align: center;">​​Process Enablement<br/></td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
</tr>
</tbody>
</table>
The following code for your reference.
<table cellspacing="0" width="100%" class="ms-rteTable-default">
<tbody>
<tr class="ms-rteTableEvenRow-default">
<td class="ms-rteTableEvenCol-default" style="width: 206px;">​
<span style="font-size: 10px;">
<font face="Verdana">
<a href="/sites/Global_OE/SitePages/Forms/ByAuthor.aspx">
<strong>
<input name="HONDA" type="button" value="Case for Change & Sponsorship" onclick="window.location.href='/sites/Global_OE/SitePages/Forms/ByAuthor.aspx'" style="background-color: #336699; color: #ffffff;"/>
</strong>
</a>
</font>
</span>
</td>
<td class="ms-rteTableOddCol-default" style="width: 20%; text-align: center;">
<style="background-color: style="font-family: optima;">​<img src="/sites/Global_OE/homepagedraft/SiteAssets/SitePages/Test/Picture1.png" alt="Picture1.png" style="margin: 5px; width: 25px; height: 25px;"/><span class="ms-rteFontSize-4">Diagn​​ose & Scope</span>​<br/></style="background-color:></td>
<td class="ms-rteTableEvenCol-default" style="width: 20%;">
</td>
<td class="ms-rteTableOddCol-default" style="width: 20%;">
</td>
<td class="ms-rteTableEvenCol-default" style="width: 20%;">
</td>
</tr>
<tr class="ms-rteTableOddRow-default">
<td class="ms-rteTableEvenCol-default" style="width: 206px;">
</td>
<td class="ms-rteTableOddCol-default">
<p>
<span style="font-family: optima;">•Align to the business strategy</span></p>
<p>
<span style="font-family: optima;">•Align on what success looks like with leader and/ or sponsor</span></p>
</td>
<td class="ms-rteTableEvenCol-default">​</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
</tr>
<tr class="ms-rteTableEvenRow-default">
<td class="ms-rteTableEvenCol-default" style="width: 206px; text-align: center;">
<div>​OE </div>
<div> Getting Started & Tracking Progress<br/></div>
</td>
<td class="ms-rteTableOddCol-default">​​​​​​​​​​<br/></td>
<td class="ms-rteTableEvenCol-default">​</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
</tr>
<tr class="ms-rteTableOddRow-default">
<td class="ms-rteTableEvenCol-default" style="width: 206px; text-align: center;">​Change Management<sup>3
<br/></sup>(Complex Change)<br/></td>
<td class="ms-rteTableOddCol-default">​<br/></td>
<td class="ms-rteTableEvenCol-default">​</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
</tr>
<tr class="ms-rteTableEvenRow-default">
<td class="ms-rteTableEvenCol-default" style="width: 206px; text-align: center;">​Organization Design<br/></td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
</tr>
<tr class="ms-rteTableOddRow-default">
<td class="ms-rteTableEvenCol-default" style="width: 206px;">
<div style="text-align: center;">​Everyday Change </div>
<div style="text-align: center;">(Team Effectiveness)<br/></div>
</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
</tr>
<tr class="ms-rteTableEvenRow-default">
<td class="ms-rteTableEvenCol-default" style="width: 206px; text-align: center;">​​Process Enablement<br/></td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
</tr>
</tbody>
</table>

Building a Custom Report from a saved search using the "Advanced PDF/Template" Editor

I'm building a printable Report based off a saved search to group and subtotal multiple Lots and inventory Detail listing it under each item and displaying the subtotal below each group of items.
I can format the code properly to display 1 item at a time using this
<#if results?has_content>
<table class="itemtable" dir="ltr" style="width:100%;"><!-- start items --><#list results as result><tr>
<td style="width: 43px;"><span style="font-size:10px;">**</span></td>
<td colspan="2" rowspan="1" style="width: 70px;"><span style="font-size:10px;">${result.itemid}</span></td>
<td colspan="2" rowspan="1" style="width: 94px; white-space: nowrap;"><span style="font-size:10px;">${result.displayname}</span></td>
<td style="width: 133px;"> </td>
<td style="width: 72px;"> </td>
<td style="width: 47px;"> </td>
<td style="width: 120px;"> </td>
<td style="width: 79px;"> </td>
<td style="width: 68px;"> </td>
</tr>
<tr>
<td style="width: 43px;"><span style="font-size:10px;">${result.custitempacksize}</span></td>
<td style="width: 70px;"><span style="font-size:10px;">${result.custcol_lottextitemlinelevel}</span></td>
<td style="width: 48px;"><span style="font-size:10px;">${result.custitem_brand}</span></td>
<td style="width: 94px;">${result.expirationdate}</td>
<td style="width: 97px;"><span style="font-size:10px;">${result.serialnumbers}</span></td>
<td style="width: 133px;"><span style="font-size:10px;">${result.location}</span></td>
<td style="width: 72px;"><span style="font-size:10px;">${result.custbodyestimatedarrivaldate}</span></td>
<td style="width: 47px;"><span style="font-size:10px;">${result.rate}</span></td>
<td style="width: 120px;"><span style="font-size:10px;">${result.formulacurrency}</span></td>
<td style="width: 79px;"><span style="font-size:10px;">${result.quantityavailable}</span></td>
<td style="width: 68px;"><span style="font-size:10px;">${result.formulanumeric}</span></td>
</tr>
<tr>
<td style="width: 43px;">**</td>
<td colspan="3" rowspan="1" style="width: 70px;">Subtotal for : ${result.itemid}</td>
<td style="width: 97px;"> </td>
<td style="width: 133px;"> </td>
<td style="width: 72px;"> </td>
<td style="width: 47px;"> </td>
<td style="width: 120px;">
<hr />{subtotalEC}</td>
<td style="width: 79px;">
<hr />{subtotalLB}</td>
<td style="width: 68px;">
<hr />{subtotalCS}</td>
</tr>
</#list><!-- end items --></table>
</#if>
</body>
</pdf>
I'm on the right track to getting the results I want in the PDF but when I Attempt to add <#if> and <#else> tags to group the items It will save but then generate an Unexpected Error when I attempt to print it.
<pdf>
<head>
<link name="NotoSans" type="font" subtype="truetype" src="${nsfont.NotoSans_Regular}" src-bold="${nsfont.NotoSans_Bold}" src-italic="${nsfont.NotoSans_Italic}" src-bolditalic="${nsfont.NotoSans_BoldItalic}" bytes="2" />
<#if .locale == "zh_CN">
<link name="NotoSansCJKsc" type="font" subtype="opentype" src="${nsfont.NotoSansCJKsc_Regular}" src-bold="${nsfont.NotoSansCJKsc_Bold}" bytes="2" />
<#elseif .locale == "zh_TW">
<link name="NotoSansCJKtc" type="font" subtype="opentype" src="${nsfont.NotoSansCJKtc_Regular}" src-bold="${nsfont.NotoSansCJKtc_Bold}" bytes="2" />
<#elseif .locale == "ja_JP">
<link name="NotoSansCJKjp" type="font" subtype="opentype" src="${nsfont.NotoSansCJKjp_Regular}" src-bold="${nsfont.NotoSansCJKjp_Bold}" bytes="2" />
<#elseif .locale == "ko_KR">
<link name="NotoSansCJKkr" type="font" subtype="opentype" src="${nsfont.NotoSansCJKkr_Regular}" src-bold="${nsfont.NotoSansCJKkr_Bold}" bytes="2" />
<#elseif .locale == "th_TH">
<link name="NotoSansThai" type="font" subtype="opentype" src="${nsfont.NotoSansThai_Regular}" src-bold="${nsfont.NotoSansThai_Bold}" bytes="2" />
</#if>
<macrolist>
<macro id="nlheader">
${preferences.formlandscape}
<table class="header" style="width:100%;"><tr>
<td colspan="3" style="text-align: left; vertical-align: top; white-space: nowrap; height: 40px; width: 178px;"><span style="font-size:12px;"><strong>Date:</strong></span></td>
<td colspan="5" style="text-align: center; vertical-align: middle; white-space: nowrap; height: 40px; width: 400px;"><span style="font-size:12px;"><strong>Hofseth North America<br />In Stock Inventory Report sorted by Item<br />For All Items Available All Locations</strong></span></td>
<td colspan="3" style="text-align: right; vertical-align: top; white-space: nowrap; height: 40px;"><span style="font-size:12px;"><strong>Page:<pagenumber/> of <totalpages/></strong></span></td>
</tr></table>
<table boarder="1" class="header" style="width:100%;">
<thead>
<tr>
<th style="width: 40px;"><span style="font-size:12px;">Pack Size</span></th>
<th style="width: 55px;"><span style="font-size:12px;">Load #</span></th>
<th style="width: 75px;"><span style="font-size:12px;">Brand</span></th>
<th style="width: 50px;"><span style="font-size:12px;">Exp. Date</span></th>
<th style="width: 90px;"><span style="font-size:12px;">Lot #</span></th>
<th style="width: 100px;"><span style="font-size:12px;">Location</span></th>
<th style="width: 65px;"><span style="font-size:12px;">Arrival<br />Date</span></th>
<th style="width: 69px;"><span style="font-size:12px;">Unit<br />Cost</span></th>
<th style="width: 110px;"><span style="font-size:12px;">Extended<br />Cost</span></th>
<th style="width: 70px;"><span style="font-size:12px;">Qty<br />Available</span></th>
<th style="width: 64px;"><span style="font-size:12px;">Units<br />Available</span></th>
</tr>
</thead>
</table>
</macro>
</macrolist>
<style type="text/css">* {
<#if .locale == "zh_CN">
font-family: NotoSans, NotoSansCJKsc, sans-serif;
<#elseif .locale == "zh_TW">
font-family: NotoSans, NotoSansCJKtc, sans-serif;
<#elseif .locale == "ja_JP">
font-family: NotoSans, NotoSansCJKjp, sans-serif;
<#elseif .locale == "ko_KR">
font-family: NotoSans, NotoSansCJKkr, sans-serif;
<#elseif .locale == "th_TH">
font-family: NotoSans, NotoSansThai, sans-serif;
<#else>
font-family: NotoSans, sans-serif;
</#if>
}
table {
font-size: 9pt;
}
th {
font-weight: bold;
font-size: 8pt;
vertical-align: middle;
padding: 5px 6px 3px;
background-color: #e3e3e3;
color: #333333;
}
td {
padding: 4px 6px;
}
td p { align:left }
</style>
</head>
<body header="nlheader" header-height="15%" padding="0.2in 0.2in 0.2in 0.2in" size="Letter-LANDSCAPE">
<#if results?has_content><#assign subtotalEC = 0 subtotalLB = 0 subtotalCS = 0>
<table class="itemtable" style="width:100%;"><!-- start items --><#list results as result><#list result.itemid as items>
<tr>
<td style="width: 43px;"><span style="font-size:10px;">**</span></td>
<td colspan="2" rowspan="1" style="width: 70px;"><span style="font-size:10px;">${result.itemid}</span></td>
<td colspan="2" rowspan="1" style="width: 94px; white-space: nowrap;"><span style="font-size:10px;">${result.displayname}</span></td>
<td style="width: 133px;"> </td>
<td style="width: 72px;"> </td>
<td style="width: 47px;"> </td>
<td style="width: 120px;"> </td>
<td style="width: 79px;"> </td>
<td style="width: 68px;"> </td>
</tr>
<#elseif><tr>
<td style="width: 43px;"><span style="font-size:10px;">${result.custitempacksize}</span></td>
<td style="width: 70px;"><span style="font-size:10px;">${result.custcol_lottextitemlinelevel}</span></td>
<td style="width: 48px;"><span style="font-size:10px;">${result.custitem_brand}</span></td>
<td style="width: 94px;">${result.expirationdate}</td>
<td style="width: 97px;"><span style="font-size:10px;">${result.serialnumbers}</span></td>
<td style="width: 133px;"><span style="font-size:10px;">${result.location}</span></td>
<td style="width: 72px;"><span style="font-size:10px;">${result.custbodyestimatedarrivaldate}</span></td>
<td style="width: 47px;"><span style="font-size:10px;">${result.rate}</span></td>
<td style="width: 120px;"><span style="font-size:10px;">${result.formulacurrency}</span></td>
<td style="width: 79px;"><span style="font-size:10px;">${result.quantityavailable}</span></td>
<td style="width: 68px;"><span style="font-size:10px;">${result.formulanumeric}</span></td>
</tr>
</#elseif></#list>
<#else><tr>
<td style="width: 43px;">**</td>
<td colspan="3" rowspan="1" style="width: 70px;">Subtotal for : ${result.itemid}</td>
<td style="width: 97px;"> </td>
<td style="width: 133px;"> </td>
<td style="width: 72px;"> </td>
<td style="width: 47px;"> </td>
<td style="width: 120px;">
<hr />{subtotalEC}</td>
<td style="width: 79px;">
<hr />{subtotalLB}</td>
<td style="width: 68px;">
<hr />{subtotalCS}</td>
</tr>
</#else></#list><!-- end items --></table>
</#if>
</body>
</pdf>
I cannot get it to create the list I want using freemarker tags.
The code I've supplied saves with no errors
but then generates an unknown error when trying to print
or display it as PDF from the UI.
I would like the following to happen.
Have the report Group and list all items.
Under each Item List the Line level detailed information contained in the search from that item.
Subtotal 3 fields from the Grouped Info under each item and display it under the last Line of Grouped Information.
Then repeat for all items contained in the search
It might be finicky about your if-else structure.
You are closing the tags for the else-ifs and else's, where it might not like that.
Here's an example from the freemarker website:
<#if x == 1>
x is 1
<#elseif x == 2>
x is 2
<#elseif x == 3>
x is 3
<#elseif x == 4>
x is 4
<#else>
x is not 1 nor 2 nor 3 nor 4
< /#if>
Worth a try!

Order email not sending in magento for customer confirmation?

Order email not sending in magento for confirmation? After order not send invoice in magento to customer on email kindly help me
Go in "System > Transactional Emails" and create there the translated templates.
And Click ->Add New Template->Template Name-> Paste (Innvoice)->Template Subject Paste({{var store.getFrontendName()}}: Invoice # {{var invoice.increment_id}} for Order # {{var order.increment_id}})
->Template Content Paste
<body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
<div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
<table cellspacing="0" cellpadding="0" border="0" height="100%" width="100%">
<tr>
<td align="center" valign="top" style="padding:20px 0 20px 0">
<!-- [ header starts here] -->
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
<tr>
<td valign="top"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></td>
</tr>
<!-- [ middle starts here] -->
<tr>
<td valign="top">
<h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Hello, {{htmlescape var=$order.getCustomerName()}}</h1>
<p style="font-size:12px; line-height:16px; margin:0;">
Thank you for your order from {{var store.getFrontendName()}}.
You can check the status of your order by logging into your account.
If you have any questions about your order please contact us at {{config path='trans_email/ident_support/email'}} or call us at <span class="nobr">{{config path='general/store_information/phone'}}</span>.
</p>
</td>
</tr>
<tr>
<td>
<h2 style="font-size:18px; font-weight:normal; margin:0;">Your Invoice #{{var invoice.increment_id}} for Order #{{var order.increment_id}}</h2>
</td>
</tr>
<tr>
<td>
<table cellspacing="0" cellpadding="0" border="0" width="650">
<thead>
<tr>
<th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Billing Information:</th>
<th width="10"></th>
<th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Payment Method:</th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
{{var order.billing_address.format('html')}}
</td>
<td> </td>
<td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
{{var payment_html}}
</td>
</tr>
</tbody>
</table>
<br/>
{{depend order.getIsNotVirtual()}}
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<thead>
<tr>
<th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Shipping Information:</th>
<th width="10"></th>
<th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Shipping Method:</th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
{{var order.shipping_address.format('html')}}
</td>
<td> </td>
<td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
{{var order.shipping_description}}
</td>
</tr>
</tbody>
</table>
<br/>
{{/depend}}
{{layout area="frontend" handle="sales_email_order_invoice_items" invoice=$invoice order=$order}}
<p style="font-size:12px; margin:0 10px 10px 0;">{{var comment}}</p>
</td>
</tr>
<tr>
<td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you again, <strong>{{var store.getFrontendName()}}</strong></strong></p></center></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</body>
And ->Template Styles Paste(body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; })
Go in "System > Configuration > Sales Email" and select for each (Order, Innvoice) created Template from Transactional Email.

Resources