├── .gitignore ├── APISamples ├── powershell │ └── powershellSamples.ps1 └── typescript │ ├── README.md │ ├── package.json │ ├── src │ ├── api.ts │ ├── app.tsx │ ├── home.tsx │ ├── index.html │ └── navbar.tsx │ ├── tsconfig.json │ └── webpack.config.js ├── CustomSecuritySample ├── App_LocalResources │ ├── Logon.aspx.Designer.cs │ └── Logon.aspx.resx ├── AuthenticationExtension.cs ├── AuthenticationUtilities.cs ├── Authorization.cs ├── Configure.ps1 ├── CustomSecurity.Designer.cs ├── CustomSecurity.csproj ├── CustomSecurity.resx ├── CustomSecuritySample.sln ├── Logon.aspx ├── Logon.aspx.cs ├── Properties │ ├── Settings.Designer.cs │ └── Settings.settings ├── README.md ├── ReportExecutionService.cs ├── ReportingService2010.cs ├── SampleKey.snk ├── Setup │ ├── CreateUserStore.sql │ └── RestoreDatabase.sql ├── Web References │ └── localhost │ │ ├── ActiveState.datasource │ │ ├── CacheRefreshPlan.datasource │ │ ├── CacheRefreshPlanState.datasource │ │ ├── CatalogItem.datasource │ │ ├── DataRetrievalPlan.datasource │ │ ├── DataSetDefinition.datasource │ │ ├── DataSource.datasource │ │ ├── DataSourceDefinition.datasource │ │ ├── DataSourcePrompt.datasource │ │ ├── Event.datasource │ │ ├── ExpirationDefinition.datasource │ │ ├── Extension.datasource │ │ ├── ExtensionParameter.datasource │ │ ├── ExtensionSettings.datasource │ │ ├── ItemHistorySnapshot.datasource │ │ ├── ItemParameter.datasource │ │ ├── ItemReferenceData.datasource │ │ ├── Job.datasource │ │ ├── ModelCatalogItem.datasource │ │ ├── ModelDrillthroughReport.datasource │ │ ├── ModelItem.datasource │ │ ├── ParameterValue.datasource │ │ ├── ParameterValueOrFieldReference.datasource │ │ ├── Policy.datasource │ │ ├── Property.datasource │ │ ├── Reference.cs │ │ ├── Reference.map │ │ ├── ReportService2010.wsdl │ │ ├── Role.datasource │ │ ├── Schedule.datasource │ │ ├── ScheduleDefinitionOrReference.datasource │ │ ├── Subscription.datasource │ │ ├── Task.datasource │ │ └── Warning.datasource └── app.config ├── CustomSecuritySample2016 ├── App_LocalResources │ ├── Logon.aspx.Designer.cs │ └── Logon.aspx.resx ├── AuthenticationExtension.cs ├── AuthenticationUtilities.cs ├── Authorization.cs ├── CustomSecurity.Designer.cs ├── CustomSecurity.csproj ├── CustomSecurity.resx ├── CustomSecuritySample.sln ├── CustomSecuritySample.v12.suo ├── Logon.aspx ├── Logon.aspx.cs ├── Properties │ ├── Settings.Designer.cs │ └── Settings.settings ├── README.md ├── ReportExecutionService.cs ├── ReportingService2010.cs ├── Setup │ ├── CreateUserStore.sql │ └── RestoreDatabase.sql ├── Web References │ └── localhost │ │ ├── ActiveState.datasource │ │ ├── CacheRefreshPlan.datasource │ │ ├── CacheRefreshPlanState.datasource │ │ ├── CatalogItem.datasource │ │ ├── DataRetrievalPlan.datasource │ │ ├── DataSetDefinition.datasource │ │ ├── DataSource.datasource │ │ ├── DataSourceDefinition.datasource │ │ ├── DataSourcePrompt.datasource │ │ ├── Event.datasource │ │ ├── ExpirationDefinition.datasource │ │ ├── Extension.datasource │ │ ├── ExtensionParameter.datasource │ │ ├── ExtensionSettings.datasource │ │ ├── ItemHistorySnapshot.datasource │ │ ├── ItemParameter.datasource │ │ ├── ItemReferenceData.datasource │ │ ├── Job.datasource │ │ ├── ModelCatalogItem.datasource │ │ ├── ModelDrillthroughReport.datasource │ │ ├── ModelItem.datasource │ │ ├── ParameterValue.datasource │ │ ├── ParameterValueOrFieldReference.datasource │ │ ├── Policy.datasource │ │ ├── Property.datasource │ │ ├── Reference.cs │ │ ├── Reference.map │ │ ├── ReportService2010.wsdl │ │ ├── Role.datasource │ │ ├── Schedule.datasource │ │ ├── ScheduleDefinitionOrReference.datasource │ │ ├── Subscription.datasource │ │ ├── Task.datasource │ │ └── Warning.datasource ├── app.config └── obj │ └── Debug │ ├── CustomSecurity.csproj.FileListAbsolute.txt │ ├── CustomSecurity.csproj.GenerateResource.Cache │ ├── CustomSecurity.csprojResolveAssemblyReference.cache │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── Microsoft.Samples.ReportingServices.CustomSecurity.App_LocalResources.Logon.aspx.resources │ └── Microsoft.Samples.ReportingServices.CustomSecurity.CustomSecurity.resources ├── Docs ├── Get-Started-With-RVC.html ├── Get-Started-With-RVC.md ├── Get-Started-With-RVC │ ├── ErrorCreatingControl.png │ └── NewAspWebSite.png ├── SSRS.PNG └── style.css ├── Docs_14_0 ├── Get-Started-With-RVC.html ├── Get-Started-With-RVC.md ├── Get-Started-With-RVC │ └── NewAspWebSite.png ├── Set-100Percent-Height-With-RVC.html ├── Set-100Percent-Height-With-RVC.md ├── Set-Reference-To-Sql-Server-Spatial.html ├── Set-Reference-To-Sql-Server-Spatial.md └── style.css ├── License.md ├── PaginatedReportSamples ├── CountrySalesPerformance.rdl ├── Invoice.rdl ├── Labels.rdl ├── Letter.rdl ├── OrganizationExpenditures.rdl ├── README.md ├── RegionalSales.rdl └── Transcript.rdl ├── README.md └── SECURITY.md /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | # Build results 3 | [Dd]ebug/ 4 | [Dd]ebugPublic/ 5 | [Rr]elease/ 6 | [Rr]eleases/ 7 | x64/ 8 | x86/ 9 | bld/ 10 | [Bb]in/ 11 | [Oo]bj/ 12 | [Ll]og/ 13 | .vs/ 14 | App_LocalResources/ 15 | Web References/ -------------------------------------------------------------------------------- /APISamples/powershell/powershellSamples.ps1: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. 2 | # Licensed under the MIT License (MIT) 3 | 4 | <#============================================================================ 5 | File: powershellSamples.ps1 6 | Summary: Demonstrates examples to upload/download/delete an item in RS. 7 | -------------------------------------------------------------------- 8 | 9 | This source code is intended only as a supplement to Microsoft 10 | Development Tools and/or on-line documentation. See these other 11 | materials for detailed information regarding Microsoft code 12 | samples. 13 | THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF 14 | ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 15 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 16 | PARTICULAR PURPOSE. 17 | ===========================================================================#> 18 | 19 | $ReportPortalUri = 'http://myserver/reports' 20 | 21 | Write-Host "Upload an item..." 22 | $uploadItemPath = 'C:\reports\test.rdl' 23 | $catalogItemsUri = $ReportPortalUri + "/api/v2.0/CatalogItems" 24 | $bytes = [System.IO.File]::ReadAllBytes($uploadItemPath) 25 | $payload = @{ 26 | "@odata.type" = "#Model.Report"; 27 | "Content" = [System.Convert]::ToBase64String($bytes); 28 | "ContentType"=""; 29 | "Name" = 'test'; 30 | "Path" = '/test'; 31 | } | ConvertTo-Json 32 | Invoke-WebRequest -Uri $catalogItemsUri -Method Post -Body $payload -ContentType "application/json" -UseDefaultCredentials | Out-Null 33 | 34 | 35 | Write-Host "Download an item..." 36 | $downloadPath = 'C:\download\test.rdl' 37 | $catalogItemsApi = $ReportPortalUri + "/api/v2.0/CatalogItems(Path='/test')/Content/$value" 38 | $url = [string]::Format($catalogItemsApi, $item) 39 | $response = Invoke-WebRequest -Uri $url -Method Get -UseDefaultCredentials 40 | [System.IO.File]::WriteAllBytes($downloadPath, $response.Content) 41 | 42 | 43 | Write-Host "Delete an item..." 44 | $url = $ReportPortalUri + "/api/v2.0/CatalogItems(Path='/test')" 45 | Invoke-WebRequest -Uri $url -Method Delete -UseDefaultCredentials | Out-Null 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /APISamples/typescript/README.md: -------------------------------------------------------------------------------- 1 | # Getting started 2 | This project showcases the use of the Report Server API to build a simple website that lists CatalogItems in the report server, uploads new items, and gets the current user info. 3 | 4 | The sample uses Typescript, React and Webpack to generate a SPA web app. 5 | 6 | ## Setting up CORS 7 | By default, the report server follows a Same-Origin policy and requires that you add localhost to the list of allowed origins before you can run this sample. 8 | 9 | Set the values of the following configuration settings in your server: 10 | 11 | |Property Name| New Value| 12 | |-------------|----------| 13 | |AccessControlAllowCredentials|True| 14 | |AccessControlAllowHeaders|*| 15 | |AccessControlAllowMethods|*| 16 | |AccessControlAllowOrigin|http://localhost:8080| 17 | 18 | To learn how to change the configuration settings, go to the [Reporting Services Documentation](https://docs.microsoft.com/en-us/sql/reporting-services/tools/server-properties-advanced-page-reporting-services) 19 | 20 | ## Getting the source code and running the sample 21 | ```bash 22 | # clone repo 23 | git clone https://github.com/Microsoft/Reporting-Services RS-Samples 24 | 25 | # navigate to typescript source 26 | cd RS-Samples/APISamples/Typescript 27 | 28 | # install deps 29 | npm install 30 | 31 | # run the sample 32 | npm run dev 33 | ``` 34 | The samples assumes that the report server instance is running in localhost. 35 | # Contributing 36 | 37 | This project welcomes contributions and suggestions. Most contributions require you to agree to a 38 | Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us 39 | the rights to use your contribution. For details, visit https://cla.microsoft.com. 40 | 41 | When you submit a pull request, a CLA-bot will automatically determine whether you need to provide 42 | a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions 43 | provided by the bot. You will only need to do this once across all repos using our CLA. 44 | 45 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 46 | For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or 47 | contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. -------------------------------------------------------------------------------- /APISamples/typescript/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "report-server-api-sample", 3 | "version": "1.0.0", 4 | "description": "report-server-api Sample", 5 | "scripts": { 6 | "dev": "webpack-dev-server" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "devDependencies": { 11 | "@types/axios": "^0.14.0", 12 | "@types/react": "^16.0.5", 13 | "@types/react-dom": "^15.5.4", 14 | "@types/react-router-dom": "^4.0.7", 15 | "html-webpack-plugin": "^2.30.1", 16 | "ts-loader": "^2.3.2", 17 | "typescript": "^2.4.0", 18 | "webpack": "^3.5.3", 19 | "webpack-dev-server": "^2.7.1" 20 | }, 21 | "dependencies": { 22 | "axios": "^0.19.0", 23 | "moment": "^2.18.1", 24 | "react-router-dom": "^4.2.2" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /APISamples/typescript/src/api.ts: -------------------------------------------------------------------------------- 1 | import { CatalogItem } from './api'; 2 | import axiosLib, { AxiosInstance } from "axios"; 3 | export class Api { 4 | private serverUrl:string; 5 | private axios:AxiosInstance; 6 | 7 | constructor(server:string = 'http://localhost/reports'){ 8 | this.axios = axiosLib.create({ 9 | baseURL: `${server}/api/v2.0`, 10 | withCredentials: true, 11 | headers: { 12 | 'Content-Type':'application/json;charset=UTF-8' 13 | } 14 | }); 15 | } 16 | 17 | requestOptions(method:string, body?:any): RequestInit { 18 | return { 19 | credentials: 'include', 20 | mode: 'cors', 21 | headers: { 22 | 'Content-Type':'application/json;charset=UTF-8' 23 | }, 24 | method, 25 | body: JSON.stringify(body) 26 | } 27 | } 28 | 29 | async getFolderItemsAsync(path:string = '/') : Promise { 30 | let response = await this.axios.get(`/Folders(Path='${path}')/CatalogItems`); 31 | let items = response.data; 32 | return items.value; 33 | } 34 | 35 | async postCatalogItemAsync(item:CatalogItem) : Promise { 36 | let url: string = `${this.serverUrl}/CatalogItems`; 37 | let response = await this.axios.post('/CatalogItems',item); 38 | let createdItem = response.data; 39 | return createdItem; 40 | } 41 | 42 | async meAsync() : Promise { 43 | let url: string = `${this.serverUrl}/me`; 44 | let response = await this.axios.get('/me'); 45 | let item = response.data 46 | return item; 47 | } 48 | 49 | async uploadFileAsync(file: File) : Promise { 50 | let fileInfo = await this.getFileInfo(file); 51 | let path = window.location.hash.substring(1); 52 | path = path.length > 1 ? path : ''; 53 | let item:any = { 54 | Content: fileInfo.content, 55 | Path: `${path}/${fileInfo.name}`, 56 | Name: fileInfo.name, 57 | ContentType: fileInfo.contentType 58 | } 59 | 60 | switch (fileInfo.extension.toLocaleLowerCase()) { 61 | case 'rdl': 62 | item['@odata.type'] = '#Model.Report'; 63 | break; 64 | case 'rsd': 65 | item['@odata.type'] = '#Model.DataSet'; 66 | break; 67 | case 'rds': 68 | item.ContentType = 'text/xml'; 69 | item['@odata.type'] = '#Model.Resource'; 70 | break; 71 | case 'rsc': 72 | item['@odata.type'] = '#Model.Component'; 73 | break; 74 | case 'rsmobile': 75 | item['@odata.type'] = '#Model.MobileReport'; 76 | break; 77 | case 'pbix': 78 | item['@odata.type'] = '#Model.PowerBIReport'; 79 | break; 80 | case 'xls': 81 | case 'xlsb': 82 | case 'xlsm': 83 | case 'xlsx': 84 | case 'csv': 85 | item['@odata.type'] = '#Model.ExcelWorkbook'; 86 | break; 87 | default: 88 | item['@odata.type'] = '#Model.Resource'; 89 | break; 90 | } 91 | 92 | return api.postCatalogItemAsync(item); 93 | } 94 | 95 | private getFileInfo(file:File): Promise { 96 | let p = new Promise((res, rej) => { 97 | let reader = new FileReader(); 98 | let fileInfo:any = { 99 | name:file.name, 100 | extension: file.name.substring(file.name.lastIndexOf('.')+1), 101 | size: file.size 102 | } 103 | reader.onload = (metadata) => { 104 | fileInfo.content = reader.result.substring(reader.result.indexOf(',')+1); 105 | fileInfo.contentType = reader.result.replace(/data:(.*);.*/,'$1'); 106 | res(fileInfo); 107 | } 108 | 109 | reader.readAsDataURL(file); 110 | }) 111 | 112 | return p; 113 | } 114 | } 115 | 116 | export const api = new Api(); 117 | 118 | 119 | export enum CatalogItemType { 120 | Unknown = "Unknown", 121 | Folder = "Folder", 122 | Report = "Report", 123 | DataSource = "DataSource", 124 | DataSet = "DataSet", 125 | Component = "Component", 126 | Resource = "Resource", 127 | Kpi = "Kpi", 128 | MobileReport = "MobileReport", 129 | LinkedReport = "LinkedReport", 130 | ReportModel = "ReportModel", 131 | PowerBIReport = "PowerBIReport", 132 | ExcelWorkbook = "ExcelWorkbook" 133 | } 134 | 135 | export interface CatalogItem { 136 | Id?: string; 137 | Name?: string; 138 | Description?: string; 139 | Path?: string; 140 | Type: CatalogItemType; 141 | Hidden?: boolean; 142 | Size?: number; 143 | ModifiedBy?: string; 144 | ModifiedDate?: Date; 145 | CreatedBy?: string; 146 | CreatedDate?: Date; 147 | ParentFolderId?: string; 148 | ContentType?: string; 149 | Content?: string; 150 | IsFavorite?: boolean; 151 | } 152 | 153 | export interface User { 154 | Id?: string; 155 | Username?: string; 156 | DisplayName?: string; 157 | HasFavoriteItems?: boolean; 158 | MyReportsPath?: string; 159 | } 160 | 161 | interface IFileInfo { 162 | name: string; 163 | extension: string; 164 | content: string; 165 | contentType: string; 166 | size: number; 167 | } -------------------------------------------------------------------------------- /APISamples/typescript/src/app.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import * as reactDOM from 'react-dom'; 3 | import { HashRouter, Route } from 'react-router-dom'; 4 | import { Home } from "./home"; 5 | import { RouteProps } from "react-router"; 6 | 7 | reactDOM.render( 8 | ( 9 | 10 | }/> 11 | 12 | ), 13 | document.getElementById('container') 14 | ); -------------------------------------------------------------------------------- /APISamples/typescript/src/home.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { api, CatalogItem, CatalogItemType, User } from "./api"; 3 | import { Link } from "react-router-dom"; 4 | import * as moment from 'moment'; 5 | import { Navbar } from "./navbar"; 6 | 7 | interface IHomeState { 8 | items?: CatalogItem[], 9 | user?: User, 10 | path: string 11 | } 12 | 13 | export class Home extends React.Component { 14 | 15 | constructor(){ 16 | super(); 17 | this.state = { path:'/' }; 18 | } 19 | 20 | componentDidMount(){ 21 | api.meAsync().then((user:User)=>this.setState({user})); 22 | api.getFolderItemsAsync().then((items:CatalogItem[]) => this.setState({items:items.sort((a,b)=>a.Type.localeCompare(b.Type))})); 23 | } 24 | 25 | componentWillReceiveProps(props:any){ 26 | this.setState({path:props.path.pathname, items:undefined}); 27 | api.getFolderItemsAsync(props.path.pathname) 28 | .then((items:CatalogItem[]) => this.setState({items:items.sort((a,b)=>a.Type.localeCompare(b.Type))})); 29 | } 30 | 31 | render() { 32 | if(!this.state.items) 33 | return ( 34 |
35 |
36 | 37 |
38 |
39 |

