Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Crystal Reports and Selecting a default printer
Message
De
15/09/2000 10:09:20
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Titre:
Crystal Reports and Selecting a default printer
Divers
Thread ID:
00416855
Message ID:
00416855
Vues:
60
Hi all, I have a common situation I'm sure most of you have ran into. I think it would be (if it is not already) a great FoxTalk article.

I am using VFP 6 and Crystal Reports 8 RDC.
I am also using the SmartViewer (crviewer) dropped on a form (CrystalViewer)

All of the reports in my app are pretty standard, they come up in the preview, the user clicks the printer icon, I ask for the printer and they print the report.

I have a few reports that I need to show in the preview and then print on pre-printed forms. That means that I don't print all the lines that show in the preview. I chose to accomplish this by creating a duplicate of the report without the lines and boxes.

I also need to give the user the choice of printing these reports to a different printer. To complicate this just a little more, the user wants the ability to choose the printer for these special reports the first time they run them and then have them print to that printer from then on.

Here's what I've got so far.

I created a table (reportsinfo) to store the reports info.
It has 4 fields - ReportName,PrintFileName,PrinterName,PrinterPort

In the crviewer ---

crviewer.PrintButtonClicked()
LPARAMETERS usedefault
usedefault = .F.

** Call a method with the report name that searches the table and if found, returns the options for this report.

** If it was found, I check if there is a default printer already set for this report. If so, I run the following:

loReport = .oEngine.openreport(lcPrintFileName,1)
loReport.SelectPrinter('',PrinterName,'')
loReport.PrintOut(.F.,1,.F.)

I don't understand what to pass in the drivername or the portname parameters in the SelectPrinter(). Where do I get this? This is what I need to store in the reportsinfo table the first time they run the report. The PrinterSetup Method doesn't return anything. It just sets the printer to this report.

Sorry for so long a post, but I think this is a fairly common situation. Users have a dot matrix printer loaded with preprinted forms that they only want one report to go to. All other reports normally go to their laser (local or network).

Am I way off base here? Thanks WAY In Advance!:)
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform