Here I came with a strange issue related to Microsoft.Reporting;
Earlier I was using this dll (Microsoft.ReportViewer and related all dlls) using web forms to show some reports and it is working perfectly with no issue. I am sharing a small screenshot here.
Now I have converted my whole project from web forms to MVC 5 and hosted my project on Azure. The whole project is working fine.
Now I am again using the same dll along with all associated dlls to implement the report section. Here it doesn't have any error and showing the report perfectly.
Now the issue comes in the picture. I m describing it here: Let's take 3 users to see the report at the same time. users A, B, and C.
Suppose at very first user A logs in and opens a report for him/herself, it shows it belongs to use A, at the same time when user B tries to open the same report (by clicking the same link) it again shows the report with the name of use A; there is nothing
related to user B.
Again, if at a very first time If use B opens a report for him/herself it shows the report which belongs to user B, but if at the same time user C OR use A tries to open the report, it again shows the report for the use B (I can see the name of user B).
I have gone through all my store procedures and c# code (with session variables) I did not find any wrong assignment for any variable for any user.
Then I came with the output when every (any user from A to Z) comes first and opens the report it ALWAYS shows only the report for the very first user who opens the report.
Then I (this is only an idea from my side) guess that the first user who opens the report, always replace his/her session with all other existing users or cached the first user's data to show I the report.
I am getting all the reports withing a ViewBag (ViewBag.ReportViewer) and generating a report using the View below
Suppose at very first user A logs in and opens a report for him/herself, it shows it belongs to use A, at the same time when user B tries to open the same report (by clicking the same link) it again shows the report with the name of use A; there is nothing
related to user B.
Static variables and caching data commonly causes this type of issue. We can't see how the ViewBag is populate and don't know how the security is designed. I would start with reviewing the code that populates the ViewBag. Is the data coming from a cache?
Are you using static variables anywhere in the code base? How does security work?
Participant
1448 Points
2844 Posts
Microsoft.Reporting.WebForms; showing the previous parameter (cached) related report
Sep 10, 2020 06:12 PM|demoninside9|LINK
Hello everyone,
Here I came with a strange issue related to Microsoft.Reporting;
Earlier I was using this dll (Microsoft.ReportViewer and related all dlls) using web forms to show some reports and it is working perfectly with no issue. I am sharing a small screenshot here.
Now I have converted my whole project from web forms to MVC 5 and hosted my project on Azure. The whole project is working fine.
Now I am again using the same dll along with all associated dlls to implement the report section. Here it doesn't have any error and showing the report perfectly.
Now the issue comes in the picture. I m describing it here: Let's take 3 users to see the report at the same time. users A, B, and C.
Suppose at very first user A logs in and opens a report for him/herself, it shows it belongs to use A, at the same time when user B tries to open the same report (by clicking the same link) it again shows the report with the name of use A; there is nothing related to user B.
Again, if at a very first time If use B opens a report for him/herself it shows the report which belongs to user B, but if at the same time user C OR use A tries to open the report, it again shows the report for the use B (I can see the name of user B).
I have gone through all my store procedures and c# code (with session variables) I did not find any wrong assignment for any variable for any user.
Then I came with the output when every (any user from A to Z) comes first and opens the report it ALWAYS shows only the report for the very first user who opens the report.
Then I (this is only an idea from my side) guess that the first user who opens the report, always replace his/her session with all other existing users or cached the first user's data to show I the report.
I am getting all the reports withing a ViewBag (ViewBag.ReportViewer) and generating a report using the View below
and below the aspx file which generated the report.
Please suggest.
All-Star
53691 Points
24031 Posts
Re: Microsoft.Reporting.WebForms; showing the previous parameter (cached) related report
Sep 10, 2020 08:12 PM|mgebhard|LINK
Static variables and caching data commonly causes this type of issue. We can't see how the ViewBag is populate and don't know how the security is designed. I would start with reviewing the code that populates the ViewBag. Is the data coming from a cache? Are you using static variables anywhere in the code base? How does security work?