views:

119

answers:

2

Hi,

I want to add some text (from a formula) to my crystal report. the thing is: I want this text only to be visible if I export the report to HTML for instance. I don't want to see the text if I print the report.

Can it be done?

bye Juergen

+1  A: 

Short answer: no. Crystal Reports, even v2008, doesn't have a mechanism to distinguish when it is being printed.

You could use a parameter field to set the field's visibility, but this will be a manual process.

You might be able to write a user-function library (UFL) to use the Windows API to determine the state of the document and return it to the report. The challenge would be to 1) find an API that can determine a document's print state 2) determine the report's 'handle'. I would go the c/c++ route for building such a UFL.

Craig
OK thank you guys. I guess I will handle it with an input parameter of my stored procedure that fills the CR.
Juergen
A: 

I don't think it's possible. The simplest way around your issue is to make 2 different versions of your CR report, 1 for HTML and 1 for printing.

A little redundant, yes, but it gets the job done.

PowerUser