PDF Creator Error

Hi All,

While i am generating the PDF file with Date filter,the PDF file is not generated.If i am giving the date or with out giving the date in both case it is take the else part. So please help me.

IF ((Dt1<>0D) AND (Dt2<>0D)) THEN
BEGIN
MonthVar1 := DATE2DMY(Dt1,2);
YearVar1 := DATE2DMY(Dt1,3);
MonthVar2 := DATE2DMY(Dt2,2);
YearVar2 := DATE2DMY(Dt2,3);
END
ELSE
ERROR(‘Please Enter the Date Fields’);

Regards,

Padma

Check the values both fields befire If Condition with Message()

Both Dates should not be zero then only code will be executed…

Hi,

Mohana i know that if it is date is zero then else code is executed ,to be more clear i have written that code ,So give me other solution if you can…

Thanks,

Padma

Ohh Yeah sure…

Did you check with Messages?

Where did you write this code? Report/form/Codeunit/table?

How are you passing date variables?

Hi,

Mohana yesi check that with message.i am wrote that code in Report-OnPredataitem(). No problem to generate the report.The problem occurs in while i am generate the PDF file.If suppose i am giving date or without giving date the else part only run at the time of click the button for to generate the pdf file.

Regards,

Padma

So Executing the report is different function and Generating PDF is different function?

To be sure,Hardcode the values before IF Condition like

Dt1 := 010111D;

Dt2 := 310111D;

and exxecute generatePDF…

So Executing the report is different function and Generating PDF is different function?–yes yes correct.

To be sure,Hardcode the values before IF Condition like

Dt1 := 010111D;

Dt2 := 310111D;

and exxecute generatePDF…—yes sure.

I Didn’t hardcode it. So User Manually enter the Dt1 and Dt2 value.

I mean Hardecode the values and try…whether it is working or not…

Hi,

Mohana i got same error,while i am hardcode the Dt1,Dt2 values.

Regards,

Padma

Strange and It should not be…

As a developer, Please Debug the code…