mibuso.com

Microsoft Business Solutions online community
It is currently Fri Aug 01, 2014 7:48 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 298 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8, 9 ... 20  Next
Author Message
 Post subject:
PostPosted: Wed Jun 25, 2008 3:32 am 
Offline
MVP Microsoft Dynamics NAV

Joined: Tue Aug 14, 2001 7:01 am
Posts: 5349
Location: Prague
Country: Czech Republic (cz)
ptech5443 wrote:
Does anyone know if this works with Nav 2.60 US? I am trying to use this functionality and have run into an issue with the following line of code:

PDFCreator.cOptions := PDFCreatorOption;

I get the following error

A maximum of 0 parameters must be used when calling the function.

Does anyone know what I am doing wrong?


Its the same as this.

David Singleton wrote:
Oh an d the reason I was actually here....


Has anyone else come across the error where PDF objects created in ver. 0.9.3 won't run on 0.9.5 and vica versa. Basically the comand below will only run on a coumputer running the same version of PDFCreator that it ws complied with.

The issue is the command
Code: Select all
PDFCreatorOption :=  PDFCreator.cOptions;


Which gives the message:

Quote:
This message is fo C/AL programmers:
Invalid assignment. It is not possible to assign a _clsPDFCreatorOptions to a clsPDFCreatorOptions.


Its clearly an issue with wich dll you have registered, and I am pretty sure its a PDF creator issue, not a NAV issue.

Its damn anoying having to use a different computer to compile objects to get this to work, and worst is when a client has computers with differnt version of PDF creator installed.

Has anyone solved this?

_________________
David Singleton
Dynamics NAV Freelancer
Dynamics Book
Go-Live International


Top
 Profile E-mail WWW  
 
 Post subject: How to save Navision Reports as PDF
PostPosted: Thu Jun 26, 2008 11:12 pm 
Offline

Joined: Mon Apr 22, 2002 7:01 am
Posts: 25
Location: USA
Country: United States (us)
David,
Thanks for the reply.

I found that the same code did indeeed compile and then work as deisgned after I opened the same database using Nav 4.0 SP3. So I am going to assume that the exe version was the issue and not the version of PDF creator.

ara3n,
Thanks for the example. =D>


Top
 Profile  
 
 Post subject: Re: How to save Navision Reports as PDF
PostPosted: Thu Jun 26, 2008 11:56 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Wed Dec 15, 2004 6:11 pm
Posts: 9032
Location: 3rd rock from sun
Country: United States (us)
ptech5443 wrote:
David,
Thanks for the reply.

I found that the same code did indeeed compile and then work as deisgned after I opened the same database using Nav 4.0 SP3. So I am going to assume that the exe version was the issue and not the version of PDF creator.

ara3n,
Thanks for the example. =D>


You are welcome and happy coding.

_________________
Rashed.

blog: http://mibuso.com/blogs/ara3n/


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 07, 2008 9:40 am 
Offline

