![]() |
#1 |
Участник
|
When you read the title, you might want to ask yourself .. why the hell would I want to do that??
Well, the are a number of reasons to do that.. :
To print an RDLC report, you have to make sure your code is run on the service tier. There are only two pieces of software that can run on the service tier: RTC and web services. We're NOT working with RTC, so I guess we'll have to use web services, right? And we CAN use web services in the current development environment, so all should be fine. In fact, Freddy showed us "How to Connect to NAV Web Services from NAV". So I decided to just go from there. It's not so easy and straight forward to use web services in NAV (.NET Interoperability in R2 sure will help us there...finally :-)), but I must admit .. it only took about 30 minutes to create this little demo.. and that was it. Thanks to Freddy .. again ;° ![]() Why? Well, the only thing I had to do is create a "save as pdf" routine and publish that as a web service. That routine looks like: GenerateReport() : Text[250] ltxtFileName := 'C:TEMP'; ltxtFileName += FORMAT(CREATEGUID()); ltxtFileName := DELCHR(ltxtFileName,'=','.'); ltxtFileName += '.pdf'; REPORT.SAVEASPDF(111,ltxtFileName); EXIT(ltxtFileName); Not very exciting, is it? Well, it's the idea that counts .. I hope ... . This codeunit, I published as a Web Service: ![]() And then, I started to rebuild Freddy's codeunit to be able to call this web service... . There was not much to rebuild.
![]() Enjoy! Читать дальше
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|