Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

To attach text file to pdf using x++

(0) ShareShare
ReportReport
Posted on by 1,457
hi ,everyone 
i need to attach the text file to pdf using x++ , can anyone tell me is that possible and if yes how can i get it done using x++ code , can any one guide me on this .
 
 
thanks ,
Regards ,
Dinesh.
  • Martin Dráb Profile Picture
    Martin Dráb 230,379 Most Valuable Professional on at
    To attach text file to pdf using x++
    You first step won't be "generating the report and saving it as pdf". There are several design decisions to make; then you'll need to implement the report. Only then you can run it (with a print to PDF).
     
    You can't simply put XML to SSRS and magically get a report in the design you want. You'll too extract data from XML and pass it to the report. If you decide to use SSRS and do it inside F&O (which is not your only option), then you'll likely want to put the data to a table and then either create a query-based report or put the data to temporary tables in an RDP class. If user input is required, design a data contract for parameters. Then you'll need to actual create the report and use your data there.
     
    But there are many other ways how to generate a PDF document. For example, you may be interested in Adobe Document Generation in Microsoft Power Automate.
  • Dineshkarlekar Profile Picture
    Dineshkarlekar 1,457 on at
    To attach text file to pdf using x++
    hi 
    martin , 
    thanks for reply ,
     
    if i use this case as you mention , in second point .
    "But it seems to me that it wouldn't be the right approach in your case. You seem to want to create a report based on structured data, therefore you should use a reporting technology (such as SSRS) to generate a report and save it to PDF, rather than defining the whole PDF in your code."
     
    can you plz suggest me any link so i can use it in my code because if i go step by step my first step will be generating the report and saving it as pdf .
     
    thanks ,
    Regards,
    Dinesh.
     
  • Martin Dráb Profile Picture
    Martin Dráb 230,379 Most Valuable Professional on at
    To attach text file to pdf using x++
    If depends on what you mean by "to attach an xml document at the time of saving pdf". If you mean one of the two things I mentioned below, then the answer is yes.
     
    If you mean something else, then I can't comment on it unless you explain it to us.
  • Dineshkarlekar Profile Picture
    Dineshkarlekar 1,457 on at
    To attach text file to pdf using x++
    hi ,
    martin
    Can i attach the xml document at the time of saving pdf.
     
     
    thanks,
    Regards,
    Dinesh.
  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,379 Most Valuable Professional on at
    To attach text file to pdf using x++
    There is no X++ library for manipulating PDF files. You could utilize a .NET library such as PDFsharp and either call it from X++, or do the whole thing outside of F&O (e.g. in an Azure function). The vast majority of work would be about how to use the library, not about X++.
     
    But it seems to me that it wouldn't be the right approach in your case. You seem to want to create a report based on structured data, therefore you should use a reporting technology (such as SSRS) to generate a report and save it to PDF, rather than defining the whole PDF in your code.
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,661 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,379 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans