Visual Studio 2017 SSRS Report Templates - reporting-services

With the version of SQL Server Data Tools included with SQL Server 2012 you could create a report definition and copy the .rdl into the folder below and it would appear when you created a new project item.
C:\Program Files (x86)\Microsoft Visual Studio
10.0\Common7\IDE\PrivateAssemblies\ProjectItems\ReportProject
I'm trying to achieve the same with Visual Studio 2017 and the Report Project extension though this does not appear to work when I copy the file to the folder below:
C:\Program Files (x86)\Microsoft Visual Studio
14.0\Common7\IDE\PrivateAssemblies\ProjectItems\ReportProject
How can I get template report items to appear for report projects?

The new location is now under (replace Enterprise with whatever your sku is)
C:\Program Files (x86)\Microsoft Visual
Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\SSDTRS\ProjectItems\ReportProject
UPDATE: This now looks to have changed to
C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\SSRS\ProjectItems\ReportProject

It looks like the folder path has changed now that SSDT is no longer in Preview - it was released 4-10-2018 for the first complete release. Anyways, I had an SSRS template that disappeared after installing the new release. Upon inspection, I found that the folder path for SSDT templates was moved from the Enterprise to SQL paths (remove the spaces):
SSAS: C:\Program Files (x86)\Microsoft Visual
Studio\2017\SQL\Common7\IDE\CommonExtensions\Microsoft\SSAS\
SSIS: C:\Program Files (x86)\Microsoft Visual
Studio\2017\SQL\Common7\IDE\CommonExtensions\Microsoft\SSIS\
SSRS: C:\Program Files (x86)\Microsoft Visual Studio\2017\SQL\Common7\IDE\CommonExtensions\Microsoft\SSRS\ProjectItems\ReportProject\

Related

How to query Azure Data Explorer from an SSIS package?

According to this article one can create SSIS jobs to query Kusto with a KQL query.
How can this be done? How would one connect to and query ADX from an SSIS package?
The problem you'll have is that SSIS .NET Tasks don't really understand nuget. The design experience will allow you to build a script/component that uses a nuget package but the moment you close the designer, the packages folder is trashed/not serialized into the package. When the package Executes, the task/component will fail because the expected libraries are not there and the SSIS engine does not have the insight to call a package manager to fix it.
Blessedly, these DLLs ought to be strongly signed so making this work should be a matter of installing them into the Global Assembly Cache (GAC) on your development machine(s) and corresponding servers. Something like the following command, which might need to be run an admin context
gacutil -if \path\to\the\assembly\Microsoft.Azure.Kusto.Data.dll
You likely have a gacutil installed but not in your command path dir /s /b gacutil.exe will ferret out locations.
C:\Program Files (x86)>dir /s /b gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.2 Tools\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.2 Tools\x64\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\x64\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64\gacutil.exe
From your comment, what is csb for example I presume based on this link that it's a connection string builder object. Which makes sense, the code is requesting that it opens a SqlConnection object and the constructor needs to know where to go, what credentials to use, etc.

Using CsvHelper in SSIS Projects

I am trying to use CsvHelper in my SSIS project specifically as a source component in my data flow. Unfortunately, SSIS doesn’t integrate with NuGet, so I would think that the CsvHelper DLL needs to be registered to the GAC. I haven’t worked directly with the GAC in years. Is it just the CsvHelper DLL that I need to register? If so, how do I find it?
The crux of whether you can put something into the GAC is whether the DLL is strongly signed. Looking at the project, I see an entry for an SNK (strongly named key) so that's checked off the list.
How to find it
Assuming it's on your system from a command/dos prompt
cd /d C:\
dir /s /b csvhelper.dll
If you can find the specified DLL, then you need to GAC it
How to GAC it
Open a visual studio command prompt as a local administrator (or find your GAC installation and open a command prompt as an administrator)
gacutil.exe -if Path\to\my\dll\cvshelper.dll
Note that you may need to specify the path to the gacutil.exe
Gac find
This will be the same mechanism as finding the dll above. Open a command prompt and search for it. Your results may vary but here's what my box looks like
C:\>dir /s /b gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\x64\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\x64\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\x64\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64\gacutil.exe
Lather, rinse, repeat
You'll need to ensure the DLL has been GAC'ed on any box that will be running your SSIS solution so keep track of any hiccups you have doing this on your local machine as it'll need repeating on the actual servers.

SSRS Custom Assemblies could not be loaded under Visual Studio 2017

I have just installed VS 2017 and moved my SSRS project from VS 2015 to 2017. I have a custom assembly which is working fine under VS 2015, but not 2017. It says
Error while loading code module: 'CustomLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Details: Could not load file or assembly 'CustomLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
I had exact same problem under VS 2015 and the solution was moving my custom dll under
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\PrivateAssemblies
So, I have moved my custom dll under
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PrivateAssemblies
which I believe is the correct path for VS 2017 and check file/folder permissions and set them identical, but no way, it still throws same error.
What am I missing?
This now requires two locations for the dll - the first works for new VS2017 RS projects, but upgraded projects also need the dll in the second location:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\SSRS
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PrivateAssemblies
I too have run into this issue, what fixed it for me was doing what was mentioned above and also editing the RSPreviewPolicy.config located in
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsof‌​t\SSRS
I set PermissionSetName="FullTrust" in all of the < CodeGroup>< /CodeGroup>
blocks.
TLDR - C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\SSDTRS
I was having the same problem - try using the Fusion Assembly Binding Log Viewer to peer into what the problem is as per http://www.hanselman.com/blog/BackToBasicsUsingFusionLogViewerToDebugObscureLoaderErrors.aspx
With "Log bind failures to disk" enabled (and restarting VS) the devenv.exe process folder in your log location should then produce log files when you recreate the problem. Part of what it will tell you is the various folder locations VS is checking for assemblies. My issue was that I hadn't copied a required assembly. You might also be having a problem with it not liking a specific version of a dll it is trying to load (for instance .Net 4 v 2), the logs will highlight that as well.
The viewer tool is pretty poor in terms of being able to sort columns. I found it much easier to just open C:\FusionLogs\Default\devenv.exe (where I had set C:\FusionLogs as the custom log path), sort by date modified and watch as new files were created when trying to add the data source.
In terms of which folder to use - I initially dropped them into PrivateAssemblies which worked for creating the data source / reports. However when it came to build the preview the report I then got another could not load assemblies message. Again using the log viewer, but this time in the PreviewProcessingService.exe folder the error suggests the only directory that checks for the assemblies is: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\SSDTRS - this location works for both creating and previewing reports.

Could not load file or assembly error on adding custom libraries in SSRS reports

I have created a custom library(CodeLibrary) which internally references the dlls Microsoft.TeamFoundation.Client and Microsoft.TeamFoundation.WorkItemTracking.Client.
I added this custom Dll codelibrary.dll to my SSRS report. and the expression of one of the field as
=codelibrary.codefunction.GetValue(1000)
codefunction is the class and GetValue is the method.
When I preview the report, I get the error "Error while loading code module: 'CodeLibrary,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null'. Could not load file or assembly 'CodeLibrary,Version1.0.0.0, Culture=neutral,PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."
I am using VS2013, I have placed the custom library DLL in the path
C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies
I have tested the custom library with a WPF application and it works fine.
I am not able to figure out what is causing this error.
I didnt have to modify rssrvpolicy.config file.
I added the custom dll to the following paths and it worked:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PublicAssemblies
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies
C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer\bin
In visual studio 2015, I had to copy the dll to:
C:\Program Files (x86)\MSBuild\14.0\Bin
You should copy your custom library to the ReportServer\Bin folder ex: C:\Program Files\Microsoft SQL Server\MSRS10_50.R2\Reporting Services\ReportServer\bin
Then modify the rssrvpolicy.config in ReportServer folder, find "$CodeGen$" and add the following code
<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="CoDeMagSample"
Description="CoDe Magazine Sample. ">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="C:\Program Files\Microsoft SQL Server\MSRS10_50.R2\Reporting Services\ReportServer\bin\YOURLIBRARY.dll"
/>
After that, Stop and Start Reporting Service from Reporting Service Configuration Manager.
Hope this help.
Adding - In Visual studio 2019, I copied the dll to:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\SSRS

LNK1104: cannot open file 'glut32.lib'

I am using "CUDA bu Example" book to get started with CUDA.
But when I included all header files given by book then got ERROR as
Error 1 error LNK1104: cannot open file 'glut32.lib' D:\book\book\LINK book
I am using Visual Studio 10
Please help me out of this
I found the same error while setting it up in Visual Studio 2010
However, I also found a fix and wanted to share it.
Just copy and paste the glut32.lib file to MicrosoftSDKs folder, as this is the default location of VC++ linker location. To be exact
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib
You probably have to build the "shrUtils_vs2010.sln" solution if you haven't done it.
The file is in "\path_to_SDK\NVIDIA GPU Computing SDK 4.2\shared" folder.
Copy the glut32.lib file from the lib folder in "cuda by example" to the folder below:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\lib\Win32
I have tested this solution and it worked for me in visual studio 2015
1: Copy glut32.dll to your project directory (where your source.cpp is)
2: Copy glut.h to C:\Program Files\Microsoft Visual Studio 14.0\Vc\Include\gl (gl folder should be created manually)
3: Copy glut32.lib to C:\Program Files\Microsoft Visual Studio 14.0\Vc\lib done.