0

I have a requirement to generate PDF for a donut chart in MVC. I am able to implement it from UI as given in demo but the requirement is that I need to create chart and then to PDF all in backend with no UI. So from backend I need to fetch data from database, generate chart in backend itself, convert to pdf and then send email as attachment. So I got the part to convert to pdf but not how to generate chart in backend.

Avinash Kumar
  • 167
  • 2
  • 12
  • I can't understand what you are using nor if any error is happening from the reported elements, maybe you can try to be more precise and also check this regarding how to provide code examples https://stackoverflow.com/help/minimal-reproducible-example – A. Lion Jan 03 '20 at 11:10
  • @P.Lion I want to generate donut in backend itself and then to pdf without any display to UI. – Avinash Kumar Jan 03 '20 at 11:22
  • What is backend? Server side ASPX, a service, a console executable... Indeed to use an UI component without UI you need a kind of wrapper. For example webbrowser component, I used it in a project within an executable desktop application that run on a server to perform a search on google and extract page body content. https://social.msdn.microsoft.com/Forums/en-US/340f4e58-4124-414d-8afa-0ada428e755e/webbrowser-control-get-complete-rendered-webpage-with-java-script?forum=vbgeneral – A. Lion Jan 03 '20 at 11:34
  • @P.Lion I am using MVC Web API. I did find an example to generate pdf but not a simple code - https://demos.telerik.com/aspnet-mvc/pdfprocessing/bar-chart-export – Avinash Kumar Jan 03 '20 at 11:43
  • Have you tried just hiding the chart with css? – MentallyRecursive Jan 03 '20 at 20:27
  • @MentallyRecursive - It is like a report for different users so hiding the chart will not help – Avinash Kumar Jan 06 '20 at 07:18

0 Answers0