My problem is the excel spead sheet is a floating range, and after that I inserted a graph, then I need to add a page break. I think i need to count the i++ and the length of pixel, when i is larger than the height, that's the row I put the page break. Below is the code I already have.
counter++;
//determine the position of the charts to come oRng = oSheet.get_Range("B1", "I" + counter.ToString());
float fWidth = (float)Convert.ToDouble(oRng.Width); float fTop = (float)Convert.ToInt32(oRng.Height); //for (int i = 1; i < counter; i++) //{ // oRng = oSheet.get_Range("A" + counter.ToString(), Missing.Value); //fTop += Convert.ToInt32(oRng.RowHeight); //} //counter++; //Place FICO Distribution Picture //oRng = oSheet.get_Range("A1", "I" + counter.ToString()); //fTop = (float)Convert.ToDouble(oRng.Height); //fWidth = (float)Convert.ToDouble(oRng.Width); oSheet.Shapes.AddPicture(ImageTable["LTV Strat"].ToString(), Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.m soCTrue, 295, fTop, 290, 180); oSheet.Shapes.AddPicture(ImageTable["FICO Strat"].ToString(), Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.m soCTrue, 585, fTop, 290, 180); //increase counter to set it on the first row after the map /
//add page break
I am very new to C#, can any one write a code to show me how to finish this? Thanks!!