Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Thu Jul 25, 2019 6:56 am

Hey,

i am trying to insert an array of object into excel as bulk.

This is my object class (called "DailyValues"):

Code: Select all
        public string ColumnName { get; set; }
        public string Accounts { get; set; }
        public string AccountNumber { get; set; }
        public double Amount { get; set; }
        public Boolean IsExist { get; set; }


This is how i use the function:
Code: Select all
TargetPivotData.InsertArray(DailyUsage.Where(x => x != null).ToArray(), 1, 1,True);


This is the result (in the excel):

ApplicationName.DailyValues Account Number Attribute Value
ApplicationName.DailyValues
ApplicationName.DailyValues
ApplicationName.DailyValues
ApplicationName.DailyValues
ApplicationName.DailyValues
ApplicationName.DailyValues
ApplicationName.DailyValues
ApplicationName.DailyValues
ApplicationName.DailyValues
ApplicationName.DailyValues
ApplicationName.DailyValues
ApplicationName.DailyValues
ApplicationName.DailyValues
ApplicationName.DailyValues

Thanks

yosisndr
 
Posts: 4
Joined: Sun May 31, 2015 7:27 am

Thu Jul 25, 2019 8:17 am

Hello,

Thank you for contacting.
After an initial test with our latest Spire.XLS Pack Version:9.7, I found that the InsertArray function could work well. If you were using an old version, I suggest you try again with the latest version. If your issue still occurs after trying, to help further look into it, please share us with your input file (if any), your desired effect of output as well as your full testing code, a runnable application which shows your problem will be helpful.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Return to Spire.XLS