Products | Versions |
---|---|
Spotfire Web Player | All Versions |
The custom export tool in Web Player is executed on the Web Player server and thus the files are generated in Web Player Server. To provide the ability for the users to download these files you can do one of the following,
protected override IEnumerable<object> ExecuteCore(Document document, ExportResult result) { ExportResultPart resultPart = result.AddPart(text + ".txt", new ContentType("text/plain")); using (StreamWriter writer = new StreamWriter(resultPart.GetStream())) { writer.WriteLine("Hello"); writer.WriteLine("World!"); } }
public class SampleTool : CustomTool<Document>{ protected override IEnumerable<object> ExecuteCore(Document document) { string varurl = "http://google.com"; Page activePage = document.ActivePageReference; bool exists = false; foreach (Visual viz in activePage.Visuals) { if (viz.Title.Equals("Link to download")) { viz.As<HtmlTextArea>().HtmlContent = "<a href = \"" + varurl + "\">Click to open link" + "</a>"; } } if (!exists) { Visual dynamic = activePage.Visuals.AddNew(VisualTypeIdentifiers.HtmlTextArea); dynamic.Title = "Link to download"; dynamic.As<HtmlTextArea>().HtmlContent = "<a href = \"" + varurl + "\">Click to open link" + "</a>"; } } }