店舗グループの営業レポートのデータを取得するクエリがあります。ループとアタッチメントを使用するCFMAIL
各店舗の月間売上高のPDFを作成して、販売マネージャーにその店舗のレポートのみを電子メールで送信する必要があります。
PDFパーツを作成するとうまくいきます。各店舗ごとに個別のレポートを作成します。
レポートを電子メールで送信しようとすると、すべての販売担当者のレポートではなく、レコードごとに1つのレポートが送信されます。 EX:店舗1のレポートに4人がいる場合、営業マネージャーは1つのレポートではなく4つのレポートを取得します。ここで
は私のコードです:PDFに
<cfoutput query="data" group="site_name">
<cfdocument format="pdf" overwrite="yes" fontembed="yes"
pagetype="Letter"
filename="xxxxxxxxxxxxxxxsite_name#.pdf" margintop="0.25"
marginbottom="0.25" marginleft="0.25" marginright="0.25"
backgroundvisible="yes">
<table width="100%" align="center" border="1" cellpadding="5"
cellspacing="0">
<tr bgcolor="##e1e8f7">
<td colspan="8" align="center">Sales Report -#today#-#site_name#</td>
</tr>
<tr align="center">
<td>Sales Person</td>
<td>Total Sales</td>
</tr>
<cfoutput>
<tr>
<td>#firstName# #lastName#</td>
<td>#totalSales#</td>
</tr>
</cfoutput>
</table>
</cfdocument>
</cfoutput>
を作成CFMAIL
<cfmail query="data" to="#salesmanageremail#" subject="monthly sales
report"
type="html">
<style type="text/css">
body { font-size: 12px; font-family: Arial; }
</style>
<body>
Report attached.
</body>
<cfsilent>
<cfmailparam file="xxxxxxxxxxxxxxxsite_name#.pdf">
</cfsilent>
</cfmail>
どのように私は、各営業部長へのデータのすべてを含む店舗あたり1つのレポートを電子メールで送信しますか?
ありがとう、私は後者の提案を試してみます –
それはうまくいきました。ありがとう –