Exporting to Excel in Crystal Reports .NET - Perfect Excel Exports


   I want to export Crystal report to Excel and the following is the code i wrote in the button click.

ReportDocument rptExcel =
new ReportDocument() ;
string strExportFile = "C:/Session_SessionID.xls" ;
rptExcel =
new RptJobOrderRecap();//report name
rptExcel.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile ;
rptExcel.ExportOptions.ExportFormatType = ExportFormatType.Excel;
ExcelFormatOptions objExcelOptions =
new ExcelFormatOptions();
objExcelOptions.ExcelUseConstantColumnWidth =
false ;
rptExcel.ExportOptions.FormatOptions = objExcelOptions ;
DiskFileDestinationOptions objOptions =
new DiskFileDestinationOptions();
objOptions.DiskFileName = strExportFile ;
rptExcel.ExportOptions.DestinationOptions = objOptions;

//here i attached the parameters

objOptions =
rptExcel =

  But when i click the button the following error is displayed: "Missing parameter field current value."

 when i debugg the code i found the following error in "Quick watch" of  report document. object.
 " Current <error: an exception of type: {CrystalDecisions.CrystalReports.Engine.InvalidArgumentException} occurred> System.Object"

please help.

8/2/2005 5:54:06 AM
asp.net.crystal-reports 7043 articles. 0 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 35


looks like your report requires some parameter field which you are not sending.

8/3/2005 3:17:40 PM
I have placed a Export button to export the generated report to excel. In one page i have placed a cross-tab and getting the values from the stored procedure by drag and drop ,i am showing those values in the report.  In button click i have written

MemoryStream oStream;

oStream = (MemoryStream)myreport.ExportToStream(ExportFormatType.Excel);


Response.Buffer= true;

Response.ContentType = "application/vnd.ms-excel";



this is working fine for one page.

I have generated another report and placed crystalreportviewer , and in export button click written the same code. The problem here is i couldn't export the data that is printing in the report from the stored procedure.  I could able to see the headings in the excel sheet....rest all empty space.
I could n't find where the problem is
if u have any idea please help me out.
Thanks in advance.

8/16/2005 8:45:49 AM

Similar Artilces:

Converting Crystal Reports 9 report to Crystal Reports .NET report
I have a web page that is supposed to display a crystal report.  The report is fully written and functional in crystal 9 (non-.Net)  .  Is there a way to convert my .rpt so that I can just include it in the new web site? why you don't try to compile project with .net and include your report. then if crystal report is power tool will suggests you with conversation tool    My blog is here.Please remember to 'Mark as Answer' if this post answered your question! Wow it really was that easy!  I just added the old crystal report into my .NET proj...

crystal reports .net -> crystal reports .net 2003
recently converted a project from .net to .net 2003. The 2 crystal reports I had in the project do not load when executing the application. The project itself within 2003 will allow me to multiplat the crystal reports, however when it comes to execution time I get the error: Invalid Data Source. If this isn't the right forum please point me to the right one as this is really the only website I know of with a large reader base. >to multiplat the crystal reports To what the crystal reports? Do you have the same database connections established and verified in your 2003 s...

Export Crystal Report to Crystal Report format
I looked at some sample code provided by crystaldecisions, and they have the ability to export a web crystal report to a crystal report. I was assuming that this would cause the local instance of Crystal reports on the client machine to be invoked. I tried this in my project, and I get the following error: Error Encountered by Crystal Web Report Server -------------------------------------------------------------------------------- The error message returned is: Connection to Report Server Failed. It creates the file as an .rpt file in the directory it should. Do I need a dif...

Excel/Word Toolbar not display when export data from crystal report to Excel/Word format.
Dear all  I try to export data from crystal report to Excel/Word format. The data is fine but Excel/Word Toolbar not display.Pls help me.  I use:  - VS 2005   - ASP.NET (C#)  - CrystalReportViewer Thank you. The one time I've seen this, it was because the document was opening inside Internet Explorer, not Word or Excel.  This is an IE setting you can change.  See http://support.microsoft.com/kb/162059. If my post is your answer, please mark it as the answer. It will bring good karma.Crystal AllianceMy BlogFlorist Blogs  Thank for your answer :...

crystal report export to excel
I tried to export crystal report to excel file, but found that when result set is more than one page, excel file will repeat the page header section for every page, and also have page number in the excel file. what I want is to combine all records with just one page header. Any help will be appreciated....

Export Crystal Report to excel
Dear All,   I have some problem while I am export crystal report to excel. In my case My report header contail 4 rows but while exporting into excel all 4 rows is displayed in one row e.g Report Header: Row 1      ABC Row 2     PQR Row 3     XYZ So after  exporting to excel o/p is Row 1   ABC  Row 2 PQR  Row 3 XYZ But I want O/p is Row 1   ABC Row 2  PQR Row 3  XYZ While i am exporting to PDF it is working Fine But suppose I ex...

Crystal Report
I'm trying to export a .rpt file programmatically to Excel. I've tried ExportToHttpResponse and get a threading error. I've tried .Export() and get "Load report failed." Some simple code I tried which does not work: Dim report As New ReportDocument() report.Load("documents\test.rpt") report.Export() If I try: report.Load(Server.MapPath("documents\test.rpt") ....then I get "Invalid export DLL or export format." This is expected I guess since I never did give it a format type. I don't know how, though. I need this to all be do...

crystal reports export to excel
hi guys,i have deployed my asp.net application on the server with crytal reports components. the problem is, im not able to export the crystal reports to excel whereas export to PDF is working fine. all exports are working fine on local pc.please tel me where i have gone wrong. thanks is your server have install ms excel? ...

Crystal Report Export to Excel #2
Hi everyone, I have a question. How can I export my Crystal Report to Excel in ASP.NET. It seem like the example on the Web is making it so complicated. Please help me, I am stuck with this procedure for a week already. Thanks What example on the web have you tried? I have what I think is a good example at http://blogs.aspadvice.com/rjdudley/archive/2005/03/14/3057.aspx, and an article you might find helpful at http://aspalliance.com/478.If my post is your answer, please mark it as the answer. It will bring good karma.Crystal AllianceMy BlogFlorist Blogs Thank you for your help, but...

Cannot Export Microsoft Excel from Crystal Report
I had develop an application to export data to Microsoft excel from crystal report. My problem is when i execute or run from localhost or by visual studio.net 2003, it will pop up a window then to let us to save, open or cancel. I can Save the Excel Report, But after i put the coding to server, When i try to generate the report, it pop up a window then close directly without any prompt to let us to save, open or cancel Below is my coding: ':: Provide SQL Server logon details to access database :: r.SetDatabaseLogon("xxx", "xxx", "xxx,1400", "xxx&...

Crystal report XI export to excel
Here are the questions 1. With *Can grow* option set to True, When we export to excel the cells are merged to show the contents of text data which cannot fit within the width and height of cell.  Is there any option to export the formatted report with individual columns data contained within single cell. When No *can grow*, it truncates the content to the width of column set ?2. Is it possible to freeze the header row/column of crystal report when we scroll down or right to view more rows/columns ? If any one shed a little light on limitations(on design / performance related) on CR XI...

Problem with Crystal Reports Export to Excel
Hi, I am using the crystal reports export option to export the data into Excel. I am getting this error. "Error in File E:\\TimeTracker_V2\\Source\\Reports\\MonthlyOverviewRpt.rpt: Access to report file denied. Another program may be using it." I have given the write permissions to ASPNET process to the perticular folder where it is writing the excel file and also to C:\WINDOWS\temp directory. But still I am facing the problem. Please help me out by solving this problem. (Operating system is Windows XP). Exception is raising when  crRptDoc.Export(); method is calledTha...

problem in exporting crystal report to excel
On export of crystal report to an excel file I face the following problems.1.Border of the cells are not visble in the excel sheet.2.Some columns are getting overlapped.please provide me the steps to solve this problem.-krishan manral...

Exporting a report from VB.NET to Excel
Hi, I have one problem while exporting a report to excel. I need some columns will be formatted like 1,234,567.89. For doing this i have used the next line: Response.Write("<td align=right border=1>" & CStr(Format(rowItem.ItemArray(j), "#,##0.00")) + "</td>") The  problem i have is that this is working fine in my machine and in my test web server, but in the production server, when the value is 0, excel types "0" instead of "0.00".   I think this is a problem of web server configuration, i've tried to change the regional settings by selecting 2 decimals, but it...

integration of Crystal Report with .NET ; crystal report viewer not displaying in Toolbox
Hi I m new to Visual Web Developer 2005 Express Edition. I want to integrate Crystal Report with .NET. In my Toolbox , Crystal Report Viewer is not displaying. How to make it possible? + How to call my report from asp.net 2.0. Need source code plz.*Share Knowledge Every TIME Crystal Reports for .NET does not come with VWD Express.  It only comes with VS 2005 Professional (I'm not sure about the Standard edition).If you have Crystal Reports 10 or XI, you can installed the .NET libraries for Crystal and then use them within VWD Express, noting that you have to build your reports ...

Web resources about - Exporting to Excel in Crystal Reports .NET - Perfect Excel Exports - asp.net.crystal-reports

Gas Exporting Countries Forum - Wikipedia, the free encyclopedia
The Gas Exporting Countries Forum ( GECF ) is an intergovernmental organization of 11 of the world's leading natural gas producers made up of ...

Facebook Updates Comments Box Plugin With Comment Exporting and Larger News Feed Stories
Facebook today released several updates to the newest version of its Comments Box social plugin for third party websites that will increase the ...

Lower dollar a boon for Canberra's wine exporting king
It may mean more expensive holidays for some, but one ACT registered company has enjoyed a profitable time thanks to the sharp fall in the Australian ...

Irish plant shut for exporting horsemeat
Sky News is Australia's leader in 24-hour news.

New online freight marketplace Cargohound aims to be the Uber of exporting
Cargo Hound wants to revolutionise the way goods are shipped from Australia.

Exporting the desperate; out of sight ... and mind
The boats have stopped, the point's been made, so why continue to treat those already ''here'' with such unconscionable cruelty?

Meat market: Andrew Forrest sees fortune in exporting beef to China
China is so desperate for good beef that Australian billionaire Andrew Forrest will be taking sample parcels of steak in his luggage on his next ...

Exporting carbon and hypocrisy: our big growth industry
Never mind our modest cuts to local emissions, new research shows Australia is heading into a carbon export boom.

Montreal men accused of illegally exporting railway equipment to Iran
Two Montreal men are charged with illegally exporting American-made railway equipment to Iran, violating Canada's Export and Import Permit Act ...

Lee Specialties Ltd. Charged With Exporting Prohibited Commodity To Iran
CALGARY - Putting the wrong address on a $15 shipment of synthetic rubber rings has cost an Alberta company $90,000 for violating legislation ...

Resources last updated: 12/7/2015 2:40:19 PM