Click here to Skip to main content
15,899,474 members
Home / Discussions / C#
   

C#

 
QuestionHelp with Excel Pin
MumbleB30-May-08 2:06
MumbleB30-May-08 2:06 
AnswerRe: Help with Excel Pin
parth.p30-May-08 2:28
parth.p30-May-08 2:28 
GeneralRe: Help with Excel Pin
MumbleB30-May-08 2:44
MumbleB30-May-08 2:44 
GeneralRe: Help with Excel Pin
parth.p30-May-08 2:47
parth.p30-May-08 2:47 
GeneralRe: Help with Excel Pin
MumbleB30-May-08 2:52
MumbleB30-May-08 2:52 
GeneralRe: Help with Excel Pin
parth.p30-May-08 2:53
parth.p30-May-08 2:53 
GeneralRe: Help with Excel Pin
MumbleB30-May-08 3:19
MumbleB30-May-08 3:19 
GeneralRe: Help with Excel Pin
parth.p30-May-08 3:39
parth.p30-May-08 3:39 
It depends on your set of data. For example if I had 1000 random numbers in collection I would just increment iC column index. And when the column index hits 50 I would increment iR (row Index) and set iC (column Index) back to 1.

This is the code I used before for one my college projects. BUT KEEP IN MIND THAT IT HAS RANDOM NUMBERS ONLY. AND ORDER DOES NOT MATTERS IN THIS.


int iR, iC;
iR = 1;//Worksheet RowIndex
iC = 0;//Worksheet ColumnIndex

for (int i = 0; i <= Globals.Vars.arVbNums.Count - 1; i++)
    {
        iC++;
        //THE FOLLOWING IF STATEMENT USES % MOD OPERATOR
        // BE CAREFUL WHEN EDITING THE CODE.
        if (i % 30 == 0 && i != 0)
        {
            iR++;
            iC = 1;
        }
        oSheet.Cells[iR, iC] = Globals.Vars.arVbNums[i];

    }



But if you're dealing with something like, Data base where order of values matters you will have to stick to + operator. If you look at the code I gave you before it has something like [iR, iC+1] so you will just write something like [iR, iC+2] for next column.

- Stop thinking in terms of limitations and start thinking in terms of possibilities -

Questionavi to mpeg conversion in C# Pin
DeepOceans30-May-08 1:53
DeepOceans30-May-08 1:53 
AnswerRe: avi to mpeg conversion in C# Pin
carbon_golem30-May-08 2:25
carbon_golem30-May-08 2:25 
Questionthis application has failed to start because the application configuration [modified] Pin
neyerMat30-May-08 1:44
neyerMat30-May-08 1:44 
QuestionProblem to show PrintPreview with WebBrowser. Pin
hdv21230-May-08 1:31
hdv21230-May-08 1:31 
QuestionFiltering a typed datatable problem Pin
blakey40430-May-08 0:17
blakey40430-May-08 0:17 
AnswerRe: Filtering a typed datatable problem Pin
Rob Smiley30-May-08 5:25
Rob Smiley30-May-08 5:25 
GeneralRe: Filtering a typed datatable problem Pin
blakey40430-May-08 7:51
blakey40430-May-08 7:51 
GeneralRe: Filtering a typed datatable problem Pin
blakey40430-May-08 7:57
blakey40430-May-08 7:57 
GeneralRe: Filtering a typed datatable problem Pin
Rob Smiley30-May-08 8:56
Rob Smiley30-May-08 8:56 
AnswerRe: Filtering a typed datatable problem Pin
blakey40430-May-08 12:59
blakey40430-May-08 12:59 
QuestionReading word formatting in C# Pin
kindzal29-May-08 23:00
kindzal29-May-08 23:00 
QuestionHelp in Database Connection Pin
Saiyed Alam29-May-08 21:54
Saiyed Alam29-May-08 21:54 
AnswerRe: Help in Database Connection Pin
Harvey Saayman29-May-08 22:24
Harvey Saayman29-May-08 22:24 
GeneralRe: Help in Database Connection Pin
Saiyed Alam30-May-08 1:34
Saiyed Alam30-May-08 1:34 
GeneralRe: Help in Database Connection Pin
Harvey Saayman30-May-08 1:40
Harvey Saayman30-May-08 1:40 
GeneralRe: Help in Database Connection Pin
Saiyed Alam30-May-08 1:54
Saiyed Alam30-May-08 1:54 
GeneralRe: Help in Database Connection Pin
Harvey Saayman30-May-08 1:58
Harvey Saayman30-May-08 1:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.