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. Image for the cookie policy date
close icon

Excel with external reference

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

3 Replies

PM Prasanth M Syncfusion Team 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.

 



JV Jiri Vytasil 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


PR Pradeepa R V Syncfusion Team 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


Loader.
Live Chat Icon For mobile
Up arrow icon