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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Get PDF of report via C#

(0) ShareShare
ReportReport
Posted on by 465

I have one SSRS PRODUCT_REPORT created using CRMAF query.

Below is the screen SSRS > PRODUCT_REPORT > having one parameter name xxxID.

I want to generate this report as pdf using the C# using webservice <server>/Reportserver/ReportExecution2005.asmx.

So, I got sucess to generated the report, but for all the record, i.e., parameter is not set while report pdf rendering. Below is the parameter setting:

ParameterValue[] parameters = new ParameterValue[1];
parameters[0] = new ParameterValue();
parameters[0].Name = "xxxID";
parameters[0].Value = "{xxxxxxxx-9DC8-E411-BFC7-00155D00730E}"; //and tried without the curly braces also.

So, how do I set the correct “ParameterValue” so that – only for requested record the pdf report will generate?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mahadeo Matre Profile Picture
    17,021 on at

    Are you passing this report parameter when rendering report into PDF?

    like 

    _reportexecutionservice.SetExecutionParameters(parameters, "en-us");

    or
    reportresult = reportGenerator.Render(databasenamepath,FormatType.PDF,parameters);

    Here are some complete examples

    a33ik.blogspot.com/.../general-approaches-to-generation-of.html

    connect.greenbeacon.com/.../ms-dynamics-crm-2013-generating-ssrs-report-as-pdf-using-plugin

    http://mileyja.blogspot.com/2008/10/programmatically-rendering-sql-server.html?_sm_au_=iVVnQ2s275qvHJft

    Hope this will help.. 

  • ChangeFrenzoId Profile Picture
    465 on at

    Yes! i have written that statement too.

  • ScottDurow Profile Picture
    21 on at

    Curly braces should be fine if you are using the parameter to parameterise SQL query?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans