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

Very Urgent

Hi,

I was trying to copy a worksheet using AddCopy method, but im getting the following error "Specified argument". below is the stack trace,

Parameter name: index
StackTrace:= at Syncfusion.XlsIO.Implementation.TypedSortedListEx`2.GetKey(Int32 index)
at Syncfusion.XlsIO.Implementation.Collections.FormatsCollection.CreateFormat(String formatString)
at Syncfusion.XlsIO.Implementation.Collections.FormatsCollection.AddCopy(FormatRecord format)
at Syncfusion.XlsIO.Implementation.Collections.FormatsCollection.AddCopy(FormatImpl format)
at Syncfusion.XlsIO.Implementation.Collections.FormatsCollection.Merge(FormatsCollection source)
at Syncfusion.XlsIO.Implementation.Collections.ExtendedFormatsCollection.Merge(IList arrXFormats, Dictionary`2& dicFontIndexes)
at Syncfusion.XlsIO.Implementation.Collections.StylesCollection.Merge(IWorkbook workbook, ExcelStyleMergeOptions option, Dictionary`2& dicFontIndexes, Dictionary`2& hashExtFormatIndexes)
at Syncfusion.XlsIO.Implementation.Collections.WorksheetsCollection.AddCopy(IWorksheet sheet, ExcelWorksheetCopyFlags flags, Boolean isLocal)
at Syncfusion.XlsIO.Implementation.Collections.WorksheetsCollection.AddCopy(IWorksheet sheet, ExcelWorksheetCopyFlags flags)


Please help me out on this, im using 7.102 version.

You help would be much appreciated,

Thanks in advance,
Mohankumar.V


3 Replies

SB Sathish Babu R Syncfusion Team December 16, 2010 05:32 AM UTC

Hi Mohankumar Venugopal,

Thank you for your interest in Syncfusion products.

We are not able to reproduce the mentioned issue at our side. We have created the sample and tested with assembly version 7.1.0.30 (2.0 .Net framework). Could you please modify the posted sample to reproduce the issue and revert us back the same, which will helps us to further investigate on this.

Sample:
97600-1992965550.zip

Please, let us know if you have any concerns.

Regards,
Sathish




MV Mohankumar Venugopal December 16, 2010 09:26 PM UTC

Hi Sathish,

Im also using the same code, let me explain the scenario,

Web application Opening a popup window, it generates some xls files using reporting service and its process and merging into single file. while merging, im using .AddCopy method to copy the worksheets. below is my code,

tempworkbook = application.Workbooks.Open(alAttachments[intItem].ToString());
for (int i = 0; i < tempworkbook.Worksheets.Count; i++)
{
if (tempworkbook.Worksheets[i].Range.LastRow > 1) //if not empty sheet
{
try
{
strCurrentSheet = tempworkbook.Worksheets[i].Name;
IWorksheet currentSheet = workbook.Worksheets.AddCopy(tempworkbook.Worksheets[i]);

}
catch (Exception ex)
{

}
}
}



Here, im gettin the exception like "Specified argument was out of range of valid values". below is the stack trace.

Exception:
Date: 15 Dec 2010, 06:51 AM ----- Message: Message: Description:= Specified argument was out of the range of valid values.
Parameter name: index
StackTrace:= at Syncfusion.XlsIO.Implementation.TypedSortedListEx`2.GetKey(Int32 index)
at Syncfusion.XlsIO.Implementation.Collections.FormatsCollection.CreateFormat(String formatString)
at Syncfusion.XlsIO.Implementation.Collections.FormatsCollection.AddCopy(FormatRecord format)
at Syncfusion.XlsIO.Implementation.Collections.FormatsCollection.AddCopy(FormatImpl format)
at Syncfusion.XlsIO.Implementation.Collections.FormatsCollection.Merge(FormatsCollection source)
at Syncfusion.XlsIO.Implementation.Collections.ExtendedFormatsCollection.Merge(IList arrXFormats, Dictionary`2& dicFontIndexes)
at Syncfusion.XlsIO.Implementation.Collections.StylesCollection.Merge(IWorkbook workbook, ExcelStyleMergeOptions option, Dictionary`2& dicFontIndexes, Dictionary`2& hashExtFormatIndexes)
at Syncfusion.XlsIO.Implementation.Collections.WorksheetsCollection.AddCopy(IWorksheet sheet, ExcelWorksheetCopyFlags flags, Boolean isLocal)
at Syncfusion.XlsIO.Implementation.Collections.WorksheetsCollection.AddCopy(IWorksheet sheet)

The main thing which i don understand is, it is working perfectly in my local but this is not happening in server. I din install Syncfusion 8.4, but have added all the dll's in the bin folder.

Could you please tell me the reason why it is working in local and not in server. Is there's any dependencies im missing out? or you could explain me the dependencies. Is it because of version conflicts or am i doing anything wrong?

could you pls help me on this.

Thanks in advance,
Mohankumar.V







SB Sathish Babu R Syncfusion Team December 17, 2010 12:03 PM UTC

Hi Mohankumar Venugopal,


We are afraid that we could not able to reproduce the issue at our side. We have tested the sample with the 7.1.0.30 Assemblies (2.0 framework) in Windows 2008 Server 32 bit and also we have attached the screen shots of the sample testing for your reference with this post. Could you please try the same and if still issue reproduces revert us back the same.

Sample:
97600-1742509473.zip

Please, let us know if you have any other concerns.


Regards,
Sathish



Loader.
Live Chat Icon For mobile
Up arrow icon