We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Excel with external reference

Thread ID:

Created:

Updated:

Platform:

Replies:

116036 Mar 21,2014 09:49 AM UTC Mar 26,2014 01:01 PM UTC WPF 3
loading
Tags: XlsIO
Jiri Vytasil
Asked On March 21, 2014 09:49 AM UTC

Hi,
We are using Excel export, but now we need export with possible external reference to opened Excel file.
Do you know, how to do it?

We are using Excel version 2007.

Thanks

Prasanth M [Syncfusion]
Replied On March 25, 2014 07:03 AM UTC

Hi Jiri,

Thank you for using Syncfusion products.

XlsIO supports external reference on exporting. But we are not clear with your scenario on excel export. Could you please let us know whether you are exporting to Pdf or DataTable or from grid to excel?  Also, let us know  your current and expected outputs as a screen-shot. This will be helpful in defining your requirement and provide a valid solution on that.

Please let us know if you need any clarification.

Regards,
Prasanth M.

 


Jiri Vytasil
Replied On March 25, 2014 07:32 AM UTC

Hi Prasanth,

We are exporting from grid to excel.
Now we export two excel and we can not use value of cell from first excel in second excel.
Expected is, that we can use value from first excel in second excel.
Screen-shot indicates, what we need.

Thanks

Attachment: example_a7d5e1fd.zip

Pradeepa R V [Syncfusion]
Replied On March 26, 2014 01:01 PM UTC

Hi Jiri

By default while exporting the grid control it will export the cell value, you can handle that by using the cell export event handlers as shown in the following code snippet,

grid.ExportToExcel("Sample.xls", ExcelVersion.Excel97to2003, CellExportingHandler);

In the CellExpotingHandler method you can provide necessary formula to the particular cell range to make it work.Please find the CodeSnippet for CellExportingHandler.

 private static void CellExportingHandler(object sender, ExportingToExcelEventArgs  e)

        {

            e.Range.CellStyle.Font.Size = 12;

            e.Range.CellStyle.Font.FontName = "Segoe UI";

                 //You can provide necessary formula here inorder to move to another worksheet

            e.Range.Formula = " =Sheet1!A3";

            e.Handled = true;

        }

 Please let us know if you have any concern.

 Regards

Pradeepa


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;