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.

Tue Oct 28, 2014 10:56 am

Hi,

I have downloaded the trial version of Spire.XLS today and I am evaluating the product, but I have some concerns and questions:

1. How can I just create a worksheet in memory and save it as byte[] (no need to export to file)?
2. What is the best practice to clear memory after creating my sheets?
3. We might have very large amounts of data (> 1000000 records) how fast could the component render them into excel? knowing that we have been using a component that is very fast at this point (2 sec for this amount of data)
4. How do I format date withour having to convert it to string?

Thanks in advance.

ali.baghdadi
 
Posts: 4
Joined: Tue Oct 28, 2014 7:30 am

Wed Oct 29, 2014 6:14 am

Dear ali.baghdadi,

Thanks for your inquiry,

For you requirement, please refer to the code below:
Code: Select all
Workbook workbook = new Workbook();
Worksheet sheet = workbook.Worksheets[0];
DateTime dt = DateTime.Now;
sheet.Range["A1"].DateTimeValue = dt;
//Set the date format without convert it to string
sheet.Range["A1"].NumberFormat = "YYYY-MMM-dd";
byte[] array;
//use class MemorStream and ToArray methed to save data to a byte array
//and it will be disposed automatically
using (MemoryStream ms=new MemoryStream())
{
    workbook.SaveToStream(ms);
    array = ms.ToArray();
}

And for the issue 3 about rendering large amounts of records into excel, the dev member told me that it depends on what the code you are using. Perhaps you can provide us some code snippet?

Best Regards,
Burning
E-iceblue Support Team
Best Regards,
Burning
E-iceblue Support Team
User avatar

burning.liu
 
Posts: 406
Joined: Mon Aug 04, 2014 6:47 am

Fri Oct 31, 2014 9:41 am

Dear ali.baghdadi,

Have you tried the solution I provided?

Please feel free to contact us if you any problems.

Best Regards,
Burning
E-iceblue Support Team
Best Regards,
Burning
E-iceblue Support Team
User avatar

burning.liu
 
Posts: 406
Joined: Mon Aug 04, 2014 6:47 am

Tue Nov 18, 2014 2:40 pm

Hello,

I tried out this solution and it worked fine, though it's taking around 2 sec for a workbook of size 3MB which is not acceptable in my case.

ali.baghdadi
 
Posts: 4
Joined: Tue Oct 28, 2014 7:30 am

Wed Nov 19, 2014 8:19 am

Dear baghdadi,

The time depends on mostly what the code you're using and the complexity of data, would you mind sending us your code snippet and excel file to see if we can help you?

Best Regards,
Burning
E-iceblue Support Team
Best Regards,
Burning
E-iceblue Support Team
User avatar

burning.liu
 
Posts: 406
Joined: Mon Aug 04, 2014 6:47 am

Return to Spire.XLS