我正在根据数据在SQL中创建超链接。我需要从代码通过电子邮件发送的表格中显示超链接(Google图表)中的图像,但是我只能获取超链接。我在做什么错了?
我已经可以在表格外执行此操作,但是我无法弄清楚如何使图像显示在表格单元格而不是超链接中。
SET @tableHTMLB =
N' <H3>Details</H3>' +
N'<table border="2">' +
N'<tr><th>ID</th>' +
N'<th>Orders </th>'+
N'<th>Orders Chart</th>'+
N'<th>Delivery </th>' +
N'<th>Pickup </th> ' +
N'<th>On Time </th> ' +
'</tr><style>td{text-align:center}</style>' +
CAST ( ( SELECT td = ID , ' ',
td = REPLACE(Orders,'.00',''), ' ',
td = N'<img src="http://chart.apis.google.com/chart?'+
'&chbh=35,5,35&'+
'cht=ls&'+
'chs=500x200&'+
'chbh=a&'+
'chxt=x,y&'+ 'chm=N,000000,0,-1,10|N,000000,1,-1,10|N,000000,2,-1,10|N,000000,3,-1,10|N,0000
00,4,-1,10&'+
'chco=f05624,C6D9FD&'+
'chd=t:'+CAST(LEFT(ROUND(cast((@Orders) as decimal(5,2)),2,2),5) as varchar(6)) +
'&chd=t:' + CAST(LEFT(ROUND(cast((@Orders) as decimal(5,2)),2,2),5) as varchar(6)) +
'chma=0,0,0,0'+
' " alt="" border=3 height=100 width=100></img>' , ' ',
td = Round(Delivery,2,2), ' ',
td = Round(Pickup,2,2), ' ',
td = Round(OnTime,2,2), ' '
FROM @EmailGroup WHERE [Email] = @Email
FOR XML PATH('tr'), TYPE
) AS NVARCHAR(MAX) ) +
N'</table></style>' ;
结果应该是一个包含值的表格和基于这些值的结果图表。