I add display method to the table that involved in the query used in ssrs report. the result of display method does not show in the ssrs report.
I used the display method in the job and compile it and every thing goes right.
So, what happened to my display method in the ssrs report
TanQ in advance
Did you select the checkbox of All methods while adding the dataset in VS?
Its difficult to propose a solution with this information. Can you show your code if possible?
No I just choose the display methods that I want to show in my ssrs report.
as I said, I compile it in the job. and every thing is OK. the code is about converting default date to Jalali date.
Do u have any suggestion?
this is my code:
display str returnShamsiLastConfirmDate()
str1 = DateConversion.ClsDateConversion::Conv_Mdate2(“20140525”);
DateConversion is a .Net dll that I deploy it in AOT.
Are you able to see that method in the dataset fields in VS?
if its visible there, then you should get the value in the report…Else there’s some error in the method which is not populating the data.
Debug the display method in your table and check if its hitting the method. You can find where the error could be!
Every things seems OK. but it does’t work!
So as you said…debugger shows that the data is coming through the method.
In that case y dont you check the textbox properties in the SSRS report design?? if its visible or not?
Text Box Visibility> hidden = False
I’ve checked every thing thousands time
Can you please try achieving date conversion logic from SSRS methods(VS) instead of AX code?
you can even use data methods from SSRS report for this
As I said, I’ve been added the display method in a job and form. Both are working perfect. There is problem in SSRS report, even in preview in VS. I did full CIL generation, restarted SSRS and AOS service, but it didn’t work too.
In the display method, I have a .NET code that get a Gregorian date in string format and return Jalali date in string format. I Think, there is a problem when the report is executing, the .NET code doesn’t run. I’ve added +”str” to the result that returned by display method. but it doesn’t show it too and all the thing I see is an empty space
Do you have any more advice?
Please change the method to return a hard-coded string. If you can’t see it in the report, the problem is not caused by any content of the method. If hard-coded text works and your code doesn’t, walk through the code in debugger, it might reveal more information.
(Thread moved from Technical to Developer forum.)
I use Hard-coded string. it doesn’t work too.
Do you have any exprience about this to use .net dll that deploy in AOT in the ssrs report?
is it possible?
You just said that your report doesn’t show even hard-coded strings, without any .NET involved, so why are you talking about .NET?
No, my report is OK. and show everything.
by Hard-coded string, I mean instead of my complicated code in . net dll, I use a simple code that just return a “text”.
it doesn’t show this simple dll. I mean dll doesn’t run when the report execute.
So let’s go back to what I meant. If you let the display method return a hard-coded string, does it work or not?
If it does, please continue to my latter point and use a debugger. Also ensure yourself that your .NET code works when run on AOS.
what do u mean by debugger or .net code work on AOS. as u saw, I said that it’s ok. and work when i used it in job and form.
Debugger allows you to step through code and see what’s going on there. See Debugging in Microsoft Dynamics AX 2012.
X++ code can by executed by the AX client application or the AX application server. These are two separate applications, often installed on different computers. If you test that the library is installed correctly on the client machine, it doesn’t mean it will work on AOS. Maybe the library doesn’t exist on the server machine at all.
As the first thing, you should test your code on server (because reporting server communicates with AOS, not with AX clients). For example, create a class with RunOn = Server and run your code there.
Forms and jobs run on client, therefore it doesn’t say anything about code on server.
It Resolved. instead of deploying dll to the AOT, use my dll in data method in ssrs report directly.
I came across a similar issue. A new display method didn’t generate any data in a new SSRS column, even if I had it return some dummy data. I got it to work by adding a new random field to the view output and then to the query DS in AOT. I guess this forced the query to refresh. The query had only fields and not methods I was puzzled a little as to why it mattered. I confirmed this solution in both DEV and PROD.
Hope this helps someone.