Hi All,
I have faced with a bit strange problem. My goal is to develop SSRS report. The requirements were not defined from the very beginning and have been changing day after day, so I had to redevelop it (report) many times. So, finally – the problem: when I try to run the report, it show me the dialog, I’m choosing necessary parameters, but the reports renders the wrong data. Definitely! In my main method (of SrsReportRunController class, the method, which should filter the parameter and pass the correct one – doesn’t invoked. I mean – even if I comment all code in my main the method of the controller class, still: I can see the dialog, I can choose the parameters, the report is renders (with wrong data, but skip it…) – the problem that the main method is not invoking.
Here is the code of my main method:public static void main(Args _args)
{
ReportController controller = new ReportController();
controller.parmReportName(ssrsReportStr(DataReport, Report));
controller.parmArgs(_args);
controller.createReport();
//controller.startOperation();
}
}
createReport() – is the method, where I have a logic to ”filter” my parameter, and provide with correct one.
I have the same result if comment //controller.createReport() and uncomment controller.startOperation();
public static void main(Args _args)
{
ReportController controller = new ReportController();
controller.parmReportName(ssrsReportStr(DataReport, Report));
controller.parmArgs(_args);
//controller.createReport();
controller.startOperation();
}
}
I have the same result if comment all text init.
What I was trying to fix this:
Restart the AOS and SSRS
Clean cache (.auc)
Reset the settings
Does anybody had the similar problem? Please share your experience.
Thank you
Oleksandr
*This post is locked for comments
Hi Oleksandr,
Controller class is stand alone class and main method is the starting point of execution in it.
I m surprised on your statement that "the problem that the main method is not invoking."
Please use debugger that would help you in this case.......
Thanks,
Raziq
If you call a report directly, it has no idea about existence of your controller class and is surely won't call any static method on it.
If you got what you needed, please mark the answers. It will make clear which answers were helpful and the thread itself will be shown as answered.
Martin, I was asking “how to debug the RDP”, because I expected to see the full stack (and hopefully somewhere on the bottom of it to find my main method). Now I see that I was wrong, moreover, I’ve recieved another advise – I have reassigned my MenuItem to the Controller class (instead the SSRS report), so finally I explicitly called it. Martin, Sohiab, thank you for advises
Sohaib's code doesn't call main() method, so you shouldn't expect it to be called. If you're executing your report in a similar way, your main() method won't be called either. It's called automatically if you open the controller class through a menu item; otherwise you would have to call it explicitly.
Why you do want to debug a data provider class if you ask about the main() method on the controller class?
Sohaib, Martin, thank you for your advises.
Sohaib, I have tried your code and it also create a dialog... (but doesn't invokes my main method (I have placed several info("...") in it - in main()).
Martin, I would very appreciate if you can advice how to debug the RDP class. When I try to do as described here msdn.microsoft.com/.../gg724081.aspx (with breakpoint), I have just only two lines in stack:
[s] \Classes\PCLESInsuranceReportDP\processReport 12
[s] \Classes\SrsReportProviderQueryBuilder\initialize 59
Any F11 do not help.
Stop trying random things and start thinking. If you want to see what main() method is called, trying to debug a completely different class (RDP) can't help in any way.
also you may try to run it using code so you can be sure if its pointing to correct controller
YourControllerClassName objectOfControllerClass; Args args; ; objectOfControllerClass = new YourControllerClassName(); args = new args(); args.record(PassHereBufferOftABLE); objectOfControllerClass.parmReportName('ReportName.DesignName'); // you can also skip this as you have defined if you have specified it inside controlelr // Set args parameter in the class to the args instance you created objectOfControllerClass.parmArgs(args); objectOfControllerClass.parmShowDialog(true); // Run the report objectOfControllerClass.startOperation();
Yes, just now. I used this link as an example community.dynamics.com/.../133439.aspx
static void debugRDP(Args _args)
{
TableTmp tempTable;
List listCategory = new List(Types::String);
ReportDP dataProvider = new ReportDP();
ReportContract contract = new ReportContract();
contract.parmFromDate( 01\01\2015);
contract.parmToDate( 31\03\2015);
contract.parmMonthQuarter(MonthQuarter::Month);
contract.parmCategory(3); //3 – Is the EnumValue
dataProvider.parmDataContract(contract);
dataProvider.processReport();
tempTable = dataProvider.getPCLESInsuranceReportTableTmp();
while select tempTable
{
info( strFmt("%1" ,tempTable.CalculateInsurance));
}
this is what I got in the infolog:
Error executing code: (object) has no valid runable code in method 'debugRDP'.
Stack trace
(C)\Jobs\debugRDP
Breakpoints do work in controller classes.
To simply see whether your method is called or not, put a breakpoint there.
If it's not called, check what class is associated with your menu item.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,134 Super User 2024 Season 2
Martin Dráb 229,928 Most Valuable Professional
nmaenpaa 101,156