Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hai guys..

I'm build intarface for detection size object.
I get result the size object from binary image from camera capture and i need record size object data to excel.

I was tried this code to show and record size data from my interface using excel.
C#
private void dataToolStripMenuItem_Click(object sender, EventArgs e)
        {
                Microsoft.Office.Interop.Excel.Application xla = new Microsoft.Office.Interop.Excel.Application();
                Workbook wb = xla.Workbooks.Add(XlSheetType.xlWorksheet);
                Worksheet ws = (Worksheet)xla.ActiveSheet;

                xla.Visible = true;

                ws.Cells[1, 1] = "No";
                ws.Cells[1, 2] = "Size Data";
                
                string[] arraySize;
                arraySize = new string[101];

                for (int i = 3; i != (arraySize.Length); i++)
                {
                    string sizeData = labelSize.Text;
                    ws.Cells[i, 2] = sizeData;
                }


But code above just give me "one data" when i clicked button data and it's still same until rows 100.
And it doesn't what i meant.
I need the size object from the text box in intraface will record to excel when i'm click the button data, and excel give me result size data in runtime from interface.
So, anyone can help me to get runtime size data and record it to excel?
Posted
Updated 26-Nov-12 3:58am
v2
Comments
[no name] 26-Nov-12 9:53am    
What code man ???
zaenal arifin 26-Nov-12 10:02am    
i have edited my question..
Herman<T>.Instance 29-Nov-12 4:57am    
i != (arraySize.Length is always true you mean
i < (arraySize.Length
zaenal arifin 4-Dec-12 9:30am    
Thank you digimanus, for your respon.. :)

1 solution

 
Share this answer
 
v2
Comments
zaenal arifin 26-Nov-12 10:01am    
Thank you Krunal for the link.. :)
[no name] 26-Nov-12 10:03am    
:)
[no name] 26-Nov-12 10:08am    
Have you rejected the solution ??
zaenal arifin 26-Nov-12 10:24am    
I'm so sorry Krunel, the link can't solve my problem coz i'm not using data grid view in my project..can you give me some advice from my code?it's that right or wrong?
[no name] 26-Nov-12 10:28am    
Oh, I thought that just because of current forum issue, Answer has been rejected..
So here I have updated my solution.. take a look at that.. perhaps that could help you ...

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