Hi,
I follow the example in http://help.infragistics.com/NetAdvantage/DV/2010.3/CLR4.0/ in order to import data from Excel in a XamPivotGrid.
My problem is that I get a security exception at line :
ExcelDataConnectionSettings excelDataSettings = new ExcelDataConnectionSettings { FileStream = fileStream, GeneratedTypeName = PivotGridStrings.XPG_ExcelFileDataSource_InitialCube, WorksheetName = PivotGridStrings.XPG_ExcelFileDataSource_WorksheetName };
------------------
The type initializer for 'SR' threw an exception.
Any ideas?
Thank u
D.
Could it be due to the fact that you are trying to reference an Excel file stored on the file system? If that's the case, you should probably be adding the Excel file you're referencing in the ClientBin folder and update your path in the code accordingly.
Yes I want to open the file from my local disk. And I open it following the example (dialog Open) :
OpenFileDialog openFileDialog = new OpenFileDialog();
bool? showDialog = openFileDialog.ShowDialog();
if (showDialog == true)
{
Stream stream = openFileDialog.File.OpenRead();
FlatDataSource dataSource = CreateDataSource(stream);
this.pivotGrid.DataSource = dataSource;
this.dataSelector.DataSource = dataSource;
stream.Close();
}
then at ExcelDataConnectionSettings excelDataSettings = new ExcelDataConnectionSettings { FileStream = fileStream, GeneratedTypeName = PivotGridStrings.XPG_ExcelFileDataSource_InitialCube, WorksheetName = PivotGridStrings.XPG_ExcelFileDataSource_WorksheetName };
Name = '((System.IO.FileStream)(fileStream)).Name' threw an exception of type 'System.Security.SecurityException'
Hi Dimitris,
This exception may have been thrown if you are trying to access a non-existent resx file. Is it possible that you copy-pasted the code from the samples, but did not replace the references to our resx files with your own strings?
Regards,