Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: Suppress Page Footer when Exporting to Excel Post Reply Post New Topic
Author Message
Nugby
Newbie
Newbie
Avatar

Joined: 08 Oct 2009
Location: Australia
Online Status: Offline
Posts: 5
Quote Nugby Replybullet Topic: Suppress Page Footer when Exporting to Excel
    Posted: 08 Oct 2009 at 10:31pm
Hey guys, not too familiar with Crystal Reports but have inherited a couple of reports within a VS2005 project. Everything's been working fine in them, but if Users want to Export them to Excel, the Page Footer section looks really out of place. Does anyone know how to Suppress this when exporting to Excel?
 
I've been looking at the VB.Net cmdExport code (it's not the default Export button), and using Suppress' Formula Workshop in the Section Expert, but I'm not having much luck and I can't find any examples of anyone doing this. Does someone know or could they point me in the right direction?
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 09 Oct 2009 at 11:06am
The easiest way would be to add a formula to your report called SuppressFooter and just have it return the value False. Then put this in the Suppress formula for the footer in the Section Expert. To test it, run the report and you should see the footer always.

Second, go into your VB.NET app and prior to calling the Export function, set that formula to be True. The following code sample could be used:

myReport.DataDefinition.FormulaFields("SuppressFooter").Text = "True"

Replace "myReport" with the variable name of your report object.

It may be helpful for you to pick up a copy of my CR Encylcopedia v2 which has tons of code samples for VB.NET/C# integration with Crystal Reports.

Amazon.com



Edited by BrianBischof - 09 Oct 2009 at 11:06am
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Nugby
Newbie
Newbie
Avatar

Joined: 08 Oct 2009
Location: Australia
Online Status: Offline
Posts: 5
Quote Nugby Replybullet Posted: 11 Oct 2009 at 2:33pm
Wow, that works! Thanks Brian!
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.