Spire.XLS for .NET is a professional Excel .NET library that can be used to any type of .NET( C#, VB.NET, ASP.NET, .NET Core) application and Java (J2SE and J2EE) application.

Mon Nov 12, 2018 9:29 am

Hi there!

I'm really interested, where I can find methods or demo to get c#-code template from loaded Excel-file? In other words: I need to open any Excel and should get C#-code-spire.xls, to see how document is made.

Thanks in advance!

maximka19
 
Posts: 8
Joined: Sun May 08, 2016 8:43 pm

Mon Nov 12, 2018 10:32 am

Hi,

Thanks for your inquiry.
Below is code for loading Excel file.
Code: Select all
            Workbook workbook = new Workbook();
            workbook.LoadFromFile("FilePath",ExcelVersion.Version2013);

Besides, you could download Spire.XLS Pack Version:8.0 and install it on your computer. Then you could find many live demos in it.

And here is the guidance for Spire.XLS on our website.
https://www.e-iceblue.com/Tutorials/Spi ... ntent.html
If you still have issues, please provide more information and write back to us.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3067
Joined: Tue Sep 06, 2016 8:30 am

Mon Nov 12, 2018 10:58 am

Betsy.jiang wrote:Hi,

Thanks for your inquiry.
Below is code for loading Excel file.
Code: Select all
            Workbook workbook = new Workbook();
            workbook.LoadFromFile("FilePath",ExcelVersion.Version2013);

Besides, you could download Spire.XLS Pack Version:8.0 and install it on your computer. Then you could find many live demos in it.

And here is the guidance for Spire.XLS on our website.
https://www.e-iceblue.com/Tutorials/Spi ... ntent.html
If you still have issues, please provide more information and write back to us.

Sincerely,
Betsy
E-iceblue support team

Hi, Betsy!

No, you understand me wrong. I mean how to get C#-code-template of file, not open the file itself. Like: I've selected Excel-file then Spire.XLS produces me C#-code of this file with all its data, page setup and formatting like:
Code: Select all
var workbook = new Workbook();
workbook.Worksheets.Add(....);
workbook.Worksheets[0].Range[....].Text = "Some text";
RichText richText = newSheet.Range["A1"].RichText;
richText.Text = "ID";
richText.SetFont(0, richText.Text.Length - 1, fontBold);

maximka19
 
Posts: 8
Joined: Sun May 08, 2016 8:43 pm

Tue Nov 13, 2018 2:05 am

Hi,

Sorry that I misunderstood your meaning.
Please provide your template file. Then I will look into it and then provide the code for generating the file.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3067
Joined: Tue Sep 06, 2016 8:30 am

Tue Nov 13, 2018 5:03 am

Betsy.jiang wrote:Hi,

Sorry that I misunderstood your meaning.
Please provide your template file. Then I will look into it and then provide the code for generating the file.

Sincerely,
Betsy
E-iceblue support team

Hi there!

Here is the file.

Betsy, it would be nice if You'd add that kind of option in provided methods or Demos. The most useful tool. Please, share this to developers group.

Thanks in advance!
Attachments
report.zip
Excel file template
(8.59 KiB) Downloaded 94 times

maximka19
 
Posts: 8
Joined: Sun May 08, 2016 8:43 pm

Tue Nov 13, 2018 10:22 am

Hi,

I will provide the demo for you ASAP.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3067
Joined: Tue Sep 06, 2016 8:30 am

Tue Nov 13, 2018 11:25 am

Thanks! Waiting for demo ASAP!)

maximka19
 
Posts: 8
Joined: Sun May 08, 2016 8:43 pm

Wed Nov 14, 2018 2:42 am

Hi,

Here is the demo for you.
http://www.e-iceblue.com/downloads/demo/15564Demo.zip
If there is any question, welcome to contact us.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3067
Joined: Tue Sep 06, 2016 8:30 am

Wed Nov 14, 2018 5:53 am

Betsy,
much obliged! Thank You!

Anyway, please, consider to provide this function in Spire.Office library. It'll be very useful for any kind of developers. No matter, how it would be: in Spire.Office library methods or in Spire.Office provided demos.

Thank You!

maximka19
 
Posts: 8
Joined: Sun May 08, 2016 8:43 pm

Wed Nov 14, 2018 6:27 am

Hi,

Thanks for your information.
Note Spire.Office includes all our products. The code I provided could also work with Spire.Office, you only need to replace the Spire dlls in the demo with the dlls from Spire.Office. Please download Spire.Office Platinum (DLL Only) Version:3.11.3, and replace the dlls(Spire.License.dll, Spire.Common.dll, Spire.XLS.dll, Spire.Pdf.dll).
Any question, welcome to get it back to us.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3067
Joined: Tue Sep 06, 2016 8:30 am

Tue Nov 20, 2018 8:50 am

Hi,

Greetings from E-iceblue.
Did the demo I provided help you solve your issue? Could you please give us some feedback at your convenience?

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3067
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.XLS