views:

597

answers:

2

I'm trying to send faxes with a .NET (C#) program using Crystal Reports and Unimessage Pro (or any other fax program).

My problem is that Unimessage Pro (and other fax programs) uses printer fonts for the fax commands. Since .NET doesn't support printer fonts the fax commands in the report are converted to Courier New. The result of this is that the fax program doesn't recognize the fax commands but sees them as plain text and the fax isn't sent.

How do I send a fax with Crystal Reports and .NET?

A: 

When you say uses printer fonts, I'm assuming that you need to send some PCL (or similar) commands such as:

<esc>(s.....

If that's the case I don't think you can embed that in that with Crystal directly.

We've had to send special sequences in the past through Crystal (without the Escape), in these cases we create a new Formula box and don't change any of the elements other then the font (choose Courier). These elements should pass right to the printer without being converted too much by the driver. This may; however, not solve your problem.

The other option that should work is to build your own printer driver with Microsoft's Driver Development Kit. You can create your own Mini Driver and associate a font with a specific font call so when you specify that font you get the code inserted into your code properly.

You could also process this in the manner that we do (not with Crystal but another similar reporting too). We use RightFax as our fax server and it allows for the 'attachment' of files through a metadata file. We generate the report, put it into a specific location as a PDF or other format and then pass RightFax an metadata file that contains the fax number of the recipient and a command that tells it to attach the file on the filesystem.

The RightFax 'attach' file looks something like this:

{{begin}}
{{nocover}}
{{fax (403) 555-1212}}
{{subject Test Fax}}
{{attach c:\reports\report1.pdf delete}}
{{imagetype pdf}}
{{end}}
Douglas Anderson
+3  A: 

I got this answer from WordCraft (company behind Unimessage Pro)

  1. Create a file named WilCapAX.INI in the main Windows folder, e.g. C:\Windows\WilCapAX.INI The file should contain the following: [WilCapAX] Commands=C:\Commands.DAT Where "C:\Commands.DAT" is the name of a text file you are going to create in your .NET application to pass the
    embedded commands to Unimessage Pro. You can edit the path if necessary, but keep to short form file and
    folder names.

  2. In your .NET application when you have something to send via
    Unimessage Pro you then need to:

    2.1 Create a text file named, depending on the name defined in WilCapAX.INI, C:\Commands.DAT containing:

     BLANK LINE
     [[TO=Fax Number or Email address]]
     [[SUBJECT=Whatever you want the subject to be]]
    

    The first line of the file must either be blank or contain something other than an embedded command - it will be skipped. The other lines in the C:\Commands.DAT file should each contain an embedded command.

    2.2 Print ONE message to the Unimessage Pro printer - the Unimessage Pro printer accept the print job and will look for the file specified in WilCapAX.INI. If the file specified in WilCapAX.INI (C:\Commands.DAT) is found, embedded commands are extracted from it and then the "C:\Commands.DAT" file is deleted and the print capture processed together with the command extracted from the C:\Commands.DAT file.

    2.3 Wait for the C:\Commands.DAT file to disappear (indicating that it has been processed by the Unimessage Pro printer) and then repeat as necessary.

This solved the problem! :)

Jonas Rindberg