Click here to Skip to main content
15,887,746 members
Home / Discussions / C#
   

C#

 
GeneralRe: Where can i download iTextSharp.dll (version 4.0.6.0) Pin
Nagy Vilmos18-Mar-09 1:14
professionalNagy Vilmos18-Mar-09 1:14 
GeneralRe: Where can i download iTextSharp.dll (version 4.0.6.0) Pin
MumbleB18-Mar-09 1:21
MumbleB18-Mar-09 1:21 
GeneralRe: Where can i download iTextSharp.dll (version 4.0.6.0) Pin
Dan Neely18-Mar-09 2:18
Dan Neely18-Mar-09 2:18 
QuestionWPF StackPanel, ListView update problem Pin
marca29217-Mar-09 21:46
marca29217-Mar-09 21:46 
AnswerRe: WPF StackPanel, ListView update problem Pin
ABitSmart18-Mar-09 0:05
ABitSmart18-Mar-09 0:05 
QuestionExcel Related Question Pin
MumbleB17-Mar-09 21:43
MumbleB17-Mar-09 21:43 
AnswerRe: Excel Related Question Pin
Mycroft Holmes17-Mar-09 23:11
professionalMycroft Holmes17-Mar-09 23:11 
GeneralRe: Excel Related Question Pin
MumbleB17-Mar-09 23:28
MumbleB17-Mar-09 23:28 
They are currently returning the correct Row/Column. When I debug I get the correct row. I use the same lastUsedRow and lastUsedColumn to do the calculations currently. See below code. Difference is that I write the calculated values to a selected Cell. See below extract for the calculations etc.
//Find the last Used Row and Column
int lastUsedRow = objSheet.Cells.SpecialCells
    (Excel.XlCellType.xlCellTypeLastCell, Type.Missing).Row;
int lastUsedColumn = objSheet.Cells.SpecialCells
    (Excel.XlCellType.xlCellTypeLastCell,Type.Missing).Column;
//Write Header for Sum of Level 1

objRange = objSheet.get_Range("D1",
    System.Reflection.Missing.Value);
objRange.Value2 = "Total of Level 1";
objRange.Font.Bold = true;
objRange.Font.Italic = true;
objRange.Font.ColorIndex = "5";

//Write Header for sum of Level 2
objRange = objSheet.get_Range("D2",
    System.Reflection.Missing.Value);
objRange.Value2 = "Total of Level 2";
objRange.Font.Bold = true;
objRange.Font.Italic = true;
objRange.Font.ColorIndex = "5";

//Write Header for Difference of level 1 and 2
objRange = objSheet.get_Range("F1",
    System.Reflection.Missing.Value);
objRange.Value2 = "Difference (Level1 - Level2)";
objRange.Font.ColorIndex = "5";
objRange.Font.Bold = true;
objRange.Font.Italic = true;

//Do the calculation of all Level 1
objRange = objSheet.get_Range("E1",
    System.Reflection.Missing.Value);
objRange.Formula = string.Format("=SUM(J4:J{0}", lastUsedRow);
objRange.FormulaHidden = true;
objRange.Calculate();
objRange.Font.Bold = true;
objRange.Font.ColorIndex = "5";
objRange.HorizontalAlignment = XlHAlign.xlHAlignLeft;

//Do calculation of All Level 2
objRange = objSheet.get_Range("E2",
    System.Reflection.Missing.Value);
objRange.Formula = string.Format("=SUM(K4:K{0}", lastUsedRow);
objRange.FormulaHidden = true;
objRange.Calculate();
objRange.Font.Bold = true;
objRange.Font.ColorIndex = "5";
objRange.HorizontalAlignment = XlHAlign.xlHAlignLeft;

//Calculate the Difference between the two.
objRange = objSheet.get_Range("F2",
    System.Reflection.Missing.Value);
objRange.Formula = "=SUM(E1-E2)";
objRange.FormulaHidden = true;
objRange.Calculate();
objRange.Font.Bold = true;
objRange.Font.Italic = true;
objRange.Font.ColorIndex = "3";
objRange.HorizontalAlignment = XlHAlign.xlHAlignLeft;


Excellence is doing ordinary things extraordinarily well.

QuestionCheckForIllegalCrossThreadCalls = false for cross-thread control update Pin
12Code17-Mar-09 21:41
12Code17-Mar-09 21:41 
AnswerRe: CheckForIllegalCrossThreadCalls = false for cross-thread control update Pin
N a v a n e e t h17-Mar-09 22:36
N a v a n e e t h17-Mar-09 22:36 
GeneralRe: CheckForIllegalCrossThreadCalls = false for cross-thread control update Pin
12Code17-Mar-09 22:49
12Code17-Mar-09 22:49 
AnswerRe: CheckForIllegalCrossThreadCalls = false for cross-thread control update Pin
Nagy Vilmos17-Mar-09 22:49
professionalNagy Vilmos17-Mar-09 22:49 
AnswerRe: CheckForIllegalCrossThreadCalls = false for cross-thread control update Pin
Luc Pattyn18-Mar-09 5:44
sitebuilderLuc Pattyn18-Mar-09 5:44 
QuestionDrag & Drop in Datagridview Pin
zeeShan anSari17-Mar-09 21:36
zeeShan anSari17-Mar-09 21:36 
AnswerRe: Drag & Drop in Datagridview Pin
Mycroft Holmes17-Mar-09 23:14
professionalMycroft Holmes17-Mar-09 23:14 
Questionissues with com port Pin
ganeshan.m17-Mar-09 21:18
ganeshan.m17-Mar-09 21:18 
AnswerRe: issues with com port Pin
monstale17-Mar-09 23:28
monstale17-Mar-09 23:28 
AnswerRe: issues with com port Pin
Luc Pattyn18-Mar-09 5:47
sitebuilderLuc Pattyn18-Mar-09 5:47 
QuestionWPF Texbox with "Microsoft Outlook email To field" behavior Pin
marca29217-Mar-09 21:11
marca29217-Mar-09 21:11 
AnswerRe: WPF Texbox with "Microsoft Outlook email To field" behavior Pin
Mycroft Holmes17-Mar-09 23:17
professionalMycroft Holmes17-Mar-09 23:17 
QuestionDrawing an Acr in C#.net using a mouse Pin
b.manan17-Mar-09 20:28
b.manan17-Mar-09 20:28 
AnswerRe: Drawing an Acr in C#.net using a mouse Pin
Christian Graus17-Mar-09 20:38
protectorChristian Graus17-Mar-09 20:38 
GeneralRe: Drawing an Acr in C#.net using a mouse Pin
0x3c018-Mar-09 0:39
0x3c018-Mar-09 0:39 
QuestionHow to get any Exe path location in C# Pin
p_anant200017-Mar-09 20:24
p_anant200017-Mar-09 20:24 
AnswerRe: How to get any Exe path location in C# Pin
Vikram A Punathambekar17-Mar-09 20:36
Vikram A Punathambekar17-Mar-09 20:36 

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.