Use C# to call the ssrs specified in the ssrs server

Hello everyone, I have such a requirement: Use C# to call the ssrs specified in the ssrs server in 365,
Does anyone achieve this

Can you give us more details, please?

1 Like

I am going to create a C# program, and then use this program to call the SSRS in D365Fo,

I want to update the requirements, Is in AX2012

All right, so what should the program do? “To call reporting services” may mean many things. Please be more specific.
When designing a solution, you should always focus on business requirements. Choose implementation details, such as the programming language, to fit the requirements. If you decide implementation details too early, you may make the solution more complicited or even impossible to meet users’ requirements.
Regarding the version, I’ve fixed the title and tags and for you. They don’t refer to D365FO anymore.

Use this C# program to call an SSRS, then pass in the parameters, and print the ssrs

That’s insufficient - you’ll need to think much harder about the requirements.
Before I get into more details, let’s focus a single huge topic - whether you want to do it in AX or not.
I guess that you want to use C# to bypass AX, which would match your description “Use this C# program to call an SSRS”, but it conflicts with your other statement “use this program to call the SSRS in D365Fo”. Please explain whether users should do the printing if AX, or you want to use a separate application.
If you bypass AX, you won’t be able to use AX features, such as the print archive. In fact, you won’t be able to use many reports at all, because they depend on parameters (such as queries) and business logic (such as preprocessing classes) in AX. If your goal is being able to call all reports, then you can’t use technical design.

I want to call SSRS in AX2012 through this C# program,Instead of d365 Fo

I’m sorry, but I won’t be able to help you if you don’t explain what you actually want.
Don’t be afraid of using more than one sentence.

I just want to create a C# program, and then pass in the relevant parameters through this program to call the SSRS in AX2012 and print it out in the browser.
This is what I want to do,Don’t know if you can understand?

Now it sounds that your program should call AX 2012, not SSRS, is that correct? You will use the reporting framework of AX 2012 and it will be AX 2012, not your program, who will call SSRS. Do you agree?
What exactly do you mean by “in the browser”? There is no such a print destination in AX 2012.

https://community.dynamics.com/ax/f/microsoft-dynamics-ax-forum/223357/open-ax-report-ssrs-report-from-c-application

You can take a look at this link, my purpose is the same as the one in the link

I’m sorry, but the link doesn’t answer my questions. It doesn’t say what you mean by “in the browser”. It doesn’t explain whether you need to support all reports or not. It doesn’t say how you want to specify complex parameters such as queries.
If you have no answers to such questions, you’re not in a position to start any implementation. You’ll need to think more about what you’re going to implement.

I don’t think about the problem in the browser, nor do I need all the ssrs reports. For example, if I want to print the ssrs to confirm the purchase order, I only need to pass in a purchase order number.

Hmm, do you mean that we should ignore your previous requirement to “print it out in the browser”? What print destination do you want to use then?
You said that you don’t need to support all reports, but you didn’t add any more details. Could you please explain which reports you need to support?
You’re wrong in thinking that printing a purchase order confirmation means merely passing a purchase order ID to a SSRS report. This report is handled by the FormLetter framework, PurchPurchaseOrderContract contains nine parameters, there is a plenty of business logic in PurchPurchaseOrderDP and so on.
If you need to support just reports like order confirmation and invoice, you need to focus on the FormLetter framework and instead of SSRS.
Also, your requirements don’t contain any parameters for print processing. You may be happy to ignore things like recurrent printing, but the print destination (and related parameters, such the the file format when printing to a file) must be set in some way. If you don’t want to pass arguments from your program, you’ll need some kind of configuration inside AX.

In 2012, aren’t the SSRS reports deployed to a standalone SSRS server? If I remember correctly, you can actually view the report library through a web browser, right? Why do you want to go through AX to get these reports to generate?

That’s exactly a solution that works for some simple reports, but it’s not useful in other cases, because AX adds logic that isn’t available in pure SSRS. For example, SSRS don’t allow you to define AX queries, which is a common type of parameter for reports.

1 Like

Can you tell me the path of the report library?

You can find the URL of your report server either in SSRS configuration, or in AX (System administration > Setup > Business intelligence > Reporting Services > Report servers).