web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

To attach text file to pdf using x++

(0) ShareShare
ReportReport
Posted on by 1,836
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.
  • Suggested answer
    Martin Dráb Profile Picture
    241,635 Most Valuable Professional on at
    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.
     
     
  • Dineshkarlekar Profile Picture
    1,836 on at
    hi ,
    martin
    Can i attach the xml document at the time of saving pdf.
     
     
    thanks,
    Regards,
    Dinesh.
  • Martin Dráb Profile Picture
    241,635 Most Valuable Professional on at
    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
    1,836 on at
    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
    241,635 Most Valuable Professional on at
    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.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 282 Super User 2026 Season 2

#2
Aayush Tiwari Profile Picture

Aayush Tiwari 219

#3
Subra Profile Picture

Subra 211 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans