I have been spending a lot of time trying to generate a SSRS pdf from a crm plugin. After many attempts and suggestions, I think I have found the underlying problem.
My plugin creates a new record in crm and then generates a pdf report on that record. when the plugin is fired , it creates the record and the ssrs report as a pdf, but with no data, only the report template. I have put in several checks and I know I an getting the record guid from the new record which is passed to the report. After looking and being satisfied that the permission are fine and that there are no errors in any of the CRM, SQL or Reporting services logs, it occurred to me that the record was not available when the code for the report was fired. so I tried this scenario
1. create record 1 . The pdf was generated ( with no data )
2. Amend my plugin and hard code record 1 guid in the report generation
3. create record 2 . The pdf report was generated with live data for record 1
This leads me to believe that
NewARUDDRecordID = service.Create(newBACSREPORT)
Dim ReportMade As Boolean
ReportMade = clsReportGenerator.GeneratePDFReport(3, NewARUDDRecordID.ToString, serviceprovider)
Would appear to be trying to generate the report before the record is committed.
So my question is, once a plugin has created a new record, is committed whilst the plugin is still running ( ie as soon as service.create is actioned ) or not until the plugin has closed
*This post is locked for comments