Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I'm exporting data from Crystal Report to Excel. When I export I'm not able to see the borders, hence I'm using Excel namespace in C# program for showing border lines, the following is the code I'm using in the Web Application (C# language): using Excel; string workbookPath = "c:/SomeWorkBook.xls"; ExportOptions export = new ExportOptions(); DiskFileDestinationOptions ex = new DiskFileDestinationOptions(); ex.DiskFileName=workbookpath; export.DestinationOptions = ex; ReportDocument.Export(); Excel.Application excelApp = new Excel.ApplicationClass(); excelApp.Visible = true; Excel.Workbook excelWorkbook = excelApp.Workbooks.Open(workbookPath, 0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "", true, false, 0, true, false, false); Excel.Sheets excelSheets = excelWorkbook.Worksheets; string currentSheet = "Sheet1"; Excel.Worksheet excelWorksheet = (Excel.Worksheet)excelSheets.get_Item(currentSheet ); Excel.Range cell = excelWorksheet.UsedRange; cell.Borders.get_Item(Excel.XlBordersIndex.xlEdgeT op ).LineStyle =Excel.XlLineStyle.xlContinuous; cell.Borders.get_Item(Excel.XlBordersIndex.xlEdgeB ottom ).LineStyle =Excel.XlLineStyle.xlContinuous; cell.Borders.get_Item(Excel.XlBordersIndex.xlEdgeR ight ).LineStyle =Excel.XlLineStyle.xlContinuous; cell.Borders.get_Item(Excel.XlBordersIndex.xlEdgeL eft ).LineStyle =Excel.XlLineStyle.xlContinuous; excelWorkbook.Save(); excelWorkbook.Close(Type.Missing,workbookpath,Type .Missing); export.DestinationOptions = ex; excelWorkbook = null; excelSheets = null; excelApp = null; When I use the above code, the Excel application is running in the background (I'm able to see the process running for that in the Task Manager) under IUSR_<servername and as well as under current user who as logged into the terminal. So whenever I export data, that many times the Excel Application are running in the process. How to solve this problem? Pls help me out... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Convert excel spreadsheet into crystal report | Excel Worksheet Functions | |||
Exporting Crystal 9 to Excel 2002 | Excel Discussion (Misc queries) | |||
Saving excel to Crystal Report *.rpt | Excel Discussion (Misc queries) | |||
Cleaning up data from Crystal Report | Excel Worksheet Functions | |||
Save Excel worksheet as Crystal Report | Excel Programming |