Report SAVEASPDF set option /filter on request page

vissers9
Member Posts: 21
Hi all,
I have written code which does a SAVEASPDF on the aged account receivable report. So far so good, code works.
But what I see is that the "Aged of" date is not the currect or workdate, what I would like it to be.
It's an option defined on the requestpage.
I have tried and searched how to set this field. Probalbly it goes through a report variable.
Could you give me a hint how to access this field in code?
Thanks,
Rob
I have written code which does a SAVEASPDF on the aged account receivable report. So far so good, code works.
But what I see is that the "Aged of" date is not the currect or workdate, what I would like it to be.
It's an option defined on the requestpage.
I have tried and searched how to set this field. Probalbly it goes through a report variable.
Could you give me a hint how to access this field in code?
Thanks,
Rob
0
Answers
-
Hi Rob,
I hope you are doing this activity via a separate report / Codeunit.
How you can achieve what you is -
1) Create a function in Aged account receivable say - setvalues with parameters that you want to set in your case a date variable.
In this function assign EndingDate (source of Aged As of) to your date variable.Function SetValues(AgeDate : Date) EndingDate := AgeDate;
2. call this function from report / codeunit from where you are trying to save it into PDF.AgedReport.SETTABLEVIEW(Cust); AgedReport.SetValues(TODAY); AgedReport.USEREQUESTFORM := FALSE; AgedReport.SAVEASPDFT('Filename',Record);
I hope this resolve your issue.
Let me know if any issues.
Thanks & Regards,
Saurav Dhyani
Do you Know this About NAV?
Connect - Twitter | Facebook | Google + | YouTube
Follow - Blog | Facebook Page | Google + Page0 -
Hi Saurav,
Very nice to read your comment, read some of your other post as well, really usefull.
Your comment guided me in the right direction.
If I may comment on it, maybe for future reference for other users:
I understand you cannot set the options in the request form of a report outside the report in code itself, have to do this via a function in the report. That really helped :-)
This works.
I did do some changes on the code below:
AgedReport.SETTABLEVIEW(Cust);
AgedReport.SetValues(TODAY);
//AgedReport.USEREQUESTFORM := FALSE; //Taken this one out completely. It gave an error on compiling, and my feeling is that be default the SAVEASPDF does not use the request page, so that fixed it.
AgedReport.SAVEASPDFT('Filename',Record); //Only 'FileName' left in the brackets. SAVEASPDF does not have the ability of passing a record, the filter is set by previous code.
But as said, thanks for your suggestion. I'm just a financial controller with some programming experience, trying to make VAN work more for us.
BR, Rob0 -
Hi Rob,
Thanks & you are always welcome.
Thanks & Regards,
Saurav Dhyani
Do you Know this About NAV?
Connect - Twitter | Facebook | Google + | YouTube
Follow - Blog | Facebook Page | Google + Page0 -
Hi you can pass the filter Creating Function.
In below code GetDate function is passing the date value to 50263 Report.
Inside report I am filtering the recording using the passed parameter.
I hope it would be useful for other pepole.
Report50263.SETTABLEVIEW(Vendor);
Report50263.GetDate(Date);
Report50263.SAVEASPDF(FileName);0
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