Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / To attach text file to...
Finance forum
Suggested answer

To attach text file to pdf using x++

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 228,137 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 228,137 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 228,137 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.
     
     

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,277 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,137 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans