Use cell values as a custom Excel file property

Hi,

I am trying to create custom document properties linked to the content of named cell but when saving the file it only creates the custom property.

this is my code:

public static void LinkCellToContent(string filePath)
        {
            ExcelEngine excelEngine = new ExcelEngine();
            IApplication application = excelEngine.Excel;
            application.DefaultVersion = ExcelVersion.Excel2013;
            FileStream inputStream = new FileStream(filePath, FileMode.Open);
            IWorkbook workbook = application.Workbooks.Open(inputStream, ExcelVersion.Xlsx);

            workbook.CustomDocumentProperties["lugar"].Value = "";
            workbook.CustomDocumentProperties["lugar"].LinkSource = "=$Ciudad"; //I don't know how to link to the named cell
            workbook.CustomDocumentProperties["lugar"].LinkToContent = true;
            
            inputStream.Close();
            FileStream outputStream = new FileStream("metadato.xlsx", FileMode.Create);
            workbook.SaveAs(outputStream);
            workbook.Close();
            outputStream.Position = 0;
            outputStream.Close();
            Console.WriteLine("SUCCESS");

        }

This is the named cell:



Result:




Expected result:



how can i use cell value ​​as custom document property using XlsIo?



6 Replies 1 reply marked as answer

KK Konduru Keerthi Konduru Ravichandra Raju Syncfusion Team August 6, 2021 08:38 AM UTC

Hi Andres, 

Greetings from Syncfusion. 

We are able to reproduce the reported issue our end and validating it currently. We will share the validation details in 2 business days, on August 10th,2021. 

Regards, 
Keerthi. 



KK Konduru Keerthi Konduru Ravichandra Raju Syncfusion Team August 10, 2021 01:29 PM UTC

Hi Andres, 

We appreciate your patience. 

We have confirmed the issue as Link to content option in custom properties is not working properly and logged a defect report. We will provide the patch for this issue on August 24th,2021. You can track the status of defect report through following feedback link. 


Regards, 
Keerthi. 



KK Konduru Keerthi Konduru Ravichandra Raju Syncfusion Team August 24, 2021 03:29 PM UTC

Hi Andres, 

We deeply regret for the inconvenience. 

We have fixed the issue and the fix is under testing. We request you 3 more days timeline to provide the patch. We will provide the patch on August 27th,2021. 

We appreciate your patience. 

Regards, 
Keerthi. 



KK Konduru Keerthi Konduru Ravichandra Raju Syncfusion Team August 25, 2021 01:41 PM UTC

Hi Andres, 
 
We appreciate your patience. 
 
We have fixed the issue Link to content option in custom properties is not working properly and generated patch in the version v19.2.0.44. The patch with fix to resolve the reported issue can be downloaded from the following link.  
 
 
Recommended approach - exe will perform automatic configuration       
   
Please find the patch setup from below location: 
       
Advanced approach – use only if you have specific needs and can directly replace existing assemblies for your build environment       
   
Please find the patch assemblies alone from below location:       
 
 
Assembly Version: 19.2.0.44 
 
Installation Directions :        
This patch should replace the files “Syncfusion.XlsIO.Base.dll” under the following folder.       
$system drive:\ Files\Syncfusion\Essential Studio\$Version # \precompiledassemblies\$Version#\4.6       
Eg : $system drive:\Program Files\Syncfusion\Essential Studio\19.2.0.44\precompiledassemblies\19.2.0.44\4.6    
       
To automatically run the Assembly Manager, please check the Run assembly manager checkbox option while installing the patch. If this option is unchecked, the patch will replace the assemblies in precompiled assemblies’ folder only. Then, you will have to manually copy and paste them to the preferred location or you will have to run the Syncfusion Assembly Manager application (available from the Syncfusion Dashboard, installed as a shortcut in the Application menu) to re-install assemblies.       
       
Note :        
You can change how you receive bug fixes by navigating to the following link and updating your preferences.        
    
Disclaimer :   
Please note that we have created this patch for version 19.2.0.44 specifically to resolve the issues reported in forum 167885.      
              
If you have received other patches for the same version for other products, please apply all patches in the order received.       
      
This fix will be included in our release version 19.3 which will be rolled out by end of October 2021.   
 
Regards,     
Keerthi. 


Marked as answer

AM Andres Montoya August 25, 2021 09:16 PM UTC

Hi,


thanks for the reply


I already installed the patch but it just takes the cell value and puts it in the document property value, it does not link to the content




this is my code:





MC Mohan Chandran Syncfusion Team August 26, 2021 07:12 AM UTC

Hi Andres, 

We have prepared a sample to set the Link To Content properly which can be downloaded from the following link. 


Also, we request you to not set the Value property directly while creating with Link to Source. 

Regards, 
Mohan. 


Loader.
Up arrow icon