I know rad chart doesn't provide any in-built way of exporting the rad chart to xls/pdf/doc formats. I was just wondering if there is any round about way of doing it?
thanks,
PM
3 Answers, 1 is accepted
0
Ves
Telerik team
answered on 18 Jan 2008, 08:18 AM
Hello Puneet,
You can use RadChart.Save() method to save the chart to an image or a memory stream. Then you can use it in any custom scenario.
The problem with Rad Chart is you cannot print it into PDF directly.
Now, solution depends upon the third party tool or dll you use to make a PDF.
Since Rad chart is basically image being shown after rendering, you have to call the image using e.g. <asp:image runat="server" id="imgTest" ImageURL="Test.aspx" />.
Now in Test.aspx:
public void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
MemoryStream imageStream = drawChart();
Byte[] imageContent = new Byte[imageStream.Length];
private MemoryStream drawChart()
{
RadChart chart = new RadChart();
// Do the necessary coding in order to generate the chart.
//If more than one chart is being used call the same page with necessary inputs to generate a new image.
MemoryStream mStream = new MemoryStream();
chart.Save(mStream, ImageFormat.Jpeg);
return mStream;
}
I think it will solve the problem...if authentication issues doesn't arise.
0
Ves
Telerik team
answered on 27 Oct 2009, 08:19 AM
Hi Abhay Das,
Thanks for sharing this. I am sure it will prove handy for our community members. I have updated your Telerik points.