Joined: Fri Oct 26, 2007 2:20 pm
Posts: 70
Location: Hyderabad
Country: India (in)
Hello ara3n,
[b]When I compiled it, it showed me a error as [You connot enter 'Item List' in ReportNo.Then the cursor jump to OnOpenForm() trigger where have a statement is
ReportID := REPORT::"Item List";

Did I have do anything wrong? :?: or do you have a report call "Item List"? then I need to change to any of mine?
thank you.


Did I made anything wrong, can u tell me where I went wrong

Thank you


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Mon Jul 07, 2008 9:49 am 
Offline

Joined: Fri Oct 26, 2007 2:20 pm
Posts: 70
Location: Hyderabad
Country: India (in)
I am sorry , I found the error..


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Mon Jul 07, 2008 12:40 pm 
Offline

Joined: Fri Oct 26, 2007 2:20 pm
Posts: 70
Location: Hyderabad
Country: India (in)
hi ara3n,

It is very good. Thanks for u r help.


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Fri Jul 11, 2008 3:13 pm 
Offline

Joined: Thu Apr 12, 2007 12:09 pm
Posts: 37
Location: Drogheda
Country: Ireland (ie)
Hi there,


I have implemented this PDF Creator solution and it is working very well for me apart from one problme.

Randomly, the PDFCreator program will not close when the PDFCreator.cClose(); function is called.


Has anyone experienced this issue???

Thanks,

Jay


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 31, 2008 4:00 pm 
Offline
NAV TechDays 2014 attendee

Joined: Mon May 07, 2007 11:47 am
Posts: 102
Location: At Work
Country: Netherlands (nl)
Jay,

Same problem here. But not randomly :? .
And in NAV the Dialog Processing is open.
The PDFCreator keeps running in the Task Manager.
After ending it, NAV returns an error: could not invoke...

Maarten


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 31, 2008 4:48 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Wed Dec 15, 2004 6:11 pm
Posts: 9032
Location: 3rd rock from sun
Country: United States (us)
I'm thinking of creating another example using another pdf printer. I will keep you guys posted.

_________________
Rashed.

blog: http://mibuso.com/blogs/ara3n/


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 31, 2008 4:59 pm 
Offline
NAV TechDays 2014 attendee

Joined: Mon May 07, 2007 11:47 am
Posts: 102
Location: At Work
Country: Netherlands (nl)
I remember using pdf995 long time ago.
Does anyone have experience with this one recently?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 01, 2008 4:58 am 
Offline
MVP Microsoft Dynamics NAV

Joined: Wed Dec 15, 2004 6:11 pm
Posts: 9032
Location: 3rd rock from sun
Country: United States (us)
Ok here is another solution using BullZip PDF Printer.

http://mibuso.com/blogs/ara3n/


direct link
http://mibuso.com/blogs/ara3n/2008/08/0 ... ts-to-pdf/



Code: Select all
OBJECT Form 50101 Example Report to PDF files
{
  OBJECT-PROPERTIES
  {
    Date=07/31/08;
    Time=10:44:15 PM;
    Modified=Yes;
    Version List=PDFCreator;
  }
  PROPERTIES
  {
    Width=9460;
    Height=3960;
  }
  CONTROLS
  {
    { 1000000000;CommandButton;990;660;5060;1210;CaptionML=ENU=Print and save as PDF;
                                                 OnPush=BEGIN
                                                          PrintToBullZip;
                                                        END;
                                                         }
  }
  CODE
  {
    VAR
      FileDirectory@1000000000 : Text[100];
      FileName@1000000010 : Text[100];
      ReportID@1000000001 : Integer;
      Object@1000000002 : Record 2000000001;
      BullZipPDF@1000000004 : Automation "{61CB5BFA-AFE6-4B0F-A4BB-7F3D4999EE52} 3.2:{BEBDC1DF-D793-4F6C-B8FF-E831A1C2595C}:'Bullzip'.PDFPrinterSettings";
      Window@1000000007 : Dialog;
      RunOnceFile@1000000005 : Text[1000];
      TimeOut@1000000006 : Integer;
      Customer@1000000003 : Record 18;
      Customer2@1000000011 : Record 18;

    PROCEDURE PrintToBullZip@1000000000();
    BEGIN
      IF ISCLEAR(BullZipPDF) THEN
        CREATE(BullZipPDF);

      ReportID := REPORT::"Customer - List";
      FileDirectory := 'C:\';

      Window.OPEN('processing  Cusomer ######################1##');

      Object.GET(Object.Type::Report,'',ReportID);

      IF Customer.FINDSET THEN REPEAT
        Window.UPDATE(1,Customer."No.");
        FileName := Customer."No." + '.pdf';
        BullZipPDF.Init;
        BullZipPDF.LoadSettings;
        RunOnceFile := BullZipPDF.GetSettingsFileName(TRUE);
        BullZipPDF.SetValue('Output',FileDirectory+FileName);
        BullZipPDF.SetValue('Showsettings', 'never');
        BullZipPDF.SetValue('ShowPDF', 'no');
        BullZipPDF.SetValue('ShowProgress', 'no');
        BullZipPDF.SetValue('ShowProgressFinished', 'no');
        BullZipPDF.SetValue('SuppressErrors', 'yes');
        BullZipPDF.SetValue('ConfirmOverwrite', 'no');
        BullZipPDF.WriteSettings(TRUE);
        Customer2 := Customer;
        Customer2.SETRECFILTER;
        REPORT.RUNMODAL(ReportID,FALSE,FALSE,Customer2);

        TimeOut := 0;
        WHILE EXISTS(RunOnceFile) AND (TimeOut < 10) DO BEGIN
            SLEEP(1000);
            TimeOut := TimeOut + 1;
        END;

      UNTIL Customer.NEXT = 0;

      Window.CLOSE;
    END;

    BEGIN
    {
      Author: Ahmed Amini
      Email: ara3n(NOSPAM)@hotmail.com
    }
    END.
  }
}




You can download BullZip Freeware from

http://www.bullzip.com/download.php

_________________
Rashed.

blog: http://mibuso.com/blogs/ara3n/


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 02, 2008 4:54 am 
Offline
MVP Microsoft Dynamics NAV

Joined: Wed Dec 15, 2004 6:11 pm
Posts: 9032
Location: 3rd rock from sun
Country: United States (us)
Btw bullzip doesn't have a way to change the the pdf printer to default printer, so you have to set it up in printer selection in NAV. Or make the pdf Printer as default.

Bullzip works on vista and 64 bit compatible.

_________________
Rashed.

blog: http://mibuso.com/blogs/ara3n/


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 02, 2008 7:48 am 
Offline
NAV TechDays 2014 attendee

Joined: Mon May 07, 2007 11:47 am
Posts: 102
Location: At Work
Country: Netherlands (nl)
Thanx Rashed,

What a SERVICE!

This is what I added to make Bullzip default printer.

Code: Select all
IF NOT lPrinterSelection.GET('',lReportID) THEN BEGIN
  lPrinterSelection.INIT;
  lPrinterSelection."Report ID" := lReportID;
  lPrinterSelection."Printer Name" := 'Bullzip PDF Printer';
  lPrinterSelection.INSERT;
END;


Works great!
Thanx again.

Maarten


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 02, 2008 5:06 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Wed Dec 15, 2004 6:11 pm
Posts: 9032
Location: 3rd rock from sun
Country: United States (us)
That's a good solution with printerSelection that the user could add to the code.
I would add USERID in there as well. So just in case other people are printing the same report and it doesn't automatically select that printer.
Or maybe delete the record at the end of the process

_________________
Rashed.

blog: http://mibuso.com/blogs/ara3n/


Top
 Profile  
 
 Post subject: Should I place thd code ins a form, report or code unit?
PostPosted: Fri Aug 22, 2008 11:46 pm 
Offline

Joined: Wed Sep 26, 2007 6:38 pm
Posts: 31
Location: California
Country: United States (us)
Hello guys,

I'm all confused, should I create a report, a form or a code unit to place the code that is on the top.

Also should I delete "{}"? since NAV ignore the code that is between {}. What should I do.

Help please, I'm trying to implement automatic report with job scheduler and send them via email.
do you think that using this code may help? I'm using NAV 3.70

Thank you for all your support.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 298 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8, 9 ... 20  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: