LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
Posts: 1
Default Exporting data from Crystal Report to Excel - Need soln

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();
export.DestinationOptions = ex;
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
cell.Borders.get_Item(Excel.XlBordersIndex.xlEdgeB ottom ).LineStyle
cell.Borders.get_Item(Excel.XlBordersIndex.xlEdgeR ight ).LineStyle
cell.Borders.get_Item(Excel.XlBordersIndex.xlEdgeL eft ).LineStyle
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...

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert excel spreadsheet into crystal report joala Excel Worksheet Functions 1 March 30th 06 09:50 PM
Exporting Crystal 9 to Excel 2002 Gemse Excel Discussion (Misc queries) 0 September 16th 05 03:01 PM
Saving excel to Crystal Report *.rpt Dani Excel Discussion (Misc queries) 1 September 9th 05 02:09 PM
Cleaning up data from Crystal Report Leslie Coover Excel Worksheet Functions 4 August 24th 05 03:27 PM
Save Excel worksheet as Crystal Report Tod Excel Programming 0 June 4th 04 01:46 AM

All times are GMT +1. The time now is 05:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 ExcelBanter.
The comments are property of their posters.

About Us

"It's about Microsoft Excel"