I do not remember if 2.5SP4 has the PDF writer, but otherwise, grab the PDFViewer class from a 3.0 and backport it + change the classFactory method where it is being referenced (look in 3.0 for the switch/case in the createViewer method).  You have to be creative with the ReportOutputUserType enum.
 
With regards to forcing the writer as a printer, you can then do the following in init():
 
    element.printJobSettings().setTarget(PrintMedium::ViewerClass);
    element.printJobSettings().viewerType(ReportOutputUserType::PDF);    // Here you need to be creative as "PDF" does not exist in 2.5, but it should just correspond to whatever you have in the createViewer() method in classFactory...
    element.printJobSettings().fileName("here goes your PDF file name");
 
And override the prompt() method on the report with this:
 
    public boolean prompt(boolean _enableCopy=TRUE, boolean _enablePages=TRUE, boolean _enableDevice=TRUE, boolean _enableProperties=TRUE, boolean _enablePrintTo=TRUE)
    {
        return true;
    }
 
Now, this should work in theory, however, I have not tried it on 2.5, and it may take a little tweaking...


From: Axapta-Knowledge-Village@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jayson Joseph Thattil
Sent: Tuesday, May 03, 2005 9:37 AM
To: Axapta-Knowledge-Village@yahoogroups.com
Subject: Re: [Axapta-Knowledge-Village] PDF Writer

Hi Thanks for the reply

We have Axapta 2.5 does not have PDF as the format
Is there any this can be added in 2.5?

TJJ
--- Varden Morris <[EMAIL PROTECTED]> wrote:
> After printing the report to screen select the print
> icon. From the "send to" list on your left select
> "email recipient". A frame with the title
> specification will then appear on the right. For the
> "Message format" in the frame select PDF and then
> select OK. The mail client will then popup and you
> should be able to complete the process on your own.

>
> Varden Morris
>

>
> J. Wray & Nephew Ltd. - Group I.S.
>
> 234 Spanish Town Road
>
> Kingston 11, Jamaica, W.I.
>

>
> Phone:  (876) - 923 - 6141 Ext. 2226
> Fax:      (876) - 923 - 5372
>
> Cell:      (876) - 3833566
> Email:   [EMAIL PROTECTED]
>             [EMAIL PROTECTED]  
>
> tj_jayson <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> Is it possible to select Acrobat writer as printer
> by X++ code always
> for Quotation report?
>
> If so Is it possible create the PDF file and send it
> as attachment
> from axapta automaticaly  with a single button click
> by X++ code?
>
> Our system is Ax 2.5 SP4
>
> Can any body help me on this request?
>
> Thanks for all your help
>
> TJJ
>
>
>
>
>
>
>
>
>
>
>
> Sharing the knowledge on Axapta.
>
>
>
> ---------------------------------
> Yahoo! Groups Links
>
>    To visit your group on the web, go to:
>
http://groups.yahoo.com/group/Axapta-Knowledge-Village/
>  
>    To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
>  
>    Your use of Yahoo! Groups is subject to the
> Yahoo! Terms of Service.
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.com

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com





Sharing the knowledge on Axapta.



Sharing the knowledge on Axapta.



Yahoo! Groups Links

Reply via email to