0

i have been using Pechkin (wkhtml wrapper for c#) to create pdf reports in my project and its working fine except i cant render any ajax chart(pie, bar, bubble or anything) in my created pdf, i have also tried rederdelay property but it didnt help me a bit.

the text data comes but the chart doesnt and the whole thing mess up. So i deduced that the problem is because created charts are not using standard html for the wrapper to handle, so in conclusion i need something which can convert these chart to images before html render on fly and it should be OpenSource/free.

thanks Alok

P.S. I am using ajax control toolkit charts, pechkin is latest install from nuGet.

Alok
  • 808
  • 13
  • 40

1 Answers1

0

convert the chart into image and use this function to convert into byte array

 private Byte[] Chart()
 {
   using (var chartimage = new MemoryStream())
   {
      chart.SaveImage(chartimage, ChartImageFormat.Png);
      return chartimage.GetBuffer();
   }
 }

then create image from those byte[]

 var image = Image.GetInstance(Chart());
 image.ScalePercent(75f);

add this image in the document

Shafqat Masood
  • 2,532
  • 1
  • 17
  • 23
  • sorry i didnt get it , you do know that i am using ajax extender toolkit charts. – Alok May 05 '13 at 17:14
  • keyword chart of chart.SaveImage is not recognized in my code or maybe you are using data charts not ajax charts.Period. – Alok May 05 '13 at 18:12