In order to survive the mime type check we need to declare the correct mime type, and have an API method for that on CustomVisualView<T> called ResolveContentType as is documented here:
https://docs.tibco.com/pub/doc_remote/sfire_dev/area/doc/api/TIB_sfire-analyst_api/html/M_Spotfire_Dxp_Application_Extension_CustomVisualView_1_ResolveContentType.htmWith respect to the SDK example CustomVisualsExample.CustomDonutChart, the problem is in the override for GetResourceCore in CustomDonutChartView.cs. Code in the API example follows.
=======================================================================
protected override HttpContent GetResourceCore(string path, NameValueCollection query, CustomDonutChart snapshotNode)
{
if (string.IsNullOrEmpty(path))
{
path = "CustomDonutChart.html";
}
var bytes = GetEmbeddedResource("SpotfireDeveloper.CustomVisualsExample.webroot." + path);
return new HttpContent("text/html", bytes);
}
=======================================================================
It needs to be modified to :
=======================================================================
protected override HttpContent GetResourceCore(string path, NameValueCollection query, CustomDonutChart snapshotNode)
{
if (string.IsNullOrEmpty(path))
{
path = "CustomDonutChart.html";
}
var bytes = GetEmbeddedResource("SpotfireDeveloper.CustomVisualsExample.webroot." + path);
var mimeType = ResolveContentType("SpotfireDeveloper.CustomVisualsExample.webroot." + path);
return new HttpContent(mimeType, bytes);
}
=======================================================================