Converting Reports to PDF Format

JBhav
Member Posts: 32
Hi,
I have a current Customer Statement report which has No. and DateFilter as required fields. I have to convert this report into PDF format using BullzipPrinter.
I have created a new report[ Customer Statement - PDF] using Customer as Dataitem and entered all the codes for the conversion for the bullzip.
IF ISCLEAR(BullZipPDF) THEN
CREATE(BullZipPDF);
ReportID := REPORT::"Customer Statement";
FileDirectory := 'C:\stat\';
Window.OPEN('Processing Customer ######################1##');
Object.GET(Object.Type::Report,'',ReportID);
---- Customer - OnPredataitem()
LastFieldNo := FIELDNO("No.");
---Customer - OnAfterGetRecord()
Window.UPDATE(1,"No.");
PDFFileName := "No." + '.pdf';
BullZipPDF.Init;
BullZipPDF.LoadSettings;
RunOnceFile := BullZipPDF.GetSettingsFileName(TRUE);
BullZipPDF.SetValue('Output',FileDirectory+PDFFileName);
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);
CustHeader := Customer;
CustHeader.SETRECFILTER;
REPORT.RUNMODAL(ReportID,FALSE,FALSE,CustHeader);
TimeOut := 0;
WHILE EXISTS(RunOnceFile) AND (TimeOut < 10) DO BEGIN
SLEEP(3000);
TimeOut := TimeOut + 1;
END;
Window.CLOSE;
IF RecCustomer.GET("No.") THEN;
IF RecUserSetup.GET(USERID) THEN;
CLEAR(SMAIL);
SMAIL.CreateMessage(USERID,RecUserSetup."E-Mail",RecCustomer."E-Mail","No."+'Sub: Customer Statement',"No."+
'Customer Statement',FALSE);
SMAIL.AddAttachment(FileDirectory+"No."+'.pdf');
SMAIL.Send;
ERASE(FileDirectory+"No."+'.pdf');
When i run this report i get the following error message:
Please specify a filter for the date filter field in the customer table.
In fact, the report is calling the date filter found on the customer statement report.
Can you please advise how we can link these two reports so that the date filter entered in the customer statement - pdf is populated directly in the date filter field of the customer statement report.
Thanks in advance
I have a current Customer Statement report which has No. and DateFilter as required fields. I have to convert this report into PDF format using BullzipPrinter.
I have created a new report[ Customer Statement - PDF] using Customer as Dataitem and entered all the codes for the conversion for the bullzip.
IF ISCLEAR(BullZipPDF) THEN
CREATE(BullZipPDF);
ReportID := REPORT::"Customer Statement";
FileDirectory := 'C:\stat\';
Window.OPEN('Processing Customer ######################1##');
Object.GET(Object.Type::Report,'',ReportID);
---- Customer - OnPredataitem()
LastFieldNo := FIELDNO("No.");
---Customer - OnAfterGetRecord()
Window.UPDATE(1,"No.");
PDFFileName := "No." + '.pdf';
BullZipPDF.Init;
BullZipPDF.LoadSettings;
RunOnceFile := BullZipPDF.GetSettingsFileName(TRUE);
BullZipPDF.SetValue('Output',FileDirectory+PDFFileName);
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);
CustHeader := Customer;
CustHeader.SETRECFILTER;
REPORT.RUNMODAL(ReportID,FALSE,FALSE,CustHeader);
TimeOut := 0;
WHILE EXISTS(RunOnceFile) AND (TimeOut < 10) DO BEGIN
SLEEP(3000);
TimeOut := TimeOut + 1;
END;
Window.CLOSE;
IF RecCustomer.GET("No.") THEN;
IF RecUserSetup.GET(USERID) THEN;
CLEAR(SMAIL);
SMAIL.CreateMessage(USERID,RecUserSetup."E-Mail",RecCustomer."E-Mail","No."+'Sub: Customer Statement',"No."+
'Customer Statement',FALSE);
SMAIL.AddAttachment(FileDirectory+"No."+'.pdf');
SMAIL.Send;
ERASE(FileDirectory+"No."+'.pdf');
When i run this report i get the following error message:
Please specify a filter for the date filter field in the customer table.
In fact, the report is calling the date filter found on the customer statement report.
Can you please advise how we can link these two reports so that the date filter entered in the customer statement - pdf is populated directly in the date filter field of the customer statement report.
Thanks in advance
Regards,
Bhavna
Bhavna

0
Comments
-
can you explain it more clearly, please? in the meantime, i'm doing a guess
.... CustHeader := Customer; CustHeader.SETRECFILTER; CustHeader.SETFILTER("date filter",somedatefilter); // add this REPORT.RUNMODAL(ReportID,FALSE,FALSE,CustHeader);
PS: that report does not exist on my NAV, i guess it is a customized/localized version, isn't it?
moreover...Can you please advise how we can link these two reports so that the date filter entered in the customer statement - pdf is populated directly in the date filter field of the customer statement report.0 -
Yes, it is a customised report.
I have added the following code:
CustHeader.SETFILTER("date filter",somedatefilter); // add this.
It does convert the Customer Statement report into pdf but it does not take the date into consideration. ](*,)
What i meant by:
Can you please advise how we can link these two reports so that the date filter entered in the customer statement - pdf is populated directly in the date filter field of the customer statement report.
In the customised Customer statement report, there is a required filter field named Date Filter which is being used to setfilter on the posting date in the cust. ledger entry table.
What i wanted to do was to remove the required filter field [Date Filter] from the Customer Statement report so that when i enter a date in the Customer Statement - PDF report, the customer statement report captures that date automatically to generate the report according to the date entered.Regards,
Bhavna0 -
I have been able to make it work \:D/
I designed a new table with Date From and Date To as field. In the Customer Statement - PDF, the user has to input the date from and date to, and then inserts them in the table. On previewing the current report, the customer statement report gets the dates from the table.
The report is then converted to PDF and emailed to each customer.Regards,
Bhavna0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions