This is my code , I made a ssrs report , so in RDP class (Process report method) I write a while loop to add values in tmp table based on General Journal trans table .
I called a method in class and put it in try catch to handle errors But report throw an error and didn't hit a catch statement How to fix it ?
Regarding TtsLevel, see my reply starting with "The first step is analyzing the cause".
Using a different validation method doesn't belong to this thread, which topic is "Try catch doesn't work in RDP class ProcessReport()". But you can create another thread and explain it there (with sufficient details about what you're trying to achieve).
Can you help me to get another method validate dimension combination before posting ledger journal instead of calling simulate posting () method ? , I want to call method that validate financial dimension
I want to call simulateposting in try catch but simulateposting have ttslevel = 1 , How can I change this in simulateposting to make my code hit catch statement ?
simulatePosting() is inside the try block, therefore it's irrelevant to our discussion about whether the try/catch block is in a transaction or not.
no I mean that transaction start in method I called (simulateposting()) , you mean that I need to ttsabort when transaction start ?
The first step is analyzing the cause. The debugger can give you the call stack; the sequence of calls leading to processReport(). Look into those method and find when a transaction is started.
My guess is that you're using pre-processing and the transaction is created in SrsReportRunRdpPreProcessStrategy.execute().
yes you are right I debug my code and see ttslevel = 1 , this problem has a solution ? , How to make it = 0 to hit catch statement ?
That doesn't say whether there is a transaction or not. A transaction could be created at another place then in your code. You need to learn how to find out whether code is executed in a transaction or not.
For example, put a breakpoint to the 'try' block, run the report with debugging. When the execution stops on your breakpoint, look into the 'Autos' window and check whether the value TtsLevel is zero.
Consult Debug X++ code by using the debugger in Visual Studio if needed.
Yes I remove ttsbegin and ttscommit from my while loop
First of all, verify that your tr/catch statement isn't inside a transaction. You can see it in debugger, for example.
André Arnaud de Cal...
291,965
Super User 2025 Season 1
Martin Dráb
230,817
Most Valuable Professional
nmaenpaa
101,156