Telerik multi page , multi tab grid item export to excel issue

4 posts, 0 answers
  1. Surya
    Surya avatar
    2 posts
    Member since:
    Jul 2018

    Posted 11 Jul 2018 Link to this post

    Need Help with TELERIK radgrid export to excel issue. Anyone who can help with the below mentioned issue please reply. 

    So In the application we are using Telerik radGrid to display data table in a dynamic grid view. We are trying to export radgrid item to the excel sheet. 
    the below mentioned code snippet is working fine when the function is getting call from a single web page. 



    protected void RadCxtMenu_ItemClick(object sender, Telerik.Web.UI.RadMenuEventArgs e)
    {

    if (e.Item.Text == "Export to Word")
    {


    radGridItem.ExportSettings.ExportOnlyData = true;
    radGridItem.ExportSettings.IgnorePaging = true;
    radGridItem.ExportSettings.OpenInNewWindow = true;
    radGridItem.MasterTableView.ExportToWord();

    }
    else if (e.Item.Text == "Export to Excel")
    {

    ExportClick();
    radGridItem.ExportSettings.ExportOnlyData = true;
    radGridItem.ExportSettings.IgnorePaging = true;
    radGridItem.ExportSettings.OpenInNewWindow = true;
    radGridItem.MasterTableView.ExportToExcel();



    }

    but the above code is not working when it is reffered from a rad multi page and rad tab.
    The issue that we are facing is, the parent page where the rad multi page redirection is used to redirect to a different page where the grid view is used to display the data .we could not download the data to a excel file with the export to excel rad manu item click. The popup which should be displayed in the browser for the user to select and save the excel file is not getting displayed and the excel can not be saved. We are not sure if this is a telerik related constrain can any one advise. the code snippet or the rad multi page is given below.


    protected System.Web.UI.WebControls.Label lblPageHeader;
    protected Telerik.Web.UI.RadTabStrip uwtConsolidation;
    protected Telerik.Web.UI.RadMultiPage RadMultiPage1;
    public const string SELECTED_CONSOLIDATION_TAB = "SelectedConsolidationTab";
    public static readonly string QUERY_FLAG = "FLAG";
    public static readonly string QUERY_SERVICE ="NodeType";


    if (!Page.IsPostBack)
    {
    RadPageView ConsolidatedEquipmentItemTab = new RadPageView();
    RadPageView PlantHistoryTab = new RadPageView();
    RadPageView IssueRegisterTab = new RadPageView();
    ConsolidatedEquipmentItemTab.ContentUrl = "ConsolidatedEquipmentItem.aspx";
    PlantHistoryTab.ContentUrl = "PlantHistory.aspx";
    IssueRegisterTab.ContentUrl = "IssueRegister.aspx"; // This is the page that contains the grid where export is not working
    //ConsolidatedEquipmentItemTab.Selected = true;

    RadMultiPage1.PageViews.Add(ConsolidatedEquipmentItemTab);
    RadMultiPage1.PageViews.Add(PlantHistoryTab);
    RadMultiPage1.PageViews.Add(IssueRegisterTab);



    switch (selectedTab)
    {

    case 0: ConsolidatedEquipmentItemTab.Selected = true; break;
    case 1: PlantHistoryTab.Selected = true; break;
    case 2: IssueRegisterTab.Selected = true; break;
    default: ConsolidatedEquipmentItemTab.Selected = true; break;


    }
    }

    if (Session[SELECTED_CONSOLIDATION_TAB] != null)
    uwtConsolidation.SelectedIndex = selectedTab;


    }

    Please advise. We appreciate your help.
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    5440 posts

    Posted 16 Jul 2018 Link to this post

    Hello Surya,

     

    The most likely reason for such behavior is additional logic on the page that breaks when it is placed in an <iframe>, which is what pointing the ContentUrl of the page view to it does. For example, AJAX may be added to the page, or JS errors may be thrown by some code that breaks the client-side functionality that raises the postback.

    I am attaching below a small example that works fine on my end and I suggest you compare against it to find the reason for the issue. If this does not help, I encourage you to open a support ticket and send us a modified version of this sample that showcases you particular scenario and issue.

     

    Regards,
    Marin Bratanov
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Surya
    Surya avatar
    2 posts
    Member since:
    Jul 2018

    Posted 18 Jul 2018 in reply to Marin Bratanov Link to this post

    Hi Marin Bratanov,

    We tried your code but still the function is not working and no pop up to save and download the file in excel format is showing. We are using telerik version 1.0 . Can you suggest any other options or solution that may be helpfull? thanks for your help

     

    thanks and Regards,

    Surya jyoti Dutta

  4. Marin Bratanov
    Admin
    Marin Bratanov avatar
    5440 posts

    Posted 18 Jul 2018 Link to this post

    Hello Surya,

    Could you provide some more details on the version of our controls you are using? The standard numbering we use is YYYY.Q.MDD which is something like 2018.2.710 for the second release of 2018 that was built on the 10th of July. With this in mind, version 1.0 would not be the version of our controls.

    I also advise that you try sending another file to the user in the same context (in the iframe) to see if this works as expected. If not, the issue would definitely be with the way the browser handles this. Perhaps a browser extension, a firewall or antivirus software may be blocking the download. So, you can try this in a different browser, on a different machine or in a different environment to see whetherthis is the case.

    Since this issue is quite peculiar, I suggest you open a ticket where you can send us the actual repro, with the Telerik assemblies you are using, and with a video of what you see. Adding a FiddlerCap of the network traffic would also help.


    Regards,
    Marin Bratanov
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top