This is a migrated thread and some comments may be shown as answers.

Rad Chart Export

3 Answers 84 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Munish
Top achievements
Rank 1
Munish asked on 16 Jul 2012, 06:25 AM
hi Everybody,
I am exporting radgrid into pdf. But on the same time, I want to add an jpg image into same pdf, by converting into bytes. In debugging it is showing all total bytes into newarr, and even it adds same total kbs into resultset pdf file, but it does not show that additional image into result pdf file. Please do help me.

MemoryStream chartStream;// it contain image in chartStream on button click and after button click execute RadGrid1_GridExporting.
protected void RadGrid1_GridExporting(object source, GridExportingArgs e)
        {
            using (FileStream fs = File.Create(FILEPATH))
            {
                byte[] chartbytes = System.Text.Encoding.Default.GetBytes(e.ExportOutput);
                byte[] imagebytes = chartStream.ToArray();
                byte[] newarr;
                newarr = chartbytes.Concat(imagebytes).ToArray();
                fs.Write(newarr, 0, newarr.Length);
            }
        }

3 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 19 Jul 2012, 06:26 AM
Hi,

In order to achieve your goal you could check this online demo application which demonstrates similar approach.

Greetings,
Andrey
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Munish
Top achievements
Rank 1
answered on 19 Jul 2012, 07:17 AM
Hi Andrey,
Thanks for this. I have already gone through with this example, but in this image is in the same radgrid control. I have two different control and both are not in each other.

Thanks
Munish
0
Daniel
Telerik team
answered on 24 Jul 2012, 08:45 AM
Hi Munish,

It is not possible to just concatenate the image binary to the PDF binary. Use this approach if you need to export RadChart to PDF.

Regards,
Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
General Discussions
Asked by
Munish
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Munish
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or