Pdf export BUG

3 posts, 0 answers
  1. Pierre
    Pierre avatar
    56 posts
    Member since:
    Jun 2016

    Posted 03 Nov Link to this post

    Hi,

    I have encounter a new bug with my export pdf.
    It was working in 2016 R2 SP1. I was in 2016 R3 when we discovert it first and upgrading to SP1 and SP2 didn't fix it.

    So i have a function in code behind that process a predefined telerik report and send it via 'Response'.

    protected void ExportButton(object sender, EventArgs e)
     {
        // [...] HiddenCode [...]
     
        ReportProcessor reportProcessor = new ReportProcessor();
        Telerik.Reporting.InstanceReportSource instanceReportSource = new Telerik.Reporting.InstanceReportSource();
        instanceReportSource.ReportDocument = rpt;
        RenderingResult result = reportProcessor.RenderReport("PDF", instanceReportSource, null);
        string fileName = doc + "." + result.Extension;
        Response.Clear();
        Response.ContentType = result.MimeType;
        Response.Cache.SetCacheability(HttpCacheability.Private);
        Response.Expires = -1;
        Response.Buffer = true;
        Response.AddHeader("Content-Disposition"
                                , string.Format("{0};FileName=\"{1}\""
                                                , "attachment"
                                                , fileName)     );
        Response.BinaryWrite(result.DocumentBytes);
        Response.End();
    }

     

    If i have a RadButton outside of the grid calling this it works. When the button is in the CommandItemTemplate I get Nothing.
    Or i get just some server lag.. sometimes a js unnamed error. and that on every Browser.

  2. Pierre
    Pierre avatar
    56 posts
    Member since:
    Jun 2016

    Posted 14 Nov Link to this post

    A simple we can not reproduce your issue would have been great.
    Instead of just ignoring it.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Stef
    Admin
    Stef avatar
    3047 posts

    Posted 14 Nov Link to this post

    Hi Pierre,

    I guess this is an AJAX issue. The documents bytes should be returned via postback. Callbacks will not let you download the attachment at the client without refreshing the whole page.
    Instead you can try returning an anchor tag - link, to the file in the server.

    If it is an emergency, please use the support ticketing system. Replies by Telerik representatives in forums, in a timely manner are not guaranteed.
    Thank you for your understanding.

    Regards,
    Stef
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top