Loading Items...

40 |
41 |
42 | ); 43 | 44 | return ( 45 |
46 |
47 |
48 | 49 |
50 |
51 |
52 |

53 | Reports 54 |

55 |
56 |
57 |
58 |
59 |
60 | 61 |
62 | {this.state.items.map( (item:CatalogItem) => )} 63 |
64 |
65 |
66 |
67 | ) 68 | } 69 | } 70 | 71 | let CatalogItemTile:React.SFC<{item:CatalogItem}> = ({item}) => { 72 | let tagColor; 73 | 74 | switch(item.Type){ 75 | case CatalogItemType.Report: 76 | tagColor = 'is-danger'; 77 | break; 78 | case CatalogItemType.PowerBIReport: 79 | tagColor = 'is-warning'; 80 | break; 81 | case CatalogItemType.Folder: 82 | tagColor = 'is-info'; 83 | break; 84 | default: 85 | tagColor = 'is-primary'; 86 | break; 87 | } 88 | 89 | return ( 90 |
91 |
92 |
93 |
94 | {item.Type === CatalogItemType.Folder ? {item.Name} : {item.Name}}
95 | {item.Description}
96 | @{item.ModifiedBy}
97 | {moment(item.ModifiedDate).format('lll')}
98 |
{item.Type.toUpperCase()}
99 |
100 |
101 |
102 |
103 | ) 104 | } 105 | 106 | let BreadCrumb:React.SFC<{path:string}> = ({path}) => { 107 | let parts = path.substring(1).split('/'); 108 | return ( 109 | 115 | ) 116 | } -------------------------------------------------------------------------------- /APISamples/typescript/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CONTOSO Reports 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | -------------------------------------------------------------------------------- /APISamples/typescript/src/navbar.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import { api, User, CatalogItem, CatalogItemType } from "./api"; 3 | 4 | interface INavbarProps { 5 | user?: User; 6 | } 7 | 8 | export class Navbar extends React.Component{ 9 | handleFileUpload = (event:any) => { 10 | let files = event.target.files 11 | api.uploadFileAsync(files[0]).then( 12 | _ => location.reload() 13 | ); 14 | } 15 | 16 | render(){ 17 | return ( 18 |
19 |
20 |
21 |

CONTOSO

22 |
23 |
24 |
25 |
26 | 35 |
36 |
37 |

{this.props.user && this.props.user.DisplayName}

38 |
39 |
40 |
41 | ); 42 | } 43 | } -------------------------------------------------------------------------------- /APISamples/typescript/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES5", 4 | "module": "commonjs", 5 | "lib": ["dom","es2015","es6"], 6 | "jsx": "react", 7 | "sourceMap": true, 8 | "strict": true 9 | } 10 | } -------------------------------------------------------------------------------- /APISamples/typescript/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const webpack = require('webpack'); 3 | const HtmlWebpackPlugin = require('html-webpack-plugin'); 4 | 5 | module.exports = { 6 | entry: { 7 | main: ['./src/app.tsx' 8 | ], 9 | }, 10 | output: { 11 | filename: '[name].js', 12 | path: path.resolve(__dirname, 'dist/app'), 13 | publicPath: '/' 14 | }, 15 | resolve: { 16 | extensions: ['.ts', '.tsx', '.js'] 17 | }, 18 | module: { 19 | rules: [ 20 | { 21 | test: /\.tsx?$/, 22 | loader: ['ts-loader'] 23 | } 24 | ] 25 | }, 26 | externals: { 27 | react: 'React', 28 | 'react-dom': 'ReactDOM' 29 | }, 30 | plugins: [ 31 | new HtmlWebpackPlugin({ 32 | template: __dirname + '/src/index.html', 33 | filename: 'index.html', 34 | inject: 'body' 35 | }), 36 | new webpack.NamedModulesPlugin() 37 | ], 38 | devServer: { 39 | historyApiFallback: true, 40 | host: '0.0.0.0' 41 | }, 42 | // Enable sourcemaps for debugging webpack's output. 43 | devtool: 'inline-source-map', 44 | } -------------------------------------------------------------------------------- /CustomSecuritySample/App_LocalResources/Logon.aspx.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.17929 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Microsoft.Samples.ReportingServices.CustomSecurity.App_LocalResources { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Logon_aspx { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Logon_aspx() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Samples.ReportingServices.CustomSecurity.App_LocalResources.Logon.aspx", typeof(Logon_aspx).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized string similar to Logon. 65 | /// 66 | internal static string BtnLogonResource1 { 67 | get { 68 | return ResourceManager.GetString("BtnLogonResource1", resourceCulture); 69 | } 70 | } 71 | 72 | /// 73 | /// Looks up a localized string similar to Register User. 74 | /// 75 | internal static string BtnRegisterResource1 { 76 | get { 77 | return ResourceManager.GetString("BtnRegisterResource1", resourceCulture); 78 | } 79 | } 80 | 81 | /// 82 | /// Looks up a localized string similar to Invalid username or password. 83 | /// 84 | internal static string InvalidUsernamePassword { 85 | get { 86 | return ResourceManager.GetString("InvalidUsernamePassword", resourceCulture); 87 | } 88 | } 89 | 90 | /// 91 | /// Looks up a localized string similar to SQL Server Reporting Services Sample. 92 | /// 93 | internal static string Label1Resource1 { 94 | get { 95 | return ResourceManager.GetString("Label1Resource1", resourceCulture); 96 | } 97 | } 98 | 99 | /// 100 | /// Looks up a localized string similar to Password. 101 | /// 102 | internal static string LblPwdResource1 { 103 | get { 104 | return ResourceManager.GetString("LblPwdResource1", resourceCulture); 105 | } 106 | } 107 | 108 | /// 109 | /// Looks up a localized string similar to UserName:. 110 | /// 111 | internal static string LblUserResource1 { 112 | get { 113 | return ResourceManager.GetString("LblUserResource1", resourceCulture); 114 | } 115 | } 116 | 117 | /// 118 | /// Looks up a localized string similar to Logon successful: User is authenticated.. 119 | /// 120 | internal static string LoginSuccess { 121 | get { 122 | return ResourceManager.GetString("LoginSuccess", resourceCulture); 123 | } 124 | } 125 | 126 | /// 127 | /// Looks up a localized string similar to The user name that was entered contains characters not supported by report server custom authentication.. 128 | /// 129 | internal static string UserNameError { 130 | get { 131 | return ResourceManager.GetString("UserNameError", resourceCulture); 132 | } 133 | } 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /CustomSecuritySample/App_LocalResources/Logon.aspx.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | Logon 119 | 120 | 121 | Register User 122 | 123 | 124 | Invalid username or password 125 | 126 | 127 | SQL Server Reporting Services Sample 128 | 129 | 130 | Password 131 | 132 | 133 | UserName: 134 | 135 | 136 | Logon successful: User is authenticated. 137 | 138 | 139 | The user name that was entered contains characters not supported by report server custom authentication. 140 | 141 | -------------------------------------------------------------------------------- /CustomSecuritySample/Configure.ps1: -------------------------------------------------------------------------------- 1 | Write-Host "Creating the User Store Database" 2 | & sqlcmd -S "." -i "Setup\CreateUserStore.Sql" 3 | 4 | Write-Host "Copying Logon.aspx page `n" -ForegroundColor Green 5 | Copy-Item -Path Logon.aspx -Destination "C:\Program Files\Microsoft Power BI Report Server\PBIRS\ReportServer\" 6 | 7 | Write-Host "Copying Microsoft.Samples.ReportingServices.CustomSecurity.dll `n" -ForegroundColor Green 8 | Copy-Item -Path Microsoft.Samples.ReportingServices.CustomSecurity.dll -Destination "C:\Program Files\Microsoft Power BI Report Server\PBIRS\ReportServer\Bin\" 9 | Copy-Item -Path Microsoft.Samples.ReportingServices.CustomSecurity.dll -Destination "C:\Program Files\Microsoft Power BI Report Server\PBIRS\Portal\" 10 | Copy-Item -Path Microsoft.Samples.ReportingServices.CustomSecurity.dll -Destination "C:\Program Files\Microsoft Power BI Report Server\PBIRS\PowerBi" 11 | 12 | Write-Host "Copying Microsoft.Samples.ReportingServices.CustomSecurity.dll.config `n" -ForegroundColor Green 13 | Copy-Item -Path Microsoft.Samples.ReportingServices.CustomSecurity.dll.config -Destination "C:\Program Files\Microsoft Power BI Report Server\PBIRS\ReportServer\Bin\" 14 | Copy-Item -Path Microsoft.Samples.ReportingServices.CustomSecurity.dll.config -Destination "C:\Program Files\Microsoft Power BI Report Server\PBIRS\Portal\" 15 | Copy-Item -Path Microsoft.Samples.ReportingServices.CustomSecurity.dll.config -Destination "C:\Program Files\Microsoft Power BI Report Server\PBIRS\PowerBi" 16 | 17 | Write-Host "Copying Microsoft.Samples.ReportingServices.CustomSecurity.pdb `n" -ForegroundColor Green 18 | Copy-Item -Path Microsoft.Samples.ReportingServices.CustomSecurity.pdb -Destination "C:\Program Files\Microsoft Power BI Report Server\PBIRS\ReportServer\Bin\" 19 | Copy-Item -Path Microsoft.Samples.ReportingServices.CustomSecurity.pdb -Destination "C:\Program Files\Microsoft Power BI Report Server\PBIRS\Portal\" 20 | Copy-Item -Path Microsoft.Samples.ReportingServices.CustomSecurity.pdb -Destination "C:\Program Files\Microsoft Power BI Report Server\PBIRS\PowerBi" 21 | 22 | Write-Host "Updating rsreportserver.config `n" -ForegroundColor Green 23 | $rsConfigFilePath = "C:\Program Files\Microsoft Power BI Report Server\PBIRS\ReportServer\rsreportserver.config" 24 | [xml]$rsConfigFile = (Get-Content $rsConfigFilePath) 25 | Write-Host "Copy of the original config file in $rsConfigFilePath.backup" 26 | $rsConfigFile.Save("$rsConfigFilePath.backup") 27 | $rsConfigFile.Configuration.Authentication.AuthenticationTypes.InnerXml = "" 28 | 29 | $extension = $rsConfigFile.CreateElement("Extension") 30 | $extension.SetAttribute("Name","Forms") 31 | $extension.SetAttribute("Type","Microsoft.Samples.ReportingServices.CustomSecurity.Authorization, Microsoft.Samples.ReportingServices.CustomSecurity") 32 | $configuration =$rsConfigFile.CreateElement("Configuration") 33 | $configuration.InnerXml="`nusername`n" 34 | $extension.AppendChild($configuration) 35 | $rsConfigFile.Configuration.Extensions.Security.AppendChild($extension) 36 | $rsConfigFile.Configuration.Extensions.Authentication.Extension.Name ="Forms" 37 | $rsConfigFile.Configuration.Extensions.Authentication.Extension.Type ="Microsoft.Samples.ReportingServices.CustomSecurity.AuthenticationExtension,Microsoft.Samples.ReportingServices.CustomSecurity" 38 | 39 | $rsConfigFile.Save($rsConfigFilePath) 40 | 41 | Write-Host "Updating RSSrvPolicy.config `n" -ForegroundColor Green 42 | $rsPolicyFilePath = "C:\Program Files\Microsoft Power BI Report Server\PBIRS\ReportServer\rssrvpolicy.config" 43 | [xml]$rsPolicy = (Get-Content $rsPolicyFilePath) 44 | Write-Host "Copy of the original config file in $rsPolicyFilePath.backup" 45 | $rsPolicy.Save("$rsPolicyFilePath.backup") 46 | 47 | $codeGroup = $rsPolicy.CreateElement("CodeGroup") 48 | $codeGroup.SetAttribute("class","UnionCodeGroup") 49 | $codeGroup.SetAttribute("version","1") 50 | $codeGroup.SetAttribute("Name","SecurityExtensionCodeGroup") 51 | $codeGroup.SetAttribute("Description","Code group for the sample security extension") 52 | $codeGroup.SetAttribute("PermissionSetName","FullTrust") 53 | $codeGroup.InnerXml ="" 54 | $rsPolicy.Configuration.mscorlib.security.policy.policylevel.CodeGroup.CodeGroup.AppendChild($codeGroup) 55 | $rsPolicy.Save($rsPolicyFilePath) 56 | 57 | 58 | Write-Host "Updating web.config `n" -ForegroundColor Green 59 | $webConfigFilePath = "C:\Program Files\Microsoft Power BI Report Server\PBIRS\ReportServer\web.config" 60 | [xml]$webConfig = (Get-Content $webConfigFilePath) 61 | Write-Host "Copy of the original config file in $webConfigFilePath.backup" 62 | $webConfig.Save("$webConfigFilePath.backup") 63 | $webConfig.configuration.'system.web'.identity.impersonate="false" 64 | $webConfig.configuration.'system.web'.authentication.mode="Forms" 65 | $webConfig.configuration.'system.web'.authentication.InnerXml="" 66 | $authorization = $webConfig.CreateElement("authorization") 67 | $authorization.InnerXml="" 68 | $webConfig.configuration.'system.web'.AppendChild($authorization) 69 | $webConfig.Save($webConfigFilePath) 70 | 71 | 72 | Write-Host "Adding Machine Keys to $rsConfigFilePath `n" -ForegroundColor Green 73 | [xml]$rsConfigFile = (Get-Content $rsConfigFilePath) 74 | $machineKey = $rsConfigFile.CreateElement("MachineKey") 75 | $machineKey.SetAttribute("ValidationKey","6A883FF722BC07963704B124939B9E584673875C744CC2BDA0A076C8668AA8335FC0F5696CFFE5A56FA5E32BC00E0104710BA386FBFF8DCAA3BF3EE1A9B288A5") 76 | $machineKey.SetAttribute("DecryptionKey","AF017F3FFDBDD11B813FCDFBB8D4CEB32FA0CB999954A53E") 77 | $machineKey.SetAttribute("Validation","AES") 78 | $machineKey.SetAttribute("Decryption","AES") 79 | $rsConfigFile.Configuration.AppendChild($machineKey) 80 | $rsConfigFile.Save($rsConfigFilePath) 81 | 82 | 83 | Write-Host "Configuring Passthrough cookies `n" -ForegroundColor Green 84 | [xml]$rsConfigFile = (Get-Content $rsConfigFilePath) 85 | $customUI = $rsConfigFile.CreateElement("CustomAuthenticationUI") 86 | $customUI.InnerXml ="sqlAuthCookie" 87 | $rsConfigFile.Configuration.UI.AppendChild($customUI) 88 | $rsConfigFile.Save($rsConfigFilePath) 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /CustomSecuritySample/CustomSecurity.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Microsoft.Samples.ReportingServices.CustomSecurity { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class CustomSecurity { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal CustomSecurity() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Samples.ReportingServices.CustomSecurity.CustomSecurity", typeof(CustomSecurity).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized string similar to An error occurred while attempting to add the account. . 65 | /// 66 | internal static string AddAccountError { 67 | get { 68 | return ResourceManager.GetString("AddAccountError", resourceCulture); 69 | } 70 | } 71 | 72 | /// 73 | /// Looks up a localized string similar to Root element is not \"AdminConfiguration\" in config data.. 74 | /// 75 | internal static string AdminConfiguration { 76 | get { 77 | return ResourceManager.GetString("AdminConfiguration", resourceCulture); 78 | } 79 | } 80 | 81 | /// 82 | /// Looks up a localized string similar to No Url reservation found for the \"ReportServerWebService\" application.. 83 | /// 84 | internal static string MissingUrlReservation { 85 | get { 86 | return ResourceManager.GetString("MissingUrlReservation", resourceCulture); 87 | } 88 | } 89 | 90 | /// 91 | /// Looks up a localized string similar to Number of operation names don't match.. 92 | /// 93 | internal static string OperationNameError { 94 | get { 95 | return ResourceManager.GetString("OperationNameError", resourceCulture); 96 | } 97 | } 98 | 99 | /// 100 | /// Looks up a localized string similar to An error occurred while attempting to get the ReportServer Url. . 101 | /// 102 | internal static string RSUrlError { 103 | get { 104 | return ResourceManager.GetString("RSUrlError", resourceCulture); 105 | } 106 | } 107 | 108 | /// 109 | /// Looks up a localized string similar to Unrecognized configuration element.. 110 | /// 111 | internal static string UnrecognizedElement { 112 | get { 113 | return ResourceManager.GetString("UnrecognizedElement", resourceCulture); 114 | } 115 | } 116 | 117 | /// 118 | /// Looks up a localized string similar to user registered. 119 | /// 120 | internal static string UserRegistered { 121 | get { 122 | return ResourceManager.GetString("UserRegistered", resourceCulture); 123 | } 124 | } 125 | 126 | /// 127 | /// Looks up a localized string similar to Exception verifying user. . 128 | /// 129 | internal static string VerifyError { 130 | get { 131 | return ResourceManager.GetString("VerifyError", resourceCulture); 132 | } 133 | } 134 | 135 | /// 136 | /// Looks up a localized string similar to An error occurred while attempting to verify the user.. 137 | /// 138 | internal static string VerifyUserException { 139 | get { 140 | return ResourceManager.GetString("VerifyUserException", resourceCulture); 141 | } 142 | } 143 | 144 | /// 145 | /// Looks up a localized string similar to No WMI class found.. 146 | /// 147 | internal static string WMIClassError { 148 | get { 149 | return ResourceManager.GetString("WMIClassError", resourceCulture); 150 | } 151 | } 152 | } 153 | } 154 | -------------------------------------------------------------------------------- /CustomSecuritySample/CustomSecurity.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | An error occurred while attempting to add the account. 122 | 123 | 124 | Root element is not \"AdminConfiguration\" in config data. 125 | 126 | 127 | No Url reservation found for the \"ReportServerWebService\" application. 128 | 129 | 130 | Number of operation names don't match. 131 | 132 | 133 | An error occurred while attempting to get the ReportServer Url. 134 | 135 | 136 | Unrecognized configuration element. 137 | 138 | 139 | user registered 140 | 141 | 142 | Exception verifying user. 143 | 144 | 145 | An error occurred while attempting to verify the user. 146 | 147 | 148 | No WMI class found. 149 | 150 | -------------------------------------------------------------------------------- /CustomSecuritySample/CustomSecuritySample.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27703.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomSecurity", "CustomSecurity.csproj", "{FE32AA5A-8EAA-43B9-87EE-73271F89BA52}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | Description = Custom Security Extension Sample 13 | EndGlobalSection 14 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 15 | {FE32AA5A-8EAA-43B9-87EE-73271F89BA52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 16 | {FE32AA5A-8EAA-43B9-87EE-73271F89BA52}.Debug|Any CPU.Build.0 = Debug|Any CPU 17 | {FE32AA5A-8EAA-43B9-87EE-73271F89BA52}.Release|Any CPU.ActiveCfg = Release|Any CPU 18 | {FE32AA5A-8EAA-43B9-87EE-73271F89BA52}.Release|Any CPU.Build.0 = Release|Any CPU 19 | EndGlobalSection 20 | GlobalSection(SolutionProperties) = preSolution 21 | HideSolutionNode = FALSE 22 | EndGlobalSection 23 | GlobalSection(ExtensibilityGlobals) = postSolution 24 | SolutionGuid = {762DDE47-EF1C-4247-9CE2-6E688CB2820A} 25 | EndGlobalSection 26 | EndGlobal 27 | -------------------------------------------------------------------------------- /CustomSecuritySample/Logon.aspx: -------------------------------------------------------------------------------- 1 | <%@ Page language="c#" Codebehind="Logon.aspx.cs" AutoEventWireup="false" Inherits="Microsoft.Samples.ReportingServices.CustomSecurity.Logon, Microsoft.Samples.ReportingServices.CustomSecurity" Culture="auto" meta:resourcekey="PageResource1" UICulture="auto" %> 2 | 3 | 4 | 5 | Sql Server 2016 Reporting Services Samples 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | User Name: 15 | 17 | 19 | Password:  21 | 23 | 25 | 27 | 29 |
30 | 31 | 32 | -------------------------------------------------------------------------------- /CustomSecuritySample/Logon.aspx.cs: -------------------------------------------------------------------------------- 1 | #region 2 | // Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. 3 | // Licensed under the MIT License (MIT) 4 | /*============================================================================ 5 | File: Logon.aspx.cs 6 | Summary: The code-behind for a logon page that supports Forms 7 | Authentication in a custom security extension 8 | -------------------------------------------------------------------- 9 | This file is part of Microsoft SQL Server Code Samples. 10 | 11 | This source code is intended only as a supplement to Microsoft 12 | Development Tools and/or on-line documentation. See these other 13 | materials for detailed information regarding Microsoft code 14 | samples. 15 | 16 | THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF 17 | ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 18 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 19 | PARTICULAR PURPOSE. 20 | ===========================================================================*/ 21 | #endregion 22 | 23 | using System; 24 | using System.Collections; 25 | using System.ComponentModel; 26 | using System.Data; 27 | using System.Drawing; 28 | using System.Web; 29 | using System.Web.SessionState; 30 | using System.Web.UI; 31 | using System.Web.UI.WebControls; 32 | using System.Web.UI.HtmlControls; 33 | using System.Data.SqlClient; 34 | using System.Security.Cryptography; 35 | using System.Web.Security; 36 | using Microsoft.ReportingServices.Interfaces; 37 | using Microsoft.Samples.ReportingServices.CustomSecurity.App_LocalResources; 38 | using System.Globalization; 39 | 40 | namespace Microsoft.Samples.ReportingServices.CustomSecurity 41 | { 42 | public class Logon : System.Web.UI.Page 43 | { 44 | protected System.Web.UI.WebControls.Label LblUser; 45 | protected System.Web.UI.WebControls.TextBox TxtPwd; 46 | protected System.Web.UI.WebControls.TextBox TxtUser; 47 | protected System.Web.UI.WebControls.Button BtnRegister; 48 | protected System.Web.UI.WebControls.Button BtnLogon; 49 | protected System.Web.UI.WebControls.Label lblMessage; 50 | protected System.Web.UI.WebControls.Label Label1; 51 | protected System.Web.UI.WebControls.Label LblPwd; 52 | 53 | private void Page_Load(object sender, System.EventArgs e) 54 | { 55 | 56 | } 57 | 58 | #region Web Form Designer generated code 59 | override protected void OnInit(EventArgs e) 60 | { 61 | InitializeComponent(); 62 | base.OnInit(e); 63 | } 64 | 65 | private void InitializeComponent() 66 | { 67 | this.BtnLogon.Click += new System.EventHandler(this.ServerBtnLogon_Click); 68 | this.BtnRegister.Click += new System.EventHandler(this.BtnRegister_Click); 69 | this.Load += new System.EventHandler(this.Page_Load); 70 | 71 | } 72 | #endregion 73 | 74 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] 75 | private void BtnRegister_Click(object sender, 76 | System.EventArgs e) 77 | { 78 | string salt = AuthenticationUtilities.CreateSalt(5); 79 | string passwordHash = 80 | AuthenticationUtilities.CreatePasswordHash(TxtPwd.Text, salt); 81 | if (AuthenticationUtilities.ValidateUserName(TxtUser.Text)) 82 | { 83 | try 84 | { 85 | AuthenticationUtilities.StoreAccountDetails( 86 | TxtUser.Text, passwordHash, salt); 87 | } 88 | catch(Exception ex) 89 | { 90 | lblMessage.Text = string.Format(CultureInfo.InvariantCulture, ex.Message); 91 | } 92 | } 93 | else 94 | { 95 | 96 | lblMessage.Text = string.Format(CultureInfo.InvariantCulture, 97 | Logon_aspx.UserNameError); 98 | } 99 | } 100 | 101 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] 102 | private void ServerBtnLogon_Click(object sender, 103 | System.EventArgs e) 104 | { 105 | bool passwordVerified = false; 106 | try 107 | { 108 | passwordVerified = 109 | AuthenticationUtilities.VerifyPassword(TxtUser.Text,TxtPwd.Text); 110 | if (passwordVerified) 111 | { 112 | FormsAuthentication.RedirectFromLoginPage( 113 | TxtUser.Text, false); 114 | } 115 | else 116 | { 117 | Response.Redirect("logon.aspx"); 118 | } 119 | } 120 | catch(Exception ex) 121 | { 122 | lblMessage.Text = string.Format(CultureInfo.InvariantCulture, ex.Message); 123 | return; 124 | } 125 | if (passwordVerified == true ) 126 | { 127 | // The user is authenticated 128 | // At this point, an authentication ticket is normally created 129 | // This can subsequently be used to generate a GenericPrincipal 130 | // object for .NET authorization purposes 131 | // For details, see "How To: Use Forms authentication with 132 | // GenericPrincipal objects 133 | lblMessage.Text = string.Format(CultureInfo.InvariantCulture, 134 | Logon_aspx.LoginSuccess); 135 | BtnRegister.Enabled = false; 136 | } 137 | else 138 | { 139 | lblMessage.Text = string.Format(CultureInfo.InvariantCulture, 140 | Logon_aspx.InvalidUsernamePassword); 141 | } 142 | } 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /CustomSecuritySample/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Microsoft.Samples.ReportingServices.CustomSecurity.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.ApplicationScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)] 29 | [global::System.Configuration.DefaultSettingValueAttribute("http://localhost:80/ReportServer_SQL2014/ReportService2010.asmx")] 30 | public string Microsoft_Samples_ReportingServices_CustomSecurity_localhost_ReportingService2010 { 31 | get { 32 | return ((string)(this["Microsoft_Samples_ReportingServices_CustomSecurity_localhost_ReportingService2010" + 33 | ""])); 34 | } 35 | } 36 | 37 | [global::System.Configuration.ApplicationScopedSettingAttribute()] 38 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 39 | [global::System.Configuration.DefaultSettingValueAttribute("Server=localhost; Integrated Security=SSPI;database=UserAccounts")] 40 | public string Database_ConnectionString { 41 | get { 42 | return ((string)(this["Database_ConnectionString"])); 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /CustomSecuritySample/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | http://localhost:80/ReportServer_SQL2014/ReportService2010.asmx 7 | 8 | 9 | Server=localhost; Integrated Security=SSPI;database=UserAccounts 10 | 11 | 12 | -------------------------------------------------------------------------------- /CustomSecuritySample/SampleKey.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reporting-Services/acc2ee0d1884765e4b5213149430fb063d166719/CustomSecuritySample/SampleKey.snk -------------------------------------------------------------------------------- /CustomSecuritySample/Setup/CreateUserStore.sql: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. 3 | Licensed under the MIT License (MIT) 4 | 5 | This source code is intended only as a supplement to Microsoft 6 | Development Tools and/or on-line documentation. See these other 7 | materials for detailed information regarding Microsoft code samples. 8 | 9 | THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 10 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 11 | IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 12 | PARTICULAR PURPOSE. 13 | *****************************************************************************/ 14 | 15 | USE master 16 | GO 17 | -- create a database for the security information 18 | IF EXISTS (SELECT * FROM master..sysdatabases WHERE name = 19 | 'UserAccounts') 20 | DROP DATABASE UserAccounts 21 | GO 22 | CREATE DATABASE UserAccounts 23 | GO 24 | USE UserAccounts 25 | GO 26 | CREATE TABLE [Users] ( 27 | [UserName] [varchar] (255) NOT NULL , 28 | [PasswordHash] [varchar] (50) NOT NULL , 29 | [salt] [varchar] (10) NOT NULL, 30 | CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED 31 | ( 32 | [UserName] 33 | ) ON [PRIMARY] 34 | ) ON [PRIMARY] 35 | GO 36 | -- create a stored procedure to register user details 37 | CREATE PROCEDURE RegisterUser 38 | @userName varchar(255), 39 | @passwordHash varchar(50), 40 | @salt varchar(10) 41 | AS 42 | INSERT INTO Users VALUES(@userName, @passwordHash, @salt) 43 | GO 44 | -- create a stored procedure to retrieve user details 45 | CREATE PROCEDURE LookupUser 46 | @userName varchar(255) 47 | AS 48 | SELECT PasswordHash, salt 49 | FROM Users 50 | WHERE UserName = @userName 51 | GO 52 | 53 | 54 | -- 55 | -- Start security grants 56 | -- 57 | 58 | -- Capture the OS version in a temp table so that we can pick 59 | -- the correct windows account to grant access to for the objects 60 | -- defined in this file. This enables ASP.NET programs to access 61 | -- these objects. 62 | CREATE TABLE #GetVersionValues 63 | ( 64 | [Index] int, 65 | [Name] sysname, 66 | Internal_value int, 67 | Character_Value sysname 68 | ); 69 | GO 70 | 71 | INSERT #GetVersionValues 72 | EXEC master.dbo.xp_msver 'WindowsVersion'; 73 | GO 74 | 75 | DECLARE @OSVersion decimal(9, 2); 76 | DECLARE @ASPUserName nvarchar(100); 77 | DECLARE @NetworkService nvarchar(100); 78 | 79 | -- For globalization purposes, the sample install script uses a SID to set NT AUTHORITY\NETWORK SERVICE 80 | -- SELECT SUSER_SID('NT AUTHORITY\NETWORK SERVICE') returns the English SID. 81 | SET @NetworkService = SUSER_SNAME(0x010100000000000514000000); 82 | 83 | SELECT @OSVersion = CONVERT(decimal(9, 2), SUBSTRING(Character_Value, 1, CHARINDEX(' ', Character_Value) - 1)) 84 | FROM #GetVersionValues; 85 | 86 | -- IIS6 uses a different account to run web apps under. II6 first shipped with Windows 2003 (v5.2). 87 | IF (@OSVersion < 5.20) 88 | SET @ASPUserName = CONVERT(nvarchar(64), SERVERPROPERTY('machinename')) + N'\ASPNET'; 89 | ELSE 90 | SET @ASPUserName = @NetworkService; 91 | 92 | -- Add a login for the local ASPNET account 93 | -- In the following statements, replace LocalMachine with your 94 | -- local machine name on Winows 2000 and Windows XP 95 | -- replace LocalMachine\ASPNET with NT AUTHORITY\NETWORK SERVICE 96 | -- on Windows 2003 (except when in IIS 5 compatibility mode) 97 | exec ('sp_grantlogin [' + @ASPUserName + ']'); 98 | 99 | -- Add a database login for the UserAccounts database for the ASPNET account 100 | exec ('sp_grantdbaccess [' + @ASPUserName + ']'); 101 | 102 | -- Grant execute permissions to the LookupUser and RegisterUser stored procs 103 | exec ('grant execute on LookupUser to [' + @ASPUserName + ']'); 104 | exec ('grant execute on RegisterUser to [' + @ASPUserName + ']'); 105 | 106 | 107 | -- Virtual Service Account for PBI RS 108 | CREATE USER [NT SERVICE\PowerBIReportServer] FOR LOGIN [NT SERVICE\PowerBIReportServer] 109 | 110 | -- Grant execute permissions to the LookupUser and RegisterUser stored procs 111 | exec ('grant execute on LookupUser to [NT SERVICE\PowerBIReportServer]'); 112 | exec ('grant execute on RegisterUser to [NT SERVICE\PowerBIReportServer]'); 113 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /CustomSecuritySample/Setup/RestoreDatabase.sql: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. 3 | Licensed under the MIT License (MIT) 4 | 5 | This source code is intended only as a supplement to Microsoft 6 | Development Tools and/or on-line documentation. See these other 7 | materials for detailed information regarding Microsoft code samples. 8 | 9 | THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 10 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 11 | IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 12 | PARTICULAR PURPOSE. 13 | *****************************************************************************/ 14 | 15 | -- Restore changes to master database 16 | USE master 17 | GO 18 | -- create a database for the security information 19 | IF EXISTS (SELECT * FROM master..sysdatabases WHERE name = 20 | 'UserAccounts') 21 | DROP DATABASE UserAccounts 22 | GO -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/ActiveState.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.ActiveState, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/CacheRefreshPlan.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.CacheRefreshPlan, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/CacheRefreshPlanState.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.CacheRefreshPlanState, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/CatalogItem.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.CatalogItem, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/DataRetrievalPlan.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.DataRetrievalPlan, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/DataSetDefinition.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.DataSetDefinition, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/DataSource.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.DataSource, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/DataSourceDefinition.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.DataSourceDefinition, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/DataSourcePrompt.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.DataSourcePrompt, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/Event.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.Event, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/ExpirationDefinition.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.ExpirationDefinition, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/Extension.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.Extension, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/ExtensionParameter.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.ExtensionParameter, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/ExtensionSettings.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.ExtensionSettings, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/ItemHistorySnapshot.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.ItemHistorySnapshot, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/ItemParameter.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.ItemParameter, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/ItemReferenceData.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.ItemReferenceData, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/Job.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.Job, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/ModelCatalogItem.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.ModelCatalogItem, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/ModelDrillthroughReport.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.ModelDrillthroughReport, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/ModelItem.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.ModelItem, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/ParameterValue.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.ParameterValue, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/ParameterValueOrFieldReference.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.ParameterValueOrFieldReference, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/Policy.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.Policy, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/Property.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.Property, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/Reference.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/Role.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.Role, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/Schedule.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.Schedule, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/ScheduleDefinitionOrReference.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.ScheduleDefinitionOrReference, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/Subscription.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.Subscription, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/Task.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.Task, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/Web References/localhost/Warning.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.Warning, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 12 | http://localhost:80/ReportServer/ReportService2010.asmx 13 | 14 | 15 | Server=localhost; Integrated Security=SSPI;database=UserAccounts 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/App_LocalResources/Logon.aspx.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.17929 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Microsoft.Samples.ReportingServices.CustomSecurity.App_LocalResources { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Logon_aspx { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Logon_aspx() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Samples.ReportingServices.CustomSecurity.App_LocalResources.Logon.aspx", typeof(Logon_aspx).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized string similar to Logon. 65 | /// 66 | internal static string BtnLogonResource1 { 67 | get { 68 | return ResourceManager.GetString("BtnLogonResource1", resourceCulture); 69 | } 70 | } 71 | 72 | /// 73 | /// Looks up a localized string similar to Register User. 74 | /// 75 | internal static string BtnRegisterResource1 { 76 | get { 77 | return ResourceManager.GetString("BtnRegisterResource1", resourceCulture); 78 | } 79 | } 80 | 81 | /// 82 | /// Looks up a localized string similar to Invalid username or password. 83 | /// 84 | internal static string InvalidUsernamePassword { 85 | get { 86 | return ResourceManager.GetString("InvalidUsernamePassword", resourceCulture); 87 | } 88 | } 89 | 90 | /// 91 | /// Looks up a localized string similar to SQL Server Reporting Services Sample. 92 | /// 93 | internal static string Label1Resource1 { 94 | get { 95 | return ResourceManager.GetString("Label1Resource1", resourceCulture); 96 | } 97 | } 98 | 99 | /// 100 | /// Looks up a localized string similar to Password. 101 | /// 102 | internal static string LblPwdResource1 { 103 | get { 104 | return ResourceManager.GetString("LblPwdResource1", resourceCulture); 105 | } 106 | } 107 | 108 | /// 109 | /// Looks up a localized string similar to UserName:. 110 | /// 111 | internal static string LblUserResource1 { 112 | get { 113 | return ResourceManager.GetString("LblUserResource1", resourceCulture); 114 | } 115 | } 116 | 117 | /// 118 | /// Looks up a localized string similar to Logon successful: User is authenticated.. 119 | /// 120 | internal static string LoginSuccess { 121 | get { 122 | return ResourceManager.GetString("LoginSuccess", resourceCulture); 123 | } 124 | } 125 | 126 | /// 127 | /// Looks up a localized string similar to The user name that was entered contains characters not supported by report server custom authentication.. 128 | /// 129 | internal static string UserNameError { 130 | get { 131 | return ResourceManager.GetString("UserNameError", resourceCulture); 132 | } 133 | } 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/App_LocalResources/Logon.aspx.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | Logon 119 | 120 | 121 | Register User 122 | 123 | 124 | Invalid username or password 125 | 126 | 127 | SQL Server Reporting Services Sample 128 | 129 | 130 | Password 131 | 132 | 133 | UserName: 134 | 135 | 136 | Logon successful: User is authenticated. 137 | 138 | 139 | The user name that was entered contains characters not supported by report server custom authentication. 140 | 141 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/CustomSecurity.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.17929 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Microsoft.Samples.ReportingServices.CustomSecurity { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class CustomSecurity { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal CustomSecurity() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Samples.ReportingServices.CustomSecurity.CustomSecurity", typeof(CustomSecurity).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized string similar to An error occurred while attempting to add the account. . 65 | /// 66 | internal static string AddAccountError { 67 | get { 68 | return ResourceManager.GetString("AddAccountError", resourceCulture); 69 | } 70 | } 71 | 72 | /// 73 | /// Looks up a localized string similar to Root element is not \"AdminConfiguration\" in config data.. 74 | /// 75 | internal static string AdminConfiguration { 76 | get { 77 | return ResourceManager.GetString("AdminConfiguration", resourceCulture); 78 | } 79 | } 80 | 81 | /// 82 | /// Looks up a localized string similar to No Url reservation found for the \"ReportServerWebService\" application.. 83 | /// 84 | internal static string MissingUrlReservation { 85 | get { 86 | return ResourceManager.GetString("MissingUrlReservation", resourceCulture); 87 | } 88 | } 89 | 90 | /// 91 | /// Looks up a localized string similar to Number of operation names don't match.. 92 | /// 93 | internal static string OperationNameError { 94 | get { 95 | return ResourceManager.GetString("OperationNameError", resourceCulture); 96 | } 97 | } 98 | 99 | /// 100 | /// Looks up a localized string similar to An error occurred while attempting to get the ReportServer Url. . 101 | /// 102 | internal static string RSUrlError { 103 | get { 104 | return ResourceManager.GetString("RSUrlError", resourceCulture); 105 | } 106 | } 107 | 108 | /// 109 | /// Looks up a localized string similar to Unrecognized configuration element.. 110 | /// 111 | internal static string UnrecognizedElement { 112 | get { 113 | return ResourceManager.GetString("UnrecognizedElement", resourceCulture); 114 | } 115 | } 116 | 117 | /// 118 | /// Looks up a localized string similar to user registered. 119 | /// 120 | internal static string UserRegistered { 121 | get { 122 | return ResourceManager.GetString("UserRegistered", resourceCulture); 123 | } 124 | } 125 | 126 | /// 127 | /// Looks up a localized string similar to Exception verifying user. . 128 | /// 129 | internal static string VerifyError { 130 | get { 131 | return ResourceManager.GetString("VerifyError", resourceCulture); 132 | } 133 | } 134 | 135 | /// 136 | /// Looks up a localized string similar to An error occurred while attempting to verify the user.. 137 | /// 138 | internal static string VerifyUserException { 139 | get { 140 | return ResourceManager.GetString("VerifyUserException", resourceCulture); 141 | } 142 | } 143 | 144 | /// 145 | /// Looks up a localized string similar to No WMI class found.. 146 | /// 147 | internal static string WMIClassError { 148 | get { 149 | return ResourceManager.GetString("WMIClassError", resourceCulture); 150 | } 151 | } 152 | } 153 | } 154 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/CustomSecurity.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | An error occurred while attempting to add the account. 122 | 123 | 124 | Root element is not \"AdminConfiguration\" in config data. 125 | 126 | 127 | No Url reservation found for the \"ReportServerWebService\" application. 128 | 129 | 130 | Number of operation names don't match. 131 | 132 | 133 | An error occurred while attempting to get the ReportServer Url. 134 | 135 | 136 | Unrecognized configuration element. 137 | 138 | 139 | user registered 140 | 141 | 142 | Exception verifying user. 143 | 144 | 145 | An error occurred while attempting to verify the user. 146 | 147 | 148 | No WMI class found. 149 | 150 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/CustomSecuritySample.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomSecuritySample", "CustomSecurity.csproj", "{FE32AA5A-8EAA-43B9-87EE-73271F89BA52}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {FE32AA5A-8EAA-43B9-87EE-73271F89BA52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {FE32AA5A-8EAA-43B9-87EE-73271F89BA52}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {FE32AA5A-8EAA-43B9-87EE-73271F89BA52}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {FE32AA5A-8EAA-43B9-87EE-73271F89BA52}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/CustomSecuritySample.v12.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reporting-Services/acc2ee0d1884765e4b5213149430fb063d166719/CustomSecuritySample2016/CustomSecuritySample.v12.suo -------------------------------------------------------------------------------- /CustomSecuritySample2016/Logon.aspx: -------------------------------------------------------------------------------- 1 | <%@ Page language="c#" Codebehind="Logon.aspx.cs" AutoEventWireup="false" Inherits="Microsoft.Samples.ReportingServices.CustomSecurity.Logon, Microsoft.Samples.ReportingServices.CustomSecurity" Culture="auto" meta:resourcekey="PageResource1" UICulture="auto" %> 2 | 3 | 4 | 5 | Sql Server 2016 Reporting Services Samples 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | User Name: 15 | 17 | 19 | Password:  21 | 23 | 25 | 27 | 29 |
30 | 31 | 32 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Logon.aspx.cs: -------------------------------------------------------------------------------- 1 | #region 2 | // Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. 3 | // Licensed under the MIT License (MIT) 4 | /*============================================================================ 5 | File: Logon.aspx.cs 6 | Summary: The code-behind for a logon page that supports Forms 7 | Authentication in a custom security extension 8 | -------------------------------------------------------------------- 9 | This file is part of Microsoft SQL Server Code Samples. 10 | 11 | This source code is intended only as a supplement to Microsoft 12 | Development Tools and/or on-line documentation. See these other 13 | materials for detailed information regarding Microsoft code 14 | samples. 15 | 16 | THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF 17 | ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 18 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 19 | PARTICULAR PURPOSE. 20 | ===========================================================================*/ 21 | #endregion 22 | 23 | using System; 24 | using System.Collections; 25 | using System.ComponentModel; 26 | using System.Data; 27 | using System.Drawing; 28 | using System.Web; 29 | using System.Web.SessionState; 30 | using System.Web.UI; 31 | using System.Web.UI.WebControls; 32 | using System.Web.UI.HtmlControls; 33 | using System.Data.SqlClient; 34 | using System.Security.Cryptography; 35 | using System.Web.Security; 36 | using Microsoft.ReportingServices.Interfaces; 37 | using Microsoft.Samples.ReportingServices.CustomSecurity.App_LocalResources; 38 | using System.Globalization; 39 | 40 | namespace Microsoft.Samples.ReportingServices.CustomSecurity 41 | { 42 | public class Logon : System.Web.UI.Page 43 | { 44 | protected System.Web.UI.WebControls.Label LblUser; 45 | protected System.Web.UI.WebControls.TextBox TxtPwd; 46 | protected System.Web.UI.WebControls.TextBox TxtUser; 47 | protected System.Web.UI.WebControls.Button BtnRegister; 48 | protected System.Web.UI.WebControls.Button BtnLogon; 49 | protected System.Web.UI.WebControls.Label lblMessage; 50 | protected System.Web.UI.WebControls.Label Label1; 51 | protected System.Web.UI.WebControls.Label LblPwd; 52 | 53 | private void Page_Load(object sender, System.EventArgs e) 54 | { 55 | 56 | } 57 | 58 | #region Web Form Designer generated code 59 | override protected void OnInit(EventArgs e) 60 | { 61 | InitializeComponent(); 62 | base.OnInit(e); 63 | } 64 | 65 | private void InitializeComponent() 66 | { 67 | this.BtnLogon.Click += new System.EventHandler(this.ServerBtnLogon_Click); 68 | this.BtnRegister.Click += new System.EventHandler(this.BtnRegister_Click); 69 | this.Load += new System.EventHandler(this.Page_Load); 70 | 71 | } 72 | #endregion 73 | 74 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] 75 | private void BtnRegister_Click(object sender, 76 | System.EventArgs e) 77 | { 78 | string salt = AuthenticationUtilities.CreateSalt(5); 79 | string passwordHash = 80 | AuthenticationUtilities.CreatePasswordHash(TxtPwd.Text, salt); 81 | if (AuthenticationUtilities.ValidateUserName(TxtUser.Text)) 82 | { 83 | try 84 | { 85 | AuthenticationUtilities.StoreAccountDetails( 86 | TxtUser.Text, passwordHash, salt); 87 | } 88 | catch(Exception ex) 89 | { 90 | lblMessage.Text = string.Format(CultureInfo.InvariantCulture, ex.Message); 91 | } 92 | } 93 | else 94 | { 95 | 96 | lblMessage.Text = string.Format(CultureInfo.InvariantCulture, 97 | Logon_aspx.UserNameError); 98 | } 99 | } 100 | 101 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] 102 | private void ServerBtnLogon_Click(object sender, 103 | System.EventArgs e) 104 | { 105 | bool passwordVerified = false; 106 | try 107 | { 108 | passwordVerified = 109 | AuthenticationUtilities.VerifyPassword(TxtUser.Text,TxtPwd.Text); 110 | if (passwordVerified) 111 | { 112 | FormsAuthentication.RedirectFromLoginPage( 113 | TxtUser.Text, false); 114 | } 115 | else 116 | { 117 | Response.Redirect("logon.aspx"); 118 | } 119 | } 120 | catch(Exception ex) 121 | { 122 | lblMessage.Text = string.Format(CultureInfo.InvariantCulture, ex.Message); 123 | return; 124 | } 125 | if (passwordVerified == true ) 126 | { 127 | // The user is authenticated 128 | // At this point, an authentication ticket is normally created 129 | // This can subsequently be used to generate a GenericPrincipal 130 | // object for .NET authorization purposes 131 | // For details, see "How To: Use Forms authentication with 132 | // GenericPrincipal objects 133 | lblMessage.Text = string.Format(CultureInfo.InvariantCulture, 134 | Logon_aspx.LoginSuccess); 135 | BtnRegister.Enabled = false; 136 | } 137 | else 138 | { 139 | lblMessage.Text = string.Format(CultureInfo.InvariantCulture, 140 | Logon_aspx.InvalidUsernamePassword); 141 | } 142 | } 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Microsoft.Samples.ReportingServices.CustomSecurity.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.ApplicationScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)] 29 | [global::System.Configuration.DefaultSettingValueAttribute("http://localhost:80/ReportServer_SQL2016/ReportService2010.asmx")] 30 | public string Microsoft_Samples_ReportingServices_CustomSecurity_localhost_ReportingService2010 { 31 | get { 32 | return ((string)(this["Microsoft_Samples_ReportingServices_CustomSecurity_localhost_ReportingService2010" + 33 | ""])); 34 | } 35 | } 36 | 37 | [global::System.Configuration.ApplicationScopedSettingAttribute()] 38 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 39 | [global::System.Configuration.DefaultSettingValueAttribute("Server=localhost; Integrated Security=SSPI;database=UserAccounts")] 40 | public string Database_ConnectionString { 41 | get { 42 | return ((string)(this["Database_ConnectionString"])); 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | http://localhost:80/ReportServer_SQL2016/ReportService2010.asmx 7 | 8 | 9 | Server=localhost; Integrated Security=SSPI;database=UserAccounts 10 | 11 | 12 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Setup/CreateUserStore.sql: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. 3 | Licensed under the MIT License (MIT) 4 | 5 | This source code is intended only as a supplement to Microsoft 6 | Development Tools and/or on-line documentation. See these other 7 | materials for detailed information regarding Microsoft code samples. 8 | 9 | THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 10 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 11 | IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 12 | PARTICULAR PURPOSE. 13 | *****************************************************************************/ 14 | 15 | USE master 16 | GO 17 | -- create a database for the security information 18 | IF EXISTS (SELECT * FROM master..sysdatabases WHERE name = 19 | 'UserAccounts') 20 | DROP DATABASE UserAccounts 21 | GO 22 | CREATE DATABASE UserAccounts 23 | GO 24 | USE UserAccounts 25 | GO 26 | CREATE TABLE [Users] ( 27 | [UserName] [varchar] (255) NOT NULL , 28 | [PasswordHash] [varchar] (50) NOT NULL , 29 | [salt] [varchar] (10) NOT NULL, 30 | CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED 31 | ( 32 | [UserName] 33 | ) ON [PRIMARY] 34 | ) ON [PRIMARY] 35 | GO 36 | -- create a stored procedure to register user details 37 | CREATE PROCEDURE RegisterUser 38 | @userName varchar(255), 39 | @passwordHash varchar(50), 40 | @salt varchar(10) 41 | AS 42 | INSERT INTO Users VALUES(@userName, @passwordHash, @salt) 43 | GO 44 | -- create a stored procedure to retrieve user details 45 | CREATE PROCEDURE LookupUser 46 | @userName varchar(255) 47 | AS 48 | SELECT PasswordHash, salt 49 | FROM Users 50 | WHERE UserName = @userName 51 | GO 52 | 53 | 54 | -- 55 | -- Start security grants 56 | -- 57 | 58 | -- Capture the OS version in a temp table so that we can pick 59 | -- the correct windows account to grant access to for the objects 60 | -- defined in this file. This enables ASP.NET programs to access 61 | -- these objects. 62 | CREATE TABLE #GetVersionValues 63 | ( 64 | [Index] int, 65 | [Name] sysname, 66 | Internal_value int, 67 | Character_Value sysname 68 | ); 69 | GO 70 | 71 | INSERT #GetVersionValues 72 | EXEC master.dbo.xp_msver 'WindowsVersion'; 73 | GO 74 | 75 | DECLARE @OSVersion decimal(9, 2); 76 | DECLARE @ASPUserName nvarchar(100); 77 | DECLARE @NetworkService nvarchar(100); 78 | 79 | -- For globalization purposes, the sample install script uses a SID to set NT AUTHORITY\NETWORK SERVICE 80 | -- SELECT SUSER_SID('NT AUTHORITY\NETWORK SERVICE') returns the English SID. 81 | SET @NetworkService = SUSER_SNAME(0x010100000000000514000000); 82 | 83 | SELECT @OSVersion = CONVERT(decimal(9, 2), SUBSTRING(Character_Value, 1, CHARINDEX(' ', Character_Value) - 1)) 84 | FROM #GetVersionValues; 85 | 86 | -- IIS6 uses a different account to run web apps under. II6 first shipped with Windows 2003 (v5.2). 87 | IF (@OSVersion < 5.20) 88 | SET @ASPUserName = CONVERT(nvarchar(64), SERVERPROPERTY('machinename')) + N'\ASPNET'; 89 | ELSE 90 | SET @ASPUserName = @NetworkService; 91 | 92 | -- Add a login for the local ASPNET account 93 | -- In the following statements, replace LocalMachine with your 94 | -- local machine name on Winows 2000 and Windows XP 95 | -- replace LocalMachine\ASPNET with NT AUTHORITY\NETWORK SERVICE 96 | -- on Windows 2003 (except when in IIS 5 compatibility mode) 97 | exec ('sp_grantlogin [' + @ASPUserName + ']'); 98 | 99 | -- Add a database login for the UserAccounts database for the ASPNET account 100 | exec ('sp_grantdbaccess [' + @ASPUserName + ']'); 101 | 102 | -- Grant execute permissions to the LookupUser and RegisterUser stored procs 103 | exec ('grant execute on LookupUser to [' + @ASPUserName + ']'); 104 | 105 | exec ('grant execute on RegisterUser to [' + @ASPUserName + ']'); 106 | 107 | 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Setup/RestoreDatabase.sql: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. 3 | Licensed under the MIT License (MIT) 4 | 5 | This source code is intended only as a supplement to Microsoft 6 | Development Tools and/or on-line documentation. See these other 7 | materials for detailed information regarding Microsoft code samples. 8 | 9 | THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 10 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 11 | IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 12 | PARTICULAR PURPOSE. 13 | *****************************************************************************/ 14 | 15 | -- Restore changes to master database 16 | USE master 17 | GO 18 | -- create a database for the security information 19 | IF EXISTS (SELECT * FROM master..sysdatabases WHERE name = 20 | 'UserAccounts') 21 | DROP DATABASE UserAccounts 22 | GO -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/ActiveState.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.ActiveState, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/CacheRefreshPlan.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.CacheRefreshPlan, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/CacheRefreshPlanState.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.CacheRefreshPlanState, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/CatalogItem.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.CatalogItem, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/DataRetrievalPlan.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.DataRetrievalPlan, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/DataSetDefinition.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.DataSetDefinition, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/DataSource.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.DataSource, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/DataSourceDefinition.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.DataSourceDefinition, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/DataSourcePrompt.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.DataSourcePrompt, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/Event.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.Event, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/ExpirationDefinition.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.ExpirationDefinition, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/Extension.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.Extension, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/ExtensionParameter.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.ExtensionParameter, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/ExtensionSettings.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.ExtensionSettings, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/ItemHistorySnapshot.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.ItemHistorySnapshot, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/ItemParameter.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.ItemParameter, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/ItemReferenceData.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.ItemReferenceData, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/Job.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.Job, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/ModelCatalogItem.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.ModelCatalogItem, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/ModelDrillthroughReport.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.ModelDrillthroughReport, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/ModelItem.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.ModelItem, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/ParameterValue.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.ParameterValue, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/ParameterValueOrFieldReference.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.ParameterValueOrFieldReference, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/Policy.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.Policy, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/Property.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.Property, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/Reference.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/Role.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.Role, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/Schedule.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.Schedule, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/ScheduleDefinitionOrReference.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.ScheduleDefinitionOrReference, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/Subscription.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.Subscription, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/Task.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.Task, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/Web References/localhost/Warning.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | Microsoft.Samples.ReportingServices.CustomSecurity.localhost.Warning, Web References.localhost.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 12 | http://localhost:80/ReportServer_SQL2016/ReportService2010.asmx 13 | 14 | 15 | Server=localhost; Integrated Security=SSPI;database=UserAccounts 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/obj/Debug/CustomSecurity.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | D:\GIT\Reporting-Services\CustomSecuritySample2016\obj\Debug\CustomSecurity.csprojResolveAssemblyReference.cache 2 | D:\GIT\Reporting-Services\CustomSecuritySample2016\obj\Debug\Microsoft.Samples.ReportingServices.CustomSecurity.App_LocalResources.Logon.aspx.resources 3 | D:\GIT\Reporting-Services\CustomSecuritySample2016\obj\Debug\Microsoft.Samples.ReportingServices.CustomSecurity.CustomSecurity.resources 4 | D:\GIT\Reporting-Services\CustomSecuritySample2016\obj\Debug\CustomSecurity.csproj.GenerateResource.Cache 5 | -------------------------------------------------------------------------------- /CustomSecuritySample2016/obj/Debug/CustomSecurity.csproj.GenerateResource.Cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reporting-Services/acc2ee0d1884765e4b5213149430fb063d166719/CustomSecuritySample2016/obj/Debug/CustomSecurity.csproj.GenerateResource.Cache -------------------------------------------------------------------------------- /CustomSecuritySample2016/obj/Debug/CustomSecurity.csprojResolveAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reporting-Services/acc2ee0d1884765e4b5213149430fb063d166719/CustomSecuritySample2016/obj/Debug/CustomSecurity.csprojResolveAssemblyReference.cache -------------------------------------------------------------------------------- /CustomSecuritySample2016/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reporting-Services/acc2ee0d1884765e4b5213149430fb063d166719/CustomSecuritySample2016/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /CustomSecuritySample2016/obj/Debug/Microsoft.Samples.ReportingServices.CustomSecurity.App_LocalResources.Logon.aspx.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reporting-Services/acc2ee0d1884765e4b5213149430fb063d166719/CustomSecuritySample2016/obj/Debug/Microsoft.Samples.ReportingServices.CustomSecurity.App_LocalResources.Logon.aspx.resources -------------------------------------------------------------------------------- /CustomSecuritySample2016/obj/Debug/Microsoft.Samples.ReportingServices.CustomSecurity.CustomSecurity.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reporting-Services/acc2ee0d1884765e4b5213149430fb063d166719/CustomSecuritySample2016/obj/Debug/Microsoft.Samples.ReportingServices.CustomSecurity.CustomSecurity.resources -------------------------------------------------------------------------------- /Docs/Get-Started-With-RVC.md: -------------------------------------------------------------------------------- 1 | # Next steps - READ! 2 | 3 | * **Make sure you have the latest version of [SQL Server Data Tools installed](https://msdn.microsoft.com/en-us/mt186501).** Earlier versions incorrectly GAC'ed certain libraries that will cause issues - see the common issues section below. 4 | * The Report Viewer Control is designed to be included in projects via nuget. It's not a good idea to add the libraries to the GAC. 5 | * If deploying the control on an intranet site make sure that the page is targeting HTML5. 6 | 7 | ## Known issues 8 | 9 | * Icons don't show when using the control in Master/child pages 10 | * Design time experience doesn't always show in Visual Studio 11 | * Exception thrown when no Report Server and Report Path properties set 12 | 13 | ## Adding the Report Viewer Control to a new project 14 | 15 | 1. Create a new ASP.Net empty web site, or open an existing ASP.Net project 16 | ![New web project](Get-Started-With-RVC/NewAspWebSite.png) 17 | 18 | 2. Install the Report Viewer Control Nuget package via the Nuget package manager console 19 | ``` 20 | Install-Package Microsoft.ReportingServices.ReportViewerControl.WebForms.Preview 21 | ``` 22 | 3. Add a new .aspx page to the project and register the Report Viewer Control assembly for use within the page 23 | ``` 24 | <%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=13.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %> 25 | ``` 26 | 4. Add a ScriptManagerControl to the page 27 | 5. Add the Report Viewer control to the page. The below snippet can be updated to reference a report hosted on a remote Report Server 28 | ``` 29 | 30 | 31 | 32 | ``` 33 | 34 | The final page should look like 35 | ``` 36 | <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="Sample" %> 37 | 38 | <%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=13.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %> 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 |
49 | 50 | 51 | 52 | 53 |
54 | 55 | 56 | ``` 57 | 58 | ## Updating an existing project to use the Report Viewer Control 59 | 60 | To make use of the 2016 Report Viewer Control in an existing project add the control via Nuget, and update assembly references to version 13.0.0.0. This will include updating the project’s web.config and all .aspx pages that reference the Report Viewer Control. 61 | 62 | **Sample web.config changes** 63 | 64 | ``` 65 | 66 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 85 | 86 | 87 | 88 | 89 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 100 | 101 | 102 | 103 | ``` 104 | 105 | **Sample .aspx** 106 | 107 | ``` 108 | <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="SampleAspx" %> 109 | 110 | <%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=13.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %> 111 | 112 | 113 | ``` 114 | 115 | 116 | ## Common issues 117 | 118 | ### Old version of SQL Server Data Tools is installed 119 | 120 | If SQL Server Data Tools or SQL Server Management Studio for SQL 2016 is installed, make sure it's updated to the latest version. Earlier versions of SSDT incorrectly gac’ed certain dlls which conflict with the Report Viewer Control. You may need to manually delete the V13 dll's from \windows\assembly\gac_msil to permanently remove them. 121 | 122 | You may need to manually remove the libraries 123 | 124 | ``` 125 | gacutil /u "Microsoft.ReportViewer.WebForms, Version=13.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL" /f 126 | gacutil /u "Microsoft.ReportViewer.WinForms, Version=13.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL" /f 127 | gacutil /u "Microsoft.ReportViewer.WebDesign, Version=13.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL" /f 128 | gacutil /u "Microsoft.ReportViewer.Common, Version=13.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL" /f 129 | ``` 130 | 131 | 132 | ### Design time isn't currently supported 133 | 134 | Design time and Control on the canvas experience for Visual Studio 2015 and Visual Studio 2016 is not yet supported. You will most likely see the image below if you use the new Report Control Runtime. 135 | 136 | ![Error creating control](Get-Started-With-RVC/ErrorCreatingControl.png) 137 | 138 | ### Page is rendering in intranet compatability mode 139 | 140 | The 2016 Report Viewer Control is designed to be used with modern browsers, the control may not function if browsers render the web page in an IE compatibility mode. Intranet sites may require a '' tag to override setting which encourage rendering intranet pages in compatibility mode. 141 | -------------------------------------------------------------------------------- /Docs/Get-Started-With-RVC/ErrorCreatingControl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reporting-Services/acc2ee0d1884765e4b5213149430fb063d166719/Docs/Get-Started-With-RVC/ErrorCreatingControl.png -------------------------------------------------------------------------------- /Docs/Get-Started-With-RVC/NewAspWebSite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reporting-Services/acc2ee0d1884765e4b5213149430fb063d166719/Docs/Get-Started-With-RVC/NewAspWebSite.png -------------------------------------------------------------------------------- /Docs/SSRS.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reporting-Services/acc2ee0d1884765e4b5213149430fb063d166719/Docs/SSRS.PNG -------------------------------------------------------------------------------- /Docs_14_0/Get-Started-With-RVC.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Get-Started-With-RVC.md 5 | 6 | 7 | 8 |

Next steps - READ!

9 |
    10 |
  • If deploying the control on an intranet site make sure that the page is targeting HTML5.
  • 11 |
12 |

Adding the Report Viewer Control to a new project

13 |
    14 |
  1. Create a new ASP.Net empty web site, or open an existing ASP.Net project
    15 | New web project

    16 |
  2. 17 |
  3. Install the Report Viewer Control Nuget package via the Nuget package manager console

    18 |
    Install-Package Microsoft.ReportingServices.ReportViewerControl.WebForms
     19 | 
  4. 20 |
  5. Add a new .aspx page to the project and register the Report Viewer Control assembly for use within the page
    <%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>
     21 | 
  6. 22 |
  7. Add a ScriptManagerControl to the page
  8. 23 |
  9. Add the Report Viewer control to the page. The below snippet can be updated to reference a report hosted on a remote Report Server
    <rsweb:ReportViewer ID="ReportViewer1" runat="server" ProcessingMode="Remote">
     24 | <ServerReport ReportPath="" ReportServerUrl="" />
     25 | </rsweb:ReportViewer>
     26 | 
  10. 27 |
28 |

The final page should look like

29 |
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="Sample" %>
 30 | 
 31 | <%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>
 32 | 
 33 | <!DOCTYPE html>
 34 | 
 35 | <html xmlns="http://www.w3.org/1999/xhtml">
 36 | <head runat="server">
 37 |     <meta http-equiv="X-UA-Compatible" content="IE=edge" /> 
 38 |     <title></title>
 39 | </head>
 40 | <body>
 41 |     <form id="form1" runat="server">
 42 |     <asp:ScriptManager runat="server"></asp:ScriptManager>        
 43 |         <rsweb:ReportViewer ID="ReportViewer1" runat="server" ProcessingMode="Remote">
 44 |             <ServerReport ReportServerUrl="http://AContosoDepartment/ReportServer" ReportPath="/LatestSales" />
 45 |         </rsweb:ReportViewer>
 46 |     </form>
 47 | </body>
 48 | </html>
 49 | 

Updating an existing project to use the Report Viewer Control

50 |

To make use of the Report Viewer Control in an existing project add the control via Nuget, and update assembly references to version 14.0.0.0. This will include updating the project’s web.config and all .aspx pages that reference the Report Viewer Control.

51 |

Sample web.config changes

52 |
<?xml version="1.0"?>
 53 | <!--
 54 |   For more information on how to configure your ASP.NET application, please visit
 55 |   http://go.microsoft.com/fwlink/?LinkId=169433
 56 |   -->
 57 | <configuration>
 58 |   <system.web>
 59 |     <compilation debug="true" targetFramework="4.5.2">
 60 |       <assemblies>
 61 |         <add assembly="Microsoft.ReportViewer.Common, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
 62 |         <add assembly="Microsoft.ReportViewer.DataVisualization, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
 63 |         <add assembly="Microsoft.ReportViewer.Design, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
 64 |         <add assembly="Microsoft.ReportViewer.ProcessingObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
 65 |         <add assembly="Microsoft.ReportViewer.WebDesign, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
 66 |         <add assembly="Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
 67 |         <add assembly="Microsoft.ReportViewer.WinForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
 68 |       </assemblies>
 69 |       <buildProviders>
 70 |         <add extension=".rdlc"
 71 |           type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
 72 |       </buildProviders>
 73 |     </compilation>
 74 |     <httpRuntime targetFramework="4.5.2"/>
 75 |     <httpHandlers>
 76 |       <add path="Reserved.ReportViewerWebControl.axd" verb="*"
 77 |         type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"
 78 |         validate="false"/>
 79 |     </httpHandlers>
 80 |   </system.web>
 81 |   <system.webServer>
 82 |     <validation validateIntegratedModeConfiguration="false"/>
 83 |     <modules runAllManagedModulesForAllRequests="true"/>
 84 |     <handlers>
 85 |       <add name="ReportViewerWebControlHandler" verb="*" path="Reserved.ReportViewerWebControl.axd" preCondition="integratedMode"
 86 |         type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
 87 |     </handlers>
 88 |   </system.webServer>
 89 | </configuration>
 90 | 

Sample .aspx

91 |
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="SampleAspx" %>
 92 | 
 93 | <%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>
 94 | 
 95 | <!DOCTYPE html>
 96 | 

Common issues

97 |

Page is rendering in intranet compatability mode

98 |

The Report Viewer Control is designed to be used with modern browsers, the control may not function if browsers render the web page in an IE compatibility mode. Intranet sites may require a '<meta http-equiv="X-UA-Compatible" content="IE=edge" />' tag to override setting which encourage rendering intranet pages in compatibility mode.

99 | 100 |

How to set 100% height on the new Report Viewer control

101 |

For detailed instructions click here

102 | 103 |

Unable to load DLL 'SqlServerSpatial140.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

104 |

For detailed instructions, click here.

105 | 106 | 107 | -------------------------------------------------------------------------------- /Docs_14_0/Get-Started-With-RVC.md: -------------------------------------------------------------------------------- 1 | # Next steps - READ! 2 | 3 | * If deploying the control on an intranet site make sure that the page is targeting HTML5. 4 | 5 | 6 | ## Adding the Report Viewer Control to a new project 7 | 8 | 1. Create a new ASP.Net empty web site, or open an existing ASP.Net project 9 | ![New web project](Get-Started-With-RVC/NewAspWebSite.png) 10 | 11 | 2. Install the Report Viewer Control Nuget package via the Nuget package manager console 12 | ``` 13 | Install-Package Microsoft.ReportingServices.ReportViewerControl.WebForms 14 | ``` 15 | 3. Add a new .aspx page to the project and register the Report Viewer Control assembly for use within the page 16 | ``` 17 | <%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %> 18 | ``` 19 | 4. Add a ScriptManagerControl to the page 20 | 5. Add the Report Viewer control to the page. The below snippet can be updated to reference a report hosted on a remote Report Server 21 | ``` 22 | 23 | 24 | 25 | ``` 26 | 27 | The final page should look like 28 | ``` 29 | <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="Sample" %> 30 | 31 | <%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %> 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 |
42 | 43 | 44 | 45 | 46 |
47 | 48 | 49 | ``` 50 | 51 | ## Updating an existing project to use the Report Viewer Control 52 | 53 | To make use of the Report Viewer Control in an existing project add the control via Nuget, and update assembly references to version 14.0.0.0. This will include updating the project’s web.config and all .aspx pages that reference the Report Viewer Control. 54 | 55 | **Sample web.config changes** 56 | 57 | ``` 58 | 59 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 78 | 79 | 80 | 81 | 82 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 93 | 94 | 95 | 96 | ``` 97 | 98 | **Sample .aspx** 99 | 100 | ``` 101 | <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="SampleAspx" %> 102 | 103 | <%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %> 104 | 105 | 106 | ``` 107 | 108 | 109 | ## Common issues 110 | 111 | ### Page is rendering in intranet compatability mode 112 | 113 | The Report Viewer Control is designed to be used with modern browsers, the control may not function if browsers render the web page in an IE compatibility mode. Intranet sites may require a '' tag to override setting which encourage rendering intranet pages in compatibility mode. 114 | 115 | ### How to set 100% height on the new Report Viewer control 116 | For detailed instructions [click here](http://htmlpreview.github.io/?https://github.com/Microsoft/Reporting-Services/blob/master/Docs_14_0/Set-100Percent-Height-With-RVC.html) 117 | 118 | ### Unable to load DLL 'SqlServerSpatial140.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E) 119 | For detailed instructions, [click here](http://htmlpreview.github.io/?https://github.com/Microsoft/Reporting-Services/blob/master/Docs_14_0/Set-Reference-To-Sql-Server-Spatial.html). 120 | -------------------------------------------------------------------------------- /Docs_14_0/Get-Started-With-RVC/NewAspWebSite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reporting-Services/acc2ee0d1884765e4b5213149430fb063d166719/Docs_14_0/Get-Started-With-RVC/NewAspWebSite.png -------------------------------------------------------------------------------- /Docs_14_0/Set-100Percent-Height-With-RVC.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Set-100Percent-Height-With-RVC.md 5 | 6 | 7 | 8 |

How to set 100% height on the new Report Viewer 2016 control

9 |

The new Report Viewer 2016 control is optimized for HTML5 Standards mode pages and works on all modern browsers. In the past with the old RVC control when you set the 100% height property it worked even if none of the ancestors had height specified. This behavior has changed in HTML5. When you set this property on the new RVC control, it will work correctly only if the parent element has a defined height, i.e. not a value of auto, or all the ancestors of RVC have 100% height too.

10 |

Below are the two examples to do this

11 |

By setting the height of all the parent elements to 100%

12 |
<!DOCTYPE html>
13 | <html xmlns="http://www.w3.org/1999/xhtml">    
14 | <head runat="server">
15 |     <style>
16 |     html,body,form,#div1 {
17 |     height: 100%; 
18 |         }
19 |     </style>
20 |     </head>
21 | <body >
22 |     <form id="form1" runat="server">
23 |     <div id="div1" >
24 |     <asp:ScriptManager runat="server"></asp:ScriptManager>        
25 |     <rsweb:ReportViewer ID="ReportViewer1" runat="server" ProcessingMode="Remote" Height="100%" Width="100%">
26 |     <ServerReport ReportServerUrl="http://test/ReportServer" ReportPath="/testreport" />
27 |     </rsweb:ReportViewer>
28 |     </div>
29 |     </form>
30 | </body>
31 | </html>
32 | 
33 |

By setting the style height attribute on the parent of the reportviewer control

34 |
<!DOCTYPE html>
35 | <html xmlns="http://www.w3.org/1999/xhtml">    
36 | <head runat="server">
37 | </head>
38 | <body >
39 |     <form id="form1" runat="server">
40 |     <div style="height:100vh;">
41 |     <asp:ScriptManager runat="server"></asp:ScriptManager>        
42 |     <rsweb:ReportViewer ID="ReportViewer1" runat="server" ProcessingMode="Remote" Height="100%" Width="100%">
43 |     <ServerReport ReportServerUrl="http://test/ReportServer" ReportPath="/testreport" />
44 |     </rsweb:ReportViewer>
45 |     </div>
46 |     </form>
47 | </body>
48 | </html>
49 | 
50 | 51 | 52 | -------------------------------------------------------------------------------- /Docs_14_0/Set-100Percent-Height-With-RVC.md: -------------------------------------------------------------------------------- 1 | # How to set 100% height on the new Report Viewer 2016 control 2 | The new Report Viewer 2016 control is optimized for HTML5 Standards mode pages and works on all modern browsers. In the past with the old RVC control when you set the 100% height property it worked even if none of the ancestors had height specified. This behavior has changed in HTML5. When you set this property on the new RVC control, it will work correctly only if the parent element has a defined height, i.e. not a value of auto, or all the ancestors of RVC have 100% height too. 3 | 4 | Below are the two examples to do this 5 | 6 | ### By setting the height of all the parent elements to 100% 7 | 8 | ```html 9 | 10 | 11 | 12 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | 25 |
26 |
27 | 28 | 29 | ``` 30 | 31 | ### By setting the style height attribute on the parent of the reportviewer control 32 | 33 | ```html 34 | 35 | 36 | 37 | 38 | 39 |
40 |
41 | 42 | 43 | 44 | 45 |
46 |
47 | 48 | 49 | ``` 50 | -------------------------------------------------------------------------------- /Docs_14_0/Set-Reference-To-Sql-Server-Spatial.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Set-Reference-To-Sql-Server-Spatial.md 5 | 6 | 7 | 8 |

9 | Unable to load DLL 'SqlServerSpatial140.dll'?

10 | 11 |

Whenever your Report contains a control that requires SQL Server Types, your project will need to load this assembly at runtime.

12 | 13 |

14 | How to load SqlServerSpatial140.dll?

15 | 16 |

When you installed the Report Viewer Control nuget package, you would have noticed a new folder called SqlServerTypes was added to your project. In this folder, you will find 2 sub-folders (x86 and x64), which each contain the SqlServerSpatial140.dll. Since it is difficult for us to predict which type of architecture your application will be running in, we added both versions to your project. The instructions for loading this assembly depends on what type of application (ASP.NET Website vs ASP.NET Web Application) you are running.

17 | 18 |

19 | ASP.NET Web Sites

20 | 21 |

For ASP.NET Web Sites, add the following block of code to the code behind file of the Web Form where you have added Report Viewer Control:

22 | 23 |
    Default.aspx.cs:
24 | 
25 |     public partial class _Default : System.Web.UI.Page
26 |     {
27 |         static bool _isSqlTypesLoaded = false;
28 | 
29 |         public _Default()
30 |         {
31 |             if (!_isSqlTypesLoaded)
32 |             {
33 |                 SqlServerTypes.Utilities.LoadNativeAssemblies(Server.MapPath("~"));
34 |                 _isSqlTypesLoaded = true;
35 |             }
36 |         }
37 |     }
38 | 
39 | 40 |

41 | ASP.NET Web Applications

42 | 43 |

For ASP.NET Web Applications, add the following line of code to the Application_Start method in Global.asax.cs:

44 | 45 |
    SqlServerTypes.Utilities.LoadNativeAssemblies(Server.MapPath("~/bin"));
46 | 
47 | 48 | 49 | -------------------------------------------------------------------------------- /Docs_14_0/Set-Reference-To-Sql-Server-Spatial.md: -------------------------------------------------------------------------------- 1 | #Unable to load DLL 'SqlServerSpatial140.dll'? 2 | Whenever your Report contains a control that requires SQL Server Types, your project will need to load this assembly at runtime. 3 | 4 | #How to load SqlServerSpatial140.dll? 5 | When you installed the Report Viewer Control nuget package, you would have noticed a new folder called SqlServerTypes was added to your project. In this folder, you will find 2 sub-folders (x86 and x64), which each contain the SqlServerSpatial140.dll. Since it is difficult for us to predict which type of architecture your application will be running in, we added both versions to your project. The instructions for loading this assembly depends on what type of application (ASP.NET Website vs ASP.NET Web Application) you are running. 6 | 7 | ##ASP.NET Web Sites 8 | For ASP.NET Web Sites, add the following block of code to the code behind file of the Web Form where you have added Report Viewer Control: 9 | ``` 10 | Default.aspx.cs: 11 | 12 | public partial class _Default : System.Web.UI.Page 13 | { 14 | static bool _isSqlTypesLoaded = false; 15 | 16 | public _Default() 17 | { 18 | if (!_isSqlTypesLoaded) 19 | { 20 | SqlServerTypes.Utilities.LoadNativeAssemblies(Server.MapPath("~")); 21 | _isSqlTypesLoaded = true; 22 | } 23 | } 24 | } 25 | ``` 26 | 27 | ##ASP.NET Web Applications 28 | For ASP.NET Web Applications, add the following line of code to the Application_Start method in Global.asax.cs: 29 | ``` 30 | SqlServerTypes.Utilities.LoadNativeAssemblies(Server.MapPath("~/bin")); 31 | ``` 32 | -------------------------------------------------------------------------------- /License.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Microsoft 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /PaginatedReportSamples/README.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | This project welcomes contributions and suggestions. Most contributions require you to agree to a 4 | Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us 5 | the rights to use your contribution. For details, visit https://cla.microsoft.com. 6 | 7 | When you submit a pull request, a CLA-bot will automatically determine whether you need to provide 8 | a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions 9 | provided by the bot. You will only need to do this once across all repos using our CLA. 10 | 11 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 12 | For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or 13 | contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. 14 | 15 | ## Paginated Report samples 16 | 17 | Within the *PaginatedReportSamples* folder, you will find different report samples that can help you explore Paginated Reports. These samples do not require any setup and can be easily rendered by opening it using the latest version of Power BI Report Builder. 18 | 19 | ## Learn more 20 | For more information see the [Paginated Report Samples](https://docs.microsoft.com/power-bi/paginated-reports/paginated-reports-samples/) or 21 | contact [paginatedreportsamples@microsoft.com](mailto:paginatedreportsamples@microsoft.com) 22 | with any additional questions or comments. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Reporting Services 2 | Git repo for SQL Server Reporting Services samples and community projects 3 | 4 | # Reporting Services PowerShell Tools 5 | In order to provide a better install experience the PowerShell scripts have been moved to https://github.com/Microsoft/ReportingServicesTools 6 | 7 | # Reporting Services Custom Security Sample 8 | This project will help you to get started with how to deploy a custom security extension to SQL Reporting Services. 9 | For more details please check out the read me document in this folder [CustomSecuritySample](https://github.com/Microsoft/Reporting-Services/tree/master/CustomSecuritySample). 10 | 11 | # Reporting Load Test 12 | Contains a Visual Studio Load Test 2015 solution to execute synthetic load for SQL Server Reporting Services 2016 13 | https://github.com/Microsoft/Reporting-Services-loadtest 14 | 15 | # Paginated Report Samples 16 | Contains several sample Power BI paginated reports to download and explore. They demonstrate typical ways you can use paginated reports. 17 | For more details please check out this article [Paginated Report Samples](https://docs.microsoft.com/power-bi/paginated-reports/paginated-reports-samples). 18 | This folder contains the following paginated report samples : 19 | - [CountrySalesPerformance](https://raw.githubusercontent.com/microsoft/Reporting-Services/master/PaginatedReportSamples/CountrySalesPerformance.rdl) 20 | - [Invoice](https://raw.githubusercontent.com/microsoft/Reporting-Services/master/PaginatedReportSamples/Invoice.rdl) 21 | - [Labels](https://raw.githubusercontent.com/microsoft/Reporting-Services/master/PaginatedReportSamples/Labels.rdl) 22 | - [Letter](https://raw.githubusercontent.com/microsoft/Reporting-Services/master/PaginatedReportSamples/Letter.rdl) 23 | - [Transcript](https://raw.githubusercontent.com/microsoft/Reporting-Services/master/PaginatedReportSamples/Transcript.rdl) 24 | - [OrganizationExpenditures](https://raw.githubusercontent.com/microsoft/Reporting-Services/master/PaginatedReportSamples/OrganizationExpenditures.rdl) 25 | - [RegionalSales](https://raw.githubusercontent.com/microsoft/Reporting-Services/master/PaginatedReportSamples/RegionalSales.rdl) 26 | 27 | 28 | # Code Of Conduct 29 | This project has adopted the [Microsoft Open Source Code of 30 | Conduct](https://opensource.microsoft.com/codeofconduct/). 31 | For more information see the [Code of Conduct 32 | FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or 33 | contact [opencode@microsoft.com](mailto:opencode@microsoft.com) 34 | with any additional questions or comments. 35 | 36 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Security 4 | 5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). 6 | 7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. 8 | 9 | ## Reporting Security Issues 10 | 11 | **Please do not report security vulnerabilities through public GitHub issues.** 12 | 13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). 14 | 15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). 16 | 17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). 18 | 19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: 20 | 21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) 22 | * Full paths of source file(s) related to the manifestation of the issue 23 | * The location of the affected source code (tag/branch/commit or direct URL) 24 | * Any special configuration required to reproduce the issue 25 | * Step-by-step instructions to reproduce the issue 26 | * Proof-of-concept or exploit code (if possible) 27 | * Impact of the issue, including how an attacker might exploit the issue 28 | 29 | This information will help us triage your report more quickly. 30 | 31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. 32 | 33 | ## Preferred Languages 34 | 35 | We prefer all communications to be in English. 36 | 37 | ## Policy 38 | 39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). 40 | 41 | 42 | --------------------------------------------------------------------------------