Click here to Skip to main content
15,891,777 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i`m trying to Log file save as Excel

I`m not good at English. Pleas understand

I have EventInfo.cs file

it consist of


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

public class EventLogInfo
{
    public string Id { get; set; }     
    public string Camera { get; set; } 
    public string Device { get; set; }
    public Int16 Region { get; set; }
    public Int16 Event { get; set; }




there are Id, Camera, Device, Region, Event Items

i use

http://support.microsoft.com/kb/302084

and I can make it

like this

using System;
using System.Reflection;

namespace ExcelOutput

public partial class ExcelOutput : Window { public ExcelOutput() { InitializeComponent(); }

    private void Button_Click_1(object sender, RoutedEventArgs e)
    {
      try
        {
            //Start Excel and get Application object.
            //oXL = new Excel.Application();
            //oXL.Visible = false;
            //oXL.UserControl = false;
            //oXL.DisplayAlerts = false;

            oSheet.Cells[1, 1] = "Id";
            oSheet.Cells[1, 2] = "Camera";
            oSheet.Cells[1, 3] = "Device";
            oSheet.Cells[1, 4] = "Region";
            oSheet.Cells[1, 5] = "Event";




<img src="http://www.hoons.net/FileUpload/201306/24/0624_2.jpg">


when i click Excel output button

Excel files are created

but i want to select Some Items (Id, Camera, Device, Region, Event)

save as Excel

What is the best way to select Items

and

How make Excel files

selected Items are sorted???
Posted
Comments
Subramanyam Shankar 16-Mar-15 13:48pm    
if I understood it correctly you want to write data into excel and sort it and save it in excel?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900