1

I want to create a C# program which I can call directly from my SSRS rdl file and print in PDF format. And I need to apply some paramater/s for the correct report rdl too.

How can I achieve this?

I have been googling and there are a wide range of resources and I am getting confused. And it is my very first C# program in real life. Please help me out.

Will be much appreciated any precise or similar steps by steps guides / tutorials (and) (or) any ideas for this.

Thank you.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
LittleBirdy
  • 479
  • 2
  • 6
  • 22
  • As it stands, this question is too broad. Please show us what you have tried, what output you observed and what output you expected. This way we can better help you. – Marijn Jan 15 '16 at 07:35
  • I have rdl files. I just need to call them(passed parameters) and print, and I need to develop the program in c#. I saw people are talking about SOAP too. I am not quite sure about it. I am sorry I have run out of idea where to start. – LittleBirdy Jan 15 '16 at 07:46
  • Any resources to follow? – LittleBirdy Jan 15 '16 at 08:50

1 Answers1

1

If you have a local file, you can use the "Microsoft.Reporting.WebForms.LocalReport" class like this.

using Microsoft.Reporting.WebForms;
...
var report = new LocalReport();
report.ReportPath = "<path to your rdlc>";
...
var bytes = report.Render("PDF", null);

See Pramod Jaiswal's answer here for how to set up parameters, etc.

Note this difference between rdl and rdlc: You can simply rename the file, but you need to create local datasets in Visual Studio and bind queries to these datasets external to your report builder. For additional info: Converting RDL and RDLC Files

Community
  • 1
  • 1
Dan Randolph
  • 741
  • 8
  • 14