Click here to Skip to main content
15,898,222 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
This is my code I want to add the picture in the first row of the cell please help to resolve it,

VB
 CarlosAg.ExcelXmlWriter.Workbook book = new CarlosAg.ExcelXmlWriter.Workbook();  // Specify which Sheet should be opened and the size of window by default
        book.ExcelWorkbook.ActiveSheetIndex = 1;
        book.ExcelWorkbook.WindowTopX = 100;
        book.ExcelWorkbook.WindowTopY = 200;
        book.ExcelWorkbook.WindowHeight = 7000;
        book.ExcelWorkbook.WindowWidth = 8000;

CarlosAg.ExcelXmlWriter.Worksheet sheet = book.Worksheets.Add(strReportName); // Add a Worksheet with Report name
        sheet.Options.PageSetup.Footer.Data = "Powered by Kinetics" + new String(' ', 30) + "Confidential" + new String(' ', 30) + "Page : &P of &N ";
        sheet.Options.PageSetup.Layout.Orientation = CarlosAg.ExcelXmlWriter.Orientation.Landscape;
        sheet.Options.GridLineColor = "#000000"; 

        for (int intColCnt = 0; intColCnt < 125; intColCnt++) // column settings
        {
            sheet.Table.Columns.Add(new CarlosAg.ExcelXmlWriter.WorksheetColumn(75));
        }
        
        CarlosAg.ExcelXmlWriter.WorksheetRow row = sheet.Table.Rows.Add();
        CarlosAg.ExcelXmlWriter.WorksheetCell cell3 = row.Cells.Add("");                
        row = sheet.Table.Rows.Add();
        
        // row.Cells.Add("images\\actions\\BBlogo.gif");
       // row.Cells.Add(" ");
       // row.Cells.Add(" ");
        string imagepath = Request.PhysicalApplicationPath + "images\\ExertLogo.gif";
        book1.addPicture(0, 0, 2, 2, imagepath);
        row.Cells.Add(new CarlosAg.ExcelXmlWriter.WorksheetCell(strReportName, "Company"));
        row = sheet.Table.Rows.Add();
        CarlosAg.ExcelXmlWriter.WorksheetCell cell = row.Cells.Add("");
        row.Cells.Insert(1,new CarlosAg.ExcelXmlWriter.WorksheetCell(imagepath));
       // row.Cells.Add(imagepath);
       // cell.StyleID = "Company";
       // cell.MergeAcross = 2;        
      //  row.Cells.Add(" ");
      //  row.Cells.Add(" ");
        row.Cells.Add(new CarlosAg.ExcelXmlWriter.WorksheetCell("Report Run Datetime : " + DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"), "Reports"));
        row = sheet.Table.Rows.Add();
     //   row.Cells.Add(" ");
    //    row.Cells.Add(" ");
      //  row.Cells.Add(" ");        
        CarlosAg.ExcelXmlWriter.WorksheetCell cell2 = row.Cells.Add();
     //   cell2.StyleID = "Reports";
    //    cell2.MergeAcross = 2;
    //    cell2.MergeDown = 3;
        row.Cells.Add(" ");
        row.Cells.Add(new CarlosAg.ExcelXmlWriter.WorksheetCell("Report Run By : " + Session["strUsername"].ToString(), "Reports"));
        row = sheet.Table.Rows.Add();
        row = sheet.Table.Rows.Add();
        row = sheet.Table.Rows.Add();
Posted
Updated 8-Aug-14 1:29am
v2
Comments
Maciej Los 8-Aug-14 7:32am    
Not enough information. ;(
You're using non-standard provider: CarlosAg.ExcelXmlWriter. Ask an author.
Member 10535472 8-Aug-14 7:35am    
is it possible to add the picture in the carlosg.excelxmlwriter?
Maciej Los 8-Aug-14 7:41am    
I have no idea!

1 solution

 
Share this answer
 
v2

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