spotfire - 在 spotfire dxp 的 URL 中插入 Document 属性
问题描述
我有一个 URL,其中某些属性可以更改,并且在浏览器中执行 URL 时将提取相应的数据。URL 的大致内容是这样的:
https://server/App/Detect.do?dm=Rel&daysBack=60&toolId= ETX500 &chamberId= PM5 &senSorName= Lower_Middle_Temperature_Mean &stepId= POLY &module=&fdcApplication=&contextGroup=&sampleSize=25&recentLots=&dateLotWafer=true&_dateLotWafer=on&chartIndex=0&groupTBy=UserTag&priorByKeyGroupBysUser= _NA_&trendStyle=平均值&xAxis=DateLotWafer&title=Fdc%20Trend%20Analysis
粗体部分是可以动态变化的部分。我在 spotfire (dcube) 中有一个表,其中toolId
包含chamberId
、senSorName
和stepId
. 我已将其设置为当用户单击一行时,它将这些属性捕获到 4 个文档属性。我使用文本区域提供链接,但有没有办法控制链接的 URL,以便我可以在 URL 的这 4 个位置插入文档属性?
任何见解都会有所帮助。谢谢你
解决方案
您可以使用 Python 脚本来更新文本区域中的 HTML。使用脚本中的文档属性,您可以构建所需的链接。由于文档属性在标记上更新,因此您可以将其添加到文档属性中,以便在它们更改时更新 url。
from Spotfire.Dxp.Application.Visuals import HtmlTextArea
#Set vis as script parameter to a text area visual
vis = vis.As[HtmlTextArea]()
def UpdateUrl():
attr1 = Document.Properties['DocProp1']
attr2 = Document.Properties['DocProp2']
url = "http://www.google.com?ID={}&SaleID={}".format(attr1,attr2)
htmlText = '''<a href="{}" target="_blank">Click Here</a>'''.format(url)
vis.HtmlContent = htmlText # can use vis.HtmlContent += to append instead of replace
UpdateUrl()
推荐阅读
- asp.net-mvc - 在 ASP.NET MVC 项目中是否有办法在播种机数据 URL 图像的主页中创建轮播?
- php - 搜索栏应该忽略“-”、大写字母和空格(132D123 和 132 d 123 应该返回 true)?php
- c# - 从另一个word文档复制的图片是空的
- javascript - 检索所有值作为firebase中键上的数组以进行本机反应
- docker - 运行 Hasura 控制台无法从 docker 运行
- influxdb - redhat 8 包 influxdb arm64 没有兼容架构
- javascript - 填写表格并将其呈现给客户
- javascript - 测试我的端点时不断收到错误
- javascript - 如何让 php 从 mysql 的列中获取最后一行,并使结果成为我可以使用 javascript 获取的变量?
- python - 用coolprop获取图中每一行的值