cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports Excel Export Issue - page footer not being displayed

Former Member
0 Kudos

We recently converted all Crystal Reports from Visual Studio 2003 to Visual Studio 2005 sp1, .NET 2.0, Crystal Reports for .NET. I have the latest merge modules from business objects. All reports & footers worked fine in VS2003 ... but now when I export to PortableDocumentFormat (PDF) or WordForWindows (DOC) the page footers appear correctly. But, when I export to Excel (XLS) like the code below, the page footers do not appear. We need to place a disclaimer at the bottom of every page of an exported excel document. I checked the print preview, and I tested printing the document ... the the footer is not being utilized properly by the Crystal Reports export.

System.IO.MemoryStream oStream = new System.IO.MemoryStream() ;

oStream = (System.IO.MemoryStream) report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.Excel) ;

Response.Clear() ;

Response.Buffer = true ;

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

Response.BinaryWrite(oStream.ToArray()) ;

Response.End();

I have asked the question in msdn forum

http://forums.msdn.microsoft.com/en-US/vsreportcontrols/thread/0ead9e34-bc45-4062-90dd-17f8f8ebf062

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Have you tried upgrading the reports?

You need to open the reports from VS2005, remapped the fields(click on the Crystal Reports in Menu -> Database -> Set Datasource location and map the fields), preview it and resave them. Try to use them now.

Hope it helps !

AG.

Former Member
0 Kudos

thanks for the response. yeah, we've upgraded and re-mapped all reports. we've also just tried creating brand new from scratch reports in vs2005 and get the same results. to me it seems like a bug or defect in the Export dll or whatever is used by crystal reports to export the web rpt to xls format?

Former Member
0 Kudos

also, this has been reported in a 2nd msdn thread just recently too http://forums.msdn.microsoft.com/en-US/vscrystalreports/thread/3c0f40e5-f7ac-40bc-a9e3-552cb01f2042

and it has been asked by others with no solution yet that i see

http://forums.asp.net/p/1276291/2430976.aspx

Edited by: neon primetime on Jul 1, 2008 9:54 PM

Former Member
0 Kudos

Reports at my end works fine however I did not use the Streams as you did.

Can you please tell me the File version of crxf_xls.dll.

Former Member
0 Kudos

fyi - if i hadn't mentioned it, problem occurs in all our environments (developer workstation, development server, testing server, production server, etc.)

-


on my development workstation i found the file 3 times

-


c:\program files\common files\business objects\1.0\bin\crxf_xls.dll

has file version 9.1.1.557

c:\program files\common files\business objects\2.7\bin\crxf_xls.dll

has file version 10.2.0.1093

c:\program files\common files\business objects\3.0\bin\crxf_xls.dll

has file version 11.0.0.1937

-


-


on my development server (and our other environment servers too)

-


c:\program files\common files\business objects\2.7\bin\crxf_xls.dll

has file version 10.2.0.1210

-


so just from that i notice that the file versions in the 2.7 bin are different from my developer workstation to my development server ... but the issue still occurs in both places.

Former Member
0 Kudos

Is your Vs edition a professional, Developer or Standard ? Crystal do not integrate with Express edition.

Former Member
0 Kudos

Microsoft Visual Studio 2005 Professional Ediction

Version 8.0.50727.762 (SP.050727-7600)

former_member208657
Active Contributor
0 Kudos

Exporting the page header and footer for each page of an Excel doc was something we introducted in the SDK with Crystal Reports XI R1. It isn't available with Crystal Reports for Visual Studio .NET 2005 or Crystal Reports 10.

You can use this with Crystal Reports XI by manipulating the ExcelFormatOptions.ExportPageHeadersAndFooters.

Former Member
0 Kudos

Something that I tried in VS2005 and CRXIR2SP2 (higher that 10) to bring the footer contents in every page:

ReportDocument RDObject = new ReportDocument();

// Loading the report

RDObject.Load(Server.MapPath("Employee Sales.rpt"));

// Passing the parameter to report

RDObject.SetParameterValue("Employee ID","AFTRD");

ExportOptions exop = new ExportOptions();

// Setting the format to Excel type

ExcelFormatOptions excel = ExportOptions.CreateExcelFormatOptions();

exop.ExportFormatType=ExportFormatType.Excel;

exop.ExportFormatOptions=excel;

// Enabling the headers and footers for each page

excel.ExportPageHeadersAndFooters = (ExportPageAreaKind.OnEachPage);

CrystalReportViewer1.ReportSource = RDObject ;

// Exporting the report

RDObject.ExportToHttpResponse(exop, Response, true, "");

Hope it helps !

AG.

Former Member
0 Kudos

If you try the code in VS2005 and bundled CR then you might get an error something like

"CrystalDecisions.Shared.ExcelFormatOptions' does not contain a definition for 'ExportPageHeadersAndFooters' "

I got it!

AG.

Former Member
0 Kudos

David said

>>> Exporting the page header and footer for each page of an Excel doc was something we

>>> introducted in the SDK with Crystal Reports XI R1. It isn't available with Crystal Reports for Visual

>>> Studio .NET 2005 or Crystal Reports 10.

I just need some clarification cause I'm slightly confused. It worked in Visual Studio .NET 2003 with CR bundled, but then it didn't work in Visual Studio .NET 2005 with CR bundled. So it sounds to me like it isn't being "introduced" but rather an issue that would get "fixed"? Thank you.

Edited by: neon primetime on Jul 3, 2008 3:37 PM

former_member208657
Active Contributor
0 Kudos

I see what you mean re: the behavior in the 9.1.5000 runtime vs. the 10.2.3600. The page header/footers will be exported for each page break in the CR for .NET 2003 runtime. I haven't found a way to change the behavior for the CR for .NET 2005 runtime.

In some of the other versions of Crystal it looks like there is some registry key control over this. But version 10 is when we moved over to using RAS in-process with the .NET SDK. This changed how we looked for some of the reg keys.

See kbase c2011913 for reg key info here http://technicalsupport.businessobjects.com.

I'll look into this a bit more and see what I can find out. In the meantime if you want a solution now you can upgrade to Crystal Reports XI R2 or 2008. If I do determine this is a change in behavior or regression I'm not confident this will be resolved. A lot of time has passed since this product was released and it is a minor irritation that is easily fixed with an upgrade.

Answers (0)