How to solve SSRS error message ORA-12557 TNS protocol adapter not loadable

 

 

Problem: When switching from [Design] to [Preview], you get this error message.


Sometimes, VS might fail to show the ORA 12557 message, but only show a shorter message about a dataset problem.

 

Diagnose:

How to reproduce the specific error. 

Find the Data Source that is failing.

Cick it to open it.

Click [Edit]

Click [Test Connection]






 

Suggested Solution:

Remove the environment variable ORACLE_HOME during the execution of Visual Studio; once finished, put it back.

 

Create a .bat file like this ...

@ECHO Off

 

:: remove %ORACLE_HOME% temporarily

IF DEFINED ORACLE_HOME SET ORACLE_HOME_BACKUP=%ORACLE_HOME%

IF DEFINED ORACLE_HOME SET ORACLE_HOME=

 

CALL "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe"

 

:: restore %ORACLE_HOME%

IF DEFINED ORACLE_HOME_BACKUP SET oracle_home=%ORACLE_HOME_BACKUP%

 

 

Save it as ...

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\run_devenv.bat

... being this the location where you have installed SSRS-Visual-Studio

Consider Changing your shortcut to VisualStudio accordingly.



 

How to Preview SSRS Reports on Local PC

 How to solve error during preview of  SSRS reports on local PC

 Scenario

you have an SSRS report that raises a security error when you try to preview.

 Error Message:





Cause

when your PC acts as host for the report, the security configuration does not allow you to use the referred library.

 

Solution:

Change the policy configuration on your machine, to elevate your privileges;  e.g.  to Full Trust.

 

The policy is in the file
[ C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies\RSPreviewPolicy.config ]

 

Edit and find the XML node:
Configuration > mscorlib > security > policy > PolicyLevel  > CodeGroup.
(in my case, line# 55), which looks like this (before):




Consider keeping a backup of this file before modifying,  just in case.

 

Replace the “Nothing” by “FullTrust”  (case sensitive). 



Like this (after):
Save the file.
The change takes effects immediately.
Hit [Preview] and the above error should have disappeared.

 

 

 


 

Further Reading

 Partial Trust

·         How to grant permissions to a custom assembly that is referenced in a report in Reporting Services
https://support.microsoft.com/en-us/help/842419/how-to-grant-permissions-to-a-custom-assembly-that-is-referenced-in-a

·         Reporting Services Configuration Files
https://docs.microsoft.com/en-us/sql/reporting-services/report-server/reporting-services-configuration-files?view=sql-server-2017


·          Setting Security Policy for Custom Assembly in SSRS 2014 SharePoint Integrated Mode
https://joyfulcraftsmen.wordpress.com/2015/04/27/setting-security-policy-for-custom-assembly-in-ssrs-2014-sharepoint-integrated-mode/


 

 


How to query service status on a remote windows server

Use the SC command.

C:\> SC \\ServerName query "ServiceName"


C:\> SC \\ServerName query "Informatica10.1.1"
C:\> SC \\ServerName start "Informatica10.1.1"

C:\> SC \\ServerName GetDisplayName "Informatica10.1.1"
[SC] GetServiceDisplayName SUCCESS
Name = Informatica 10.1.1

C:\> SC \\ServerName  GetKeyName "Informatica 10.1.1"
[SC] GetServiceKeyName SUCCESS
Name = Informatica10.1.1


Alternative:  
Open services.msc 
Right-click on "Services (local)" on the left pane.  
Click on "Connect to another computer...".
Select the remote server.

Note: services.msc might remember which server was seected last time.  Once done, you might want to reconnect to your local computer.




 How to kill a Windows remote desktop session (RDP session) 

Use qwinsta to get all remote desktop sessions on the server.

C:\> qwinsta /server:<ServerName>    <UserName> ]

SESSIONNAME       USERNAME                 ID  STATE   TYPE        DEVICE
services                                    0  Disc
console                                     1  Conn
rdp-tcp#2         <UserName>                 4  Active   <-----
rdp-tcp                                 65536  Listen

Observe the "ID"  !!


Then, use rwinsta to reset the session using either session ID or session name.

c:\> rwinsta /server:<ServerName> 4


It might be safer to query using username, in order to avoid killing another users' sessions by accident.


C:\> qwinsta johnsmith /server:ServerName
SESSIONNAME       USERNAME                 ID  STATE   TYPE        DEVICE
rdp-tcp#2         johnsmith                 4  Active

C:\> rwinsta /server:ServerName 4
C:\>


How to match intersection of dates between two periods.

Problem: Find  a condition that selects date ranges that have an intersection with a given range.

Example:
A subscription has a start-date and and an end-date. 
We want to know what subscriptions had at least one active day in a given month.
 

            +--> mth_strt_dt: Begin of Month
            :                     +--> mtd_end_dt: End of Month
            :                     :
            :                     :                   
            |<====== Month ======>|
   |<--->|  :                     :                No
     |<-------->|                 :                Yes
     |<-------------------------------------->|    Yes
            :     |<----->|       :                Yes
            :         |<--------------------->|    Yes
            :                     :    |<---->|    No

The Condition is:
                        Begin_Date <= EoM
                    and End_Date   >= BoM

 

Solution:

Select subscriptions where
subscription-end-date >= Begin-of-Month
and
subscription-begin-date <= End-of-Month



How To Customize Web.Config in a C# Project using Visual Studio 2010

VS2010 can transform your web.config file before each compilation and before launching any 'Run/Debug'.

web.config has children
Picture 01
Step 1: On your project, locate the visual clue that the web.config file actually ... has children.  Pay attention to the Solution Explorer window (pic. 01).  Notice that the file has a little arrow head to its left, suggesting it can be expanded.









_______________________________________________________________________

Step 2: Expand it now please.  You should see one child per each "Solution Configuration".  Usually, the default is "Debug" and "Release".  You should be seeing something like picture #02.








nAnt exercise #1  (work in progress)

The Problem

If these premises can define your problem, then nAnt can help solve it.

Premise #1: Your C# project has to be deployed onto different environments, for example:
  • Local
  • Dev
  • Test
  • Integration
  • QA
  • Training
  • Staging
  • Production
Premise #2: Certain files contain information that differ from environment to environment.

Premise #3: The web.config or app.config is not enough to contain all the variables.
This premise is actually important, because if all your variables are containedin the web.config file, then yo udo not need any tool external to Visual Studio.  VStudio 2010 has the power of pre-processing your web.config file.  You can see how to exploit that featuer on this post.

Followers (Guests)