File not displaying struture

User 82b20b535e

06-02-2015 19:30:37

Hi,


I exported a structure to the excel file and excel file is not displaying the structure date. Cell displays it has name.


When I select the cell formula displayed  as  =JChemExcel.Functions.JCSYSStructure("B17C329F7FB9CCD379FD7CBB5D6AAA8D")


 


I am using Excel 2010. 


JChem For Excel version is 6.1.2. Excel has JChem Addins enabled. 


I am also attaching the excel file if you want to review.

ChemAxon bd13b5bd77

09-02-2015 08:17:12

Hi did you export it?


Just because I checked the document and the input string of the local database does not seem to be good.


Viktor

User 82b20b535e

09-02-2015 13:32:24

Hi Viktor,


there is a legacy VB.NET application. I had the request to export the structures from the VB.NET application.


Using the below code the structure was exported to Excel file. OpenXMLApi from the library ChemAxon.JChemExcel.OpenXml was used to export.


OpenXmlApi.AddStructure(filePath, SHEET_NAME, 1, 1, dtLocal.Rows[rowIndex]["CD_STRUCTURE"].ToString() + "", "mol", "Structure");


Its a Visual Studio 2010 targeting .NET Framework 3.5 and above


If I am doing wrong please guide me to ?


Thanks

ChemAxon bd13b5bd77

09-02-2015 13:52:40

Hi Dhananjaya,


 


what you are currently doing is good. The OpenXML API is the best interface you can use from .NET application.


http://www.chemaxon.com/jchem4excel/developerguide/io_api.html =>; however this is a newer version, later on if you have time please take a look at it.


 


Back to your problems:


OpenXmlApi.AddStructure(filePath, SHEET_NAME, 1, 1, dtLocal.Rows[rowIndex]["CD_STRUCTURE"].ToString() + "", "mol", "Structure");


dtLocal.Rows[rowIndex]["CD_STRUCTURE"] : this data table cell contains a Marvin (mrv) format.


however you set "mol", which means that if you explicitly added a molecule format you need to add that type as a molecule stream.


So please change the "mol" to "mrv". Maybe this is the easiest fix for you now. The other option is to change the stream to MOL but it would mean loss of chemical features that the mol does not support.


 


Viktor

User 82b20b535e

09-02-2015 14:20:53

Hi Victor,


Thanks for helping me. It worked. I am not sure how to mark this as an answer.


Thanks again for such a  quick response..

ChemAxon bd13b5bd77

09-02-2015 14:30:54

Thank you, great news.


Anyway I repaired your test.xlsx to be example for others.