I just upgraded to 14.1 and my Workbook.Save call no longer works. Prior to this version I was using 13.1 and all I had to pass to the save method was the file name. In 14.1 I need to pass the file name as well as WorkbookSaveOptions. Not sure why this was changed but what exactly do I need to pass?
Hi,
Thank you for contacting Infragistics Developer Support.
While the Save method of the Infragistics.Excel.Workbook class was changed to accept WorbookSaveOptions, this parameter is optional. These means that you can still use it passing only a string and it will use the Default save options, so this can’t cause issues when upgrading. This was added to give more flexibility to this method. For more information on the method please visit this link:
http://help.infragistics.com/Doc/WinForms/2014.1/CLR4.0/?page=Infragistics4.Documents.Excel.v14.1~Infragistics.Documents.Excel.Workbook~Save(String,WorkbookSaveOptions).html
Please let me know if you have any additional questions.
My code no longer compiles with 14.1. I do not see the method listed with just the file name as a parameter. I do see the second parameter as optional but you need to pass a null. This requires me to change my code everywhere I am using this method...unless I am missing something.
Thanks for the info.
Hi Roger,
Thank you for the reply.
Infragistics for Windows Forms officially supports only C# and VB.NET. For more information on our supported environments please follow this link:
http://es.infragistics.com/help/supported-environments/
Our products are tested only for VB and C# languages and the added optional parameter still allows to compile the code passing only a single string to the Save method. I am not familiar with OpenEdge and I don’t know whether or not it has optional parameter support. Either way if the code doesn’t compile without the optional parameters you should add it yourself.
I tried adding a reference to Infragistics.Documents.Core but it did not help.
We are developing in OpenEdge (from Progress Software) and the following method is used to save the workbook. It no longer works.
METHOD PUBLIC STATIC VOID SaveWorkbook( ipoWorkbook AS Workbook, ipcFileName AS CHARACTER ): ipoWorkbook:Save(ipcFileName). RETURN.
END METHOD.
I modified the SaveWorkbook method to the following and it now works.
METHOD PUBLIC STATIC VOID SaveWorkbook( ipoWorkbook AS Workbook, ipcFileName AS CHARACTER ): DEFINE VARIABLE oSaveOptions AS CLASS Infragistics.Documents.Excel.WorkbookSaveOptions NO-UNDO. ipoWorkbook:Save(ipcFileName,oSaveOptions). RETURN.
What might be causing the issue is that now the Infragistics.Documents.Excel library is split into Infragistics.Documents.Excel and Infragistics.Documents.Core. So you need to add reference to the Infragistics.Documents.Core assembly. You can read more on this if you follow this link:
http://help.infragistics.com/Doc/WinForms/2013.2/CLR4.0/?page=Win_Breaking_Changes_in_2013_Volume_2.html
If that’s not the case, can you please provide me with a sample which demonstrates this issue?
The optional parameters can be skipped, so they shouldn’t break your code and passing just a string to the Workbook.Save method is entirely valid syntax even in 14.1. Here is the documentation for Optional parameters for VB and C#, which confirms you can choose whether or not to supply the argument and that you don’t need to pass null.
http://msdn.microsoft.com/en-us/library/f25e2b6b.aspx
http://msdn.microsoft.com/en-us/library/dd264739.aspx
I am looking forward to your reply.