Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sevenhills
Super User
Super User

Visual Studio SSDT System.Security.Permissions.SecurityPermission

Hi,

 

I have VS 2019 and SSDT installed local on my computer. I have an expression in the textbox, using "Floor", "Abs". When I try to preview the report on my computer, it gives "#Error"

 

In the Visual Studio, window: error list, it shows as 

 

 

[rsRuntimeErrorInExpression] The Value expression for the textrun 'Textbox133.Paragraphs[0].TextRuns[1]' contains an error: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

 

Note: When I publish this to PBIRS, report works fine. only shows error on my computer's visual studio / ssdt. Also, works on Report Builder when I open ... 

 

Any idea? Thanks 

8 REPLIES 8
sevenhills
Super User
Super User

Today, I encountered one more error

     Works:            COUNTROWS("DataSet1_WithTextOrNumber")

     Works:            COUNTROWS("DataSet1_WithOnlyOneDateColumn")

     Works:            COUNTROWS("DataSet1")

     Works:            Parameters!FirstDate.Count

     Works:            JOIN(Parameters!FirstDate.Value," & ")

 

NOT Works:           

a. Select SQL_Col_Date from table1  (Only one date column)

b. Add one more calculated field in report dataset as =Format(Fields!SQL_Col_Date.Value,"Short date")

c. using COUNTROWS("DataSet1_WithOnlyOneDateColumn_CalcColumn") inside an expression ... gives error!

= IIF(COUNTROWS("DataSet1").Equals(Parameters!FirstDate.Count)
,"All",JOIN(Parameters!FirstDate.Value," & "))

       

[SQL Server as datasource]. Hope microsoft will look into it!

Thanks

 

bradsy
Employee
Employee

There is typically a setting to allow certain types of permission for the app domain the expression is running in. This might help: https://stackoverflow.com/questions/32428/how-do-i-resolve-a-system-security-securityexception-with-...

 

Hi Bradsy, 

 

I read the link before posting and I dont have any custom extensions. Inside the report, using ABS, Floor in an expression, in a textbox.

 

I am having error only my laptop (and not on the server). Even on my laptop, if use the reportbuilder, it wont give any exception i.e., it works fine. On the PBIRS server, it works fine. 

 

Version info: Microsoft Visual Studio Professional 2019 Version 16.7.3 SQL Server Data Tools 16.0.62008.03130 SQL Server Reporting Services 15.0.19124.0 Microsoft SQL Server Reporting Services Designers Version 15.0.19124.0

 

I am localadmin in case this matters.

 

Also, on a side topic, if it is asp.net site, we can add references, this is Visual Studio, Reporting Services (SSDT) project ...

 

Thanks

Can you post an example of the expression I can run on local data to see if this is systemic or just your instance?

=Floor(Abs(SUM(DateDiff("d",Fields!OUT_DT.Value,Fields!EASE_DT.Value),"DS_SA"))
/Sum(Fields!S_CNT.Value, "DS_OUTCOME")) 

 

a) OUT_DT, EASE_DT are datetime

b) S_CNT is int and has 1 or 0

c) Getting the diff between OUT_DT, EASE_DT as positive integers i.e., ABS and then sum.

d) sum of count 

Overall, similar to LOS type calculation ... 

 

Thank you Bradsy for looking into it. 

 

 

Hi SevenHills,

 

I could reproduce sporadically. With one dataset, seemed to always work. With 2, I would get the error usually after the first preview. My guess is a threading issue with the preview host. I filed a defect to track the problem, but I don't expect any action unless more customer hit the issue. I don't really have a good workaround, other then trying in Report Builder\SSRS to preview. 

 

Thanks for finding the problem!

Thank you for your prompt follow-up. Hopefully one day it will get fixed. 🙂 

 

 

(I submitted here also, FYI ... https://marketplace.visualstudio.com/items?itemName=ProBITools.MicrosoftReportProjectsforVisualStudi... )

 

sevenhills
Super User
Super User

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.