Rad Chart Export

4 posts, 0 answers
  1. Munish
    Munish avatar
    13 posts
    Member since:
    Jul 2012

    Posted 16 Jul 2012 Link to this post

    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);
                }
            }
  2. Andrey
    Admin
    Andrey avatar
    836 posts

    Posted 19 Jul 2012 Link to this post

    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.
  3. Munish
    Munish avatar
    13 posts
    Member since:
    Jul 2012

    Posted 19 Jul 2012 Link to this post

    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
  4. Daniel
    Admin
    Daniel avatar
    4949 posts

    Posted 24 Jul 2012 Link to this post

    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.
Back to Top