Pergunta

Is it possible to use xml and html to create a chart or graph to include in an email notification from MSSQL Server?

Has anyone done this before? Any suggestions?

For example: A chart visually representing the amount of receiving hours required in the warehouse for the next couple weeks.

Foi útil?

Solução

It can be tedious but this method works:

  • Export the data from T-SQL (probably as a JSON) or directly use the database from .Net application.

  • Now create a word template with some graphs (Line/Bar/Pie Chart or whatever) and bookmark it with some name 'my_chart'

  • Now include Microsoft.Office.Interop.Word & Microsoft.Office.Interop.Excel references in your C# project. (Google it & see this also)

  • Now in your C# project access those Graphs in word file using bookmark name & populate it with Data from database. (See this)

It may take some time but if your requirement is worth it you can do this. Also you don't need to study C#(it's very similar to Java) for this, just see interop C# syntax as you keep going BUT if you want see C# documentation for any reference.

Refer this tutorial also.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top