[Advanced excel] getting length cannot be less than zero error

Hi All

I am facing an issue in the Advanced excel component in one action called Workbook_GetBinaryData which is used to convert workbook object to binary. "Length cannot be less than zero Parameter name: Length".

It was working as expected for small excel with some 10 data. When I tried it with 10000 data I got this error. Is there any solution for this?

Please find the attached screenshot



Hi Prathoswar,

Any reason for not using the Binary returned by the "Content" parameter of the Upload Widget?

Best Regards,

Aureliano Pinheiro

Hi Aureliano Pinheiro,

I need to modify the excel file as I need to insert a header row and some customization using advanced excel actions. After all modifications, I need to get the updated binary file for further processing. So I am using this action which will convert workbook object to binary.

This was occasionally happening and sometimes, it was not throwing this error.

I had attached the log 

Thank you

Length cannot be less than zero.
Parameter name: length
   at ssOrganizationCertificationScope_CS.RssExtensionAdvanced_Excel.MssWorkbook_GetBinaryData(HeContext heContext, Object inParamWorkbook, Byte[]& outParamBinaryData)
   at ssOrganizationCertificationScope_CS.Actions.ActionInsertHeaderRowinRegSheet(HeContext heContext, Byte[] inParamGMRFile, Int32 inParamIndex, Byte[]& outParamUpdateGmr)
   at ssOrganizationCertificationScope_CS.Actions.ActionReadRegistrationSheet(HeContext heContext, Byte[] inParamGMRFile, Byte[]& outParamUpdateGmrFile, RLGMR_FarmList& outParamFarmInformation, RLGMR_FarmList& outParamFarmInfoForValidation)
   at ssOrganizationCertificationScope_CS.Actions.ActionGMRTemp(HeContext heContext, Int64 inParamLicenseId, Int64 inParamChId, RLErrorForCorrectionList inParamErrorCorrectionList)
   at ssOrganizationCertificationScope_CS.Actions.ActionUploadGmr(HeContext heContext, String inParamFileName, Byte[] inParamFileContent, Int64 inParamLicenseId, String inParamFileContentType, RLErrorForCorrectionList inParamErrorList, String& outParamResponse)
   at ssCertificateHolder_GMR.RsseSpaceOrganizationCertificationScope_CS.MssUploadGmr2(HeContext heContext, String inParamFileName, Byte[] inParamFileContent, Int64 inParamLicenseId, String inParamFileContentType, RecordList inParamErrorList, String& outParamResponse)
   at ssCertificateHolder_GMR.Actions.ActionUploadGmrFile(HeContext heContext, RLErrorList inParamCorrectedErrorList, Byte[] inParamBinaryData, String inParamFileName, Int64 inParamLicenseId, Boolean& outParamisUploaded)
   at ssCertificateHolder_GMR.ScreenServices.CertificateHolder_GMR_GMRComponents_GMR_UploadFile_Controller.<ActionUploadGmrFile>b__3(HeContext heContext, String screenName, JObject screenModel, JObject inputParameters, JObject clientVariables)
   at OutSystems.RESTService.Controllers.ScreenServicesApiController.endpoint(String input, String endpointName, String apiVersion, EndpointImplementationDelegate implementation) 


Since you want to do modifications and then retrieve the new Excel binary can please attach your OML and a Dummy Excel in order for me to fully debug your current solution.

Best Regards,

Aureliano Pinheiro

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.