Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Outputting report in .PDF with Acrobat 4
Message
De
18/06/1999 15:07:54
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00228100
Message ID:
00231547
Vues:
25
>>
>>After several hours of trial and error, and more than a few blind alleys, I discovered the problem. The reason for my report snafu was.....I was using the wrong kind of macro substitution.
>>
>>If you look at the code I posted, the report was actually being called with the line:
>>REPORT FORM (tcLayoutName) NOCONSOLE TO (lcOutputFile)
>>
>>After all else failed, I took a look at this line and wondered "What if I used the ampersand substitution instead?" I went ahead and changed the line to:
>>REPORT FORM (tcLayoutName) NOCONSOLE TO &lcOutputFile.
>>
>>PERFECT! It worked right the first time out, with no additional monkeying around with stripping off the .PDF or trying to detect which version of Acrobat I was using. I did some regression testing, and it works perfectly with Acrobat 3.01 and 3.02 as well.
>>
>
>I did not suggest the "&" macro substitution because () are often better. Try a directory change with a long file name containing spaces and you'll see what I mean...

You can still use & with long filenames including spaces, if you surround the whole thing in quotes, like this:

REPORT FORM (tcLayoutName) NOCONSOLE TO "&lcOutputFile."

When I learned about macro substitution still working within quotes, I was almost angry - I was taught in other languages that no compiler will ever dare question what you say between quotes. Actually, the feature is sometimes cool, though it can usually be circumvented by using simple concatenation:

lcName="world"
? "Hello &lcName, how are you"
? "Hello "+lcname+", how are you"

The two solutions are equivalent and the other is actually cheaper - but in moments like this, the macro is handy. Who'd ever think there may be a situation where a name expression wouldn't work? Well, there was a hint - this is not a regular file name, and/or not a regular printer, this is printer redirection via custom driver... I'd better remember this one, might be useful.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform