We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Excel Cell manipulation

Morning,
I have a need to programmatically manipulate an Excel object to some very specific requirements. I have done this with Excel interop and the customer liked what they saw however we all know the issues with interop. Thus we purchased Syncfusion but can’t seem to get the same kind of detailed control over the Syncfusion’s Excel object.

When the data is returned form the database, I need to add a row if there are certain type of records, if not I don’t need to add this header row. The rest of the records returned can be one of three types all needing their own header row. Attached is a sample spreadsheet. They want it exactly as it is shown. Like I previously mentioned, I did a proof of concept using interop and they liked the results so I know it can be done.

Using interop I used this:

//Excel Objects
Microsoft.Office.Interop.Excel.Application oXLApplication;
Microsoft.Office.Interop.Excel._Workbook oWorkBook;
Microsoft.Office.Interop.Excel._Worksheet oSheet;

//Range objects for cell manipulation
Microsoft.Office.Interop.Excel.Range oRng;
Microsoft.Office.Interop.Excel.Range oCV;
Microsoft.Office.Interop.Excel.Range[] oRngCV = new Microsoft.Office.Interop.Excel.Range[0];

Using Syncfusion:

GroupingGridExcelConverterControl ggExcelConverter = new GroupingGridExcelConverterControl();
ExcelEngine oExcelEngine = new ExcelEngine();
IApplication oApplication = new ExcelEngine().Excel;
IWorkbook oWorkbook = new ExcelEngine().Excel.Workbooks.Add();
IWorksheet oSheet = new ExcelEngine().Excel.ActiveSheet;

These declarations seem to work fine. This issue is when I try to declare the Range objects. I need two range objects and a range array. Any assistance would be greatly appreciated.

Thanks,
Dave


SampleReport.zip

1 Reply

DA David March 13, 2007 02:32 PM UTC

I posted this in the wrong forum - I'll move it over to the XlsIO forum...

>Morning,
I have a need to programmatically manipulate an Excel object to some very specific requirements. I have done this with Excel interop and the customer liked what they saw however we all know the issues with interop. Thus we purchased Syncfusion but can’t seem to get the same kind of detailed control over the Syncfusion’s Excel object.

When the data is returned form the database, I need to add a row if there are certain type of records, if not I don’t need to add this header row. The rest of the records returned can be one of three types all needing their own header row. Attached is a sample spreadsheet. They want it exactly as it is shown. Like I previously mentioned, I did a proof of concept using interop and they liked the results so I know it can be done.

Using interop I used this:

//Excel Objects
Microsoft.Office.Interop.Excel.Application oXLApplication;
Microsoft.Office.Interop.Excel._Workbook oWorkBook;
Microsoft.Office.Interop.Excel._Worksheet oSheet;

//Range objects for cell manipulation
Microsoft.Office.Interop.Excel.Range oRng;
Microsoft.Office.Interop.Excel.Range oCV;
Microsoft.Office.Interop.Excel.Range[] oRngCV = new Microsoft.Office.Interop.Excel.Range[0];

Using Syncfusion:

GroupingGridExcelConverterControl ggExcelConverter = new GroupingGridExcelConverterControl();
ExcelEngine oExcelEngine = new ExcelEngine();
IApplication oApplication = new ExcelEngine().Excel;
IWorkbook oWorkbook = new ExcelEngine().Excel.Workbooks.Add();
IWorksheet oSheet = new ExcelEngine().Excel.ActiveSheet;

These declarations seem to work fine. This issue is when I try to declare the Range objects. I need two range objects and a range array. Any assistance would be greatly appreciated.

Thanks,
Dave


SampleReport.zip

Loader.
Live Chat Icon For mobile
Up arrow icon