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, ...
Unanswered

Send Report PDF as Email Attachment

(0) ShareShare
ReportReport
Posted on by 100

Send Report as pdf attachment 

I have the same question (0)
  • Martin Dráb Profile Picture
    239,399 Most Valuable Professional on at

    Are you saying that you want to send twenty thousand emails with small files, or that you want to create a huge PDF with twenty thousand records and send this file via email?

    Please give us more details about the problem. Where does it get stuck? Where does locking occur and which resource is locked? We can't help you if you don't give us enough information...

  • mark wilson Profile Picture
    100 on at

    Yes , I have 20000 customer , So 20000 emails will be sent , single pdf for each customer .

    It stucks on insert_recordset query , when I check session I see lck_m_sch_s this wait type , and session type suspended..

    Previously I was using local buffer of temp db table , The query was sticking there when running report for pdf , I commented it out , Now it stucks at other query .

    But when I run the SSRS report , it runs perfect ..

  • Martin Dráb Profile Picture
    239,399 Most Valuable Professional on at

    If you have a problem with your insert_recordset query, we can ignore PDF files and e-mails, because that's not related to your actual problem.

    Please extract the problematic code a runnable class - removing the dependency on the report etc. will make your testing easier, and it'll allow you to share code with us.

    If I understand it correctly, lck_m_sch_s is related to schema changes. Don't you have DB synchronization or index rebuild running at the same time?

  • mark wilson Profile Picture
    100 on at

    Martin , I think my insert_recordset is perfectly fine , Because when running SSRS report , It's working perfect , correct data is showing up .

    If my query had issues , It would not have sent reports to 20-30 customers ..

    But when I am looping through each customer , it's working fine for 20-30 customers , After that the query or connection is stucked with the details above..

    Previously I was using setConnection(this.parmUserConnection) , when I was using local buffer of temp table , Now I removed the local buffer code and setConnection , It's working for only 20-30 customers , After that it gets stucked ..

    And I didn't understand your statement " DB sync and index rebuild at same time " ?

    I don't have indexes on tempdb table .

  • Martin Dráb Profile Picture
    239,399 Most Valuable Professional on at

    You said that "It stucks on insert_recordset query". If you're now saying that your problem lies somewhere else, please give us more information about the actual problem.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 657

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 615 Super User 2026 Season 1

#3
CP04-islander Profile Picture

CP04-islander 356

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans