It’s been a while since I published part 1 but hey, better late than never. So here’s Part 2 of my previous blog “Crystal Reports Export to Excel – Part 1”. I have used the same report from Part 1.
The following tips & tricks will help you in providing a perfect/clean export to Excel from Crystal Reports (Refer to the Part 1 blog for Tips 1 through 6)
Tip 7 – Printer Setting: I created a copy of the report which I used for my Part and when I tried to open the report on a different system, I get the warning message below.
Here’s what you need to do to get rid of this message irrespective of the source system. Navigate to File -> Page Setup and remove the check mark next to “Dissociate Formatting Page size and Printer paper size”. You can also change the orientation and this will be retained in the Excel print orientation as well
Tip 8 – Alternate row colors: Most of the users love alternate row colors for their reports. I’m going to show a method that I did first and why it wasn’t an accepted solution by the Business user. I will then discuss the work around solution to accomplish the user’s request
On the Details section navigate to “Section Expert -> Color” Tab and select the check mark next to Background color.
Click on the formula workshop icon and enter the formula shown below. The comments will show the different colors that you can use. You could use RGB codes as well.
Now the report shows up alternate colors.
I though I was done, but when our user exported this to Excel, it was found that all the column in excel had alternate colors too. They wanted alternate colors only for the cells/columns that had data. I had to remove the unwanted column coloring.
Tip 9 – Alternate colors for selected cells : Select every single object on the report, right click and select Format Field.
In the border Tab, enter the same formula that we had created.
Also make sure the formula that was added in the Section Expert is removed or commented
The crystal report preview looks the one below and the excel output looks crisp with alternate colors only for the cells with data.
Tip 10 – Grid Lines : to have grid lines on the excel, select File -> Export -> Report Export Options – > Microsoft Excel and select the option “Show gridlines”
Stay tuned for my next blog post.