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

[Solved] Export to excel with hyperlink

3 Answers 272 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Legalia
Top achievements
Rank 1
Legalia asked on 23 Apr 2009, 02:28 PM
Hi..
i have a column with hyperlink. i am exporting the grid in excel file.
i have set "ExportOnlyData = true" so it will not display data with hyperlink.
so to overcome from the problme i created on more column with same data without hyperlink.
initially i am setting it visible=false and while exporting i am setting it visible = true.
but it is not displaying the column in exported excel file.

code on export button click :
    protected void btnExport_Click(object sender, System.EventArgs e) 
    { 
        dg.MasterTableView.Columns.FindByUniqueName("Delete").Visible = false
        dg.Columns.FindByUniqueName("clName").Visible = false
        dg.Columns.FindByUniqueName("clNamePrint").Visible = true
 
        foreach (GridItem commandItem in this.dg.MasterTableView.GetItems(GridItemType.FilteringItem)) 
        { 
            commandItem.Visible = false
        } 
 
        dg.ExportSettings.FileName = Page.Title; 
        dg.ExportSettings.OpenInNewWindow = true
        dg.ExportSettings.ExportOnlyData = true
        dg.MasterTableView.ExportToExcel(); 
         
    } 


i have used custom paging in the grid.

this solution works fine with one gird in which custom paging is not used.

Thanks,

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 23 Apr 2009, 03:26 PM
Hello Legalia,

I'm not sure what is the connection between the export and custom paging in this case. Could you please provide a sample project so we can debug your code locally?

Best regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Legalia
Top achievements
Rank 1
answered on 24 Apr 2009, 04:45 AM
Hi..
Actually i am not getting connection between export and Custom paging.
actually in one grid it is working fine. and in other it is creating problem.
i just got difference is that in on custom paging is used and in other simple paging is used.

ok fine..
I am generating support ticket to attach files...
0
Accepted
Daniel
Telerik team
answered on 27 Apr 2009, 05:07 PM
Hello Legalia,

Please test the attached example which is based on your code.

Best regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Legalia
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Legalia
Top achievements
Rank 1
Share this question
or