Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
5
Erster Beitrag:
vor 8 Jahren, 4 Monaten
Letzter Beitrag:
vor 8 Jahren, 4 Monaten
Beteiligte Autoren:
Al, Fabrice Harari

[WD12 - 14] Print preview

Startbeitrag von Al am 30.07.2009 11:42

Hello All

I think that, based on the recent posts and my own bad experiences with emailing from the Print Preview window that there are some structural problems in its internal email procedures. It doesn't matter to me if the problem lies with PCSoft or Outlook, I need to get a resolution to the issue

I thought I would explore the option of managing the emailing of pdf documents with my own process - a simple smtp session - and I have spent the past day trying to replace the native preview buttons options with my own but with no success so I am asking for ideas please.

The problem is that the whole Print Preview window is a black box with no coding and that to make it work PCSoft break all the procedural rules they make us follow and manage to set the destination on the fly in the middle of the report process, but the only avenue open to us is to declare an IDestination() before running IPrintReport().

The main thing I am trying to do is quite simple, show a report onscreen in the print preview window and let the user decide if they want to print or generate a pdf file and then email it as an attachment. I can achieve this by setting up the report beforehand to have pdf as its destination but then I loose the ability to allow the users to view the report decide to do this on an adhoc basis. I have tried replacing the email pdf button with a call to my own email window and that works but I can't capture the pdf file name if it is generated from the native preview button as it does not put a value into the ILastFile variable. Also trying to run the native preview PDF button with executeprocess() doesn't work as nothing happens unless the user clicks on it. I can live with that but I then need to know the name and location of the pdf file that was created so I can pass it to my email program

I am hoping that someone has a simple way to capture the file name generated from the native PDF preview button.

I have sent in a request to Tech Support to enable the pdf button to load its file name into the ILastFile variable and asking them for any suggestions so I will pass othe resultys of that request.


Regards
Al

Antworten:

Hi Al...

what I would try to do is the following :
- forget the original process/button
- make the button in question invisible (or delete it, whatever works)
- Add a custom button (with another name)
- in this button code, set a boolean to true (global to the project), then CLOSE the preview window
- in the code after the opening of the preview window, test the boolean
- if true, print the report a second time as a pdf (here, you know the name), then send the email with it

Best regards



von Fabrice Harari - am 30.07.2009 13:25
Hello Fabrice

Thanks for the idea - some lateral thinking - I was getting hung up on making the PrintPreview work but I will have to accept that working within the PrintPreview is impossible.

The method you suggest should work ok and our printing processes are very structured so adapting them to run again to a pdf will be quite simple.

It just bugs me that such a simple thing like PCSoft putting the pdf file name into the ILastFile variable (as the help doco implies) would save all that.

Regards
Al

von Al - am 30.07.2009 13:43
Hi Al

if the only thing blocking you is the name fo the pdf file, you should be able to set it yourself using iParameterExport(iExportFile, "YourFileName")

best regards



von Fabrice Harari - am 30.07.2009 14:37
Hello Fabrice

Thanks for the additional thought, unfortunately the IExport option is only available in V14 so I can't use it for current clients till I convert my apps to V14, so for the moment I will try the earlier option.

Regards
Al

von Al - am 30.07.2009 17:14
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.