Tuesday, 13 November 2018

How to find user roles on different Catalog|Folder|Report in SSRS

How to find user roles on different Catalog|Folder|Report in SSRS The below query will give you, the user roles on different catalogs

USE ReportServer
GO
SELECT
    CASE
        WHEN [Catalog].[Type]=1 THEN 'Folder'
        WHEN [Catalog].[Type]=2 THEN 'Report'
        WHEN [Catalog].[Type]=3 THEN 'Resource'
        WHEN [Catalog].[Type]=4 THEN 'Linked Report'
        WHEN [Catalog].[Type]=5 THEN 'Data Source'
        WHEN [Catalog].[Type]=6 THEN 'Report Model'
        WHEN [Catalog].[Type]=8 THEN 'Shared Dataset'
        WHEN [Catalog].[Type]=9 THEN 'Report Part'     
    END AS CatalogType
    ,[Catalog].Name CatalogName
    , Roles.RoleName Role
    , Users.UserName UserId
FROM PolicyUserRole
INNER JOIN Roles ON PolicyUserRole.RoleID = Roles.RoleID
INNER JOIN Policies ON PolicyUserRole.PolicyID = Policies.PolicyID
INNER JOIN Users ON PolicyUserRole.UserID = Users.UserID
INNER JOIN [Catalog] ON PolicyUserRole.PolicyID = [Catalog].PolicyID

Order by Users.UserName

Monday, 9 April 2018

How to get SSRS Report Subscription, Share Schedule, Last run date & Status

These are the tables that are relevant for pulling out the subscription information:
  • dbo.Catalog - Information about the deployed reports
  • dbo.ReportSchedule - Information relating reports to schedules and schedules
  • dbo.Subscriptions - Information about the subscriptions
  • dbo.Schedule - Information about the schedules
The SQL below pulls out schedule interval information for all reports. It doesn't calculate the next run dates but by figuring out the interval that the schedule is supposed to run on you can write another query to generate the actual dates.
This SQL was originally written for a report that just displays a string describing the interval so the final output is probably not what you're after. It should give you a good starting point though since it does figure out all of the interval details.

USE REPORTSERVER
GO
SELECT C.NAME AS Report_Name ,S.Description AS Subscription_Name ,SCH.NAME Share_Schedule,S.LastRunTime Subscription_LastRunTime,S.LastStatus 
FROM [dbo].[Schedule] SCH 
INNER JOIN [dbo].[ReportSchedule] RS ON RS.ScheduleID=SCH.ScheduleID
LEFT JOIN [dbo].[Subscriptions] S ON S.SubscriptionID=RS.SubscriptionID
LEFT JOIN [Catalog] C ON C.ItemID=RS.REportID

Sunday, 12 November 2017

How to change the of Name of Report Will Exporting it in PDF OR Excel.


Added below given code in .Net report viewer.

Don’t forget to add web reference to following URL

  http://<Report Server Name>/ReportServer/ReportExecution2005.asmx

   private void ReportExport(string ReportPath, string Format)
        {
            try
            {
                SEReports.ReportExecutionService.ReportExecutionService rs = new SEReports.ReportExecutionService.ReportExecutionService();

                rs.Credentials = new NetworkCredential
                    (
                        ConfigurationManager.AppSettings["ServiceAccountUserId"],
                        ConfigurationManager.AppSettings["ServiceAccountPwd"],
                        ConfigurationManager.AppSettings["ServiceAccountDomain"]
                    );

                // Render arguments
                byte[] result = null;
                string historyID = null;
                string encoding;
                string mimeType;
                string extension;

                SEReports.ReportExecutionService.Warning[] warnings = null;
                string[] streamIDs = null;

                ExecutionInfo execInfo = new ExecutionInfo();
                ExecutionHeader execHeader = new ExecutionHeader();

                rs.ExecutionHeaderValue = execHeader;
                rs.Url = ConfigurationManager.AppSettings["ReportServerWSURL"];

              
                execInfo = rs.LoadReport(ReportPath, historyID);
             
                rs.SetExecutionParameters(ParamArray, "en-US");
                String SessionId = rs.ExecutionHeaderValue.ExecutionID;
               
                result = rs.Render(Format, nullout extension, out mimeType, out encoding, out warnings, out streamIDs);
                int Count = streamIDs.Length;
              

                Response.ClearContent();
               
               string FileName;

                switch (Format)
                {
                    case "PDF":
                        {
                            Response.ContentType = "application/pdf";
           FileName=”< Name of Choice >” +”.pdf”;
                            break;
                        }
                    default:
                        {
                            Response.ContentType = "application/vnd.ms-excel";
           FileName=”< Name of Choice >” +”.xls”;
                            break;
                        }
                }


                Response.AddHeader("Content-Disposition""attachment;filename=" + FileName);

                Response.BinaryWrite(result);
               
            }
            catch (Exception ex)
            {
               
            }
            finally
            {
                Response.Close();
            }
        }


Thursday, 19 October 2017

Scale Out Deployment

Scale Out Deployment
Scale-out deployment model of Reporting services allows you to run multiple report server instances that share a single report server database. The sample Scale -Out Deployment is shown in below picture.

In below model there are 4 SSRS Server install on different system, which are sharing common reporting Server Database which is on the external storage.

The Scale- Out Deployment could serve two purposes.
·         Can help in User Load Balancing.
·         Disaster Recovery

For any system which is having larger number of user, the biggest challenge to maintain System performance, performance of the system depends on numerous factors, Load balancing is also play vital role in system Performance. Scale-out deployment model of Reporting services can help us in this purpose if we implement this model with Network load balancing (NLB) as shown in below picture.



Load balancing eases network traffic to one server by distributing traffic across two or more servers. For example, a server that's overtaxed to 140% of its traffic-handling capacity will experience deficient performance, such as long waits for requests. By using load balancing and distributing the workload across a second server, the average load per server drops to 70%. As a result, users receive superior performance, even during times of high utilization or traffic load. Windows incorporates NLB features, combining two or more servers running the same application (such as a Web server) into a virtual cluster that can distribute network traffic across cluster nodes.
If we have two or more servers attached with same database, if one server goes down because of any reason we have one or more live on which NLB can divert the request, hence also serve as disaster recovery.
To create a scale-out deployment, you use Setup and the Reporting Services Configuration tool:
  • Use Setup to install each report server instance that will be joined to the scale-out deployment.
  • Use the Reporting Services Configuration tool to connect each report server to the shared database. You can only connect to and configure one report server at a time.
  • Use the Reporting Services Configuration tool to complete the scale-out by joining new report server instances to the first report server instance already connected to the report server database.
To avoid database compatibility errors when connecting the server instances to the shared database, be sure that all instances are the same version. For example, if you create the report server database using a SQL Server 2008 report server instance, all other instances in the same deployment must also be SQL Server 2008.
The following instructions explain how to configure a two-node report server scale-out deployment. Repeat the steps described in this topic to add additional report server nodes to the deployment.
If you are planning to host the scale-out deployment on a network load balanced (NLB) cluster, you should configure the NLB cluster before you configure the scale-out deployment.
To install a SQL Server instance to host the report server databases
  1. Install a SQL Server instance on a computer that will host the report server databases. At a minimum, install SQL Server Database Engine and Reporting Services.
  2. If necessary, enable the report server for remote connections. Some versions of SQL Server do not enable remote TCP/IP and Named Pipes connections by default. To confirm whether remote connections are allowed, use SQL Server Configuration Manager and view the network configuration settings of the target instance. If the remote instance is also a named instance, verify that the SQL Server Browser service is enabled and running on the target server. SQL Server Browser provides the port number that is used to connect to the named instance.
To install the first report server instance
  1. Install the first report server instance that is part of the deployment. When you install Reporting Services, choose the Install but do not configure server option on the Report Server Installation Options page.
  2. Start the Reporting Services Configuration tool.
  3. Configure the Report Server Web service URL, Report Manager URL, and the report server database.
  4. Verify that the report server is operational.
To install and configure the second report server instance
  1. Run Setup to install a second instance of Reporting Services on a different computer or as a named instance on the same computer. When you install Reporting Services, choose the Install but do not configure server option on the Report Server Installation Options page.
  2. Start the Reporting Services Configuration tool and connect to the new instance you just installed.
  3. Connect the report server to the same database you used for the first report server instance:
    1. Click Database to open the Database page.
    2. Click Change Database.
    3. Click Choose an existing report server database.
    4. Type the server name of the SQL Server Database Engine instance that hosts the report server database you want to use. This must be the same server that you connected to in the previous set of the instructions.
    5. Click Test Connection, and then click Next.
    6. In Report Server Database, select the database you created for the first report server, and then click Next. The default name is Reportserver. Do not select ReportServerTempDB; it is used only for storing temporary data when processing reports. If the database list is empty, repeat the previous four steps to establish a connection to the server.
    7. In the Credentials page, select the type of account and credentials that the report server will use to connect to the report server database. You can use the same credentials as the first report server instance or different credentials. Click Next.
    8. Click Summary and then click Finish.
  4. Configure the Report Server Web service URL. Do not test the URL yet. It will not resolve until the report server is joined to the scale-out deployment.
  5. Configure the Report Manager URL. Do not test the URL yet or try to verify the deployment. The report server will be unavailable until the report server is joined to the scale-out deployment.
To join the second report server instance to the scale-out deployment
  1. Open the Reporting Services Configuration tool, and reconnect to the first report server instance. The first report server is already initialized for reversible encryption operations, so it can be used to join additional report server instances to the scale-out deployment.
  2. Click Scale-out Deployment to open the Scale-out Deployment page. You should see two entries, one for each report server instance that is connected to the report server database. The first report server instance should be joined. The second report server should display a status of "Waiting to join". If you do not see similar entries for your deployment, verify you are connected to the first report server that is already configured and initialized to use the report server database.
          
         
  1. On the Scale-out Deployment page, select the report server instance that is waiting to join the deployment, and click Add Server.
  2. You should now be able to verify that both report server instances are operational. To verify the second instance, you can use the Reporting Services Configuration tool to connect to the report server and click the Web Service URL or the Report Manager URL.


Thursday, 5 October 2017

Learn SSRS Step by Step (Video)

Microsoft has introduced SQL Server Reporting Services (SSRS) in 2004 as an add-on to SQL Server 2000. Subsequent versions have been:

v     Second version with SQL Server 2005 in November 2005
v     Third as part of SQL Server 2008 R2 in April 2010
v     Fourth version as part of SQL Server 2012 in March 2012
v     Fifth version as part of SQL Server 2014 in March 2014
v     Sixth and current version as part of SQL Server 2016
    in March 2016

SSRS leverages the Business Intelligence Development Studio (BIDS) developer tool for all aspects of authoring and deploying reports.  BIDS are included with SQL Server 2008.
SSRS has emerge is one of the power tool for business Reporting, sales, Financial Reporting etc. let learn SSRS Step by Step with the help of videos.

Step 1 - Will learn how to open SSDT, Create SSRS project and Naming Convention.

Step 2 - How to create Solution with Multiple Project or adding existing project 

Step 3 - Understanding Share Data sources.in SSRS.

Step 4 - Understanding Embedded Share Data sources in SSRS.

Step 5 - Introduction to Data set & share Data set.

Step 6 - Overview of reports Tab in SSRS Project.

Step 7 - Creating Tabular report by using report wizard.

Step 8 - Creating Tabular report by using page and detail in group option report wizard.

Step 9 - Creating Stepped Report by using report wizard.

Step 10 - Creating Stepped Drill – Down Report with Sub Totals by using report wizard.

Step 11 - Creating Block Report with Sub Totals by using report wizard.

Step 12 - Understand Page, Group and Detail in report wizard.

Step 13 - Using query builder feature in report wizard to Create SQL query for report.

Step 14 - Create Matrix report by using wizard.

Step 15 - Create Detail from basic.

Step 16 - How to create stepped grouped report with subtotal and Grand total from Basis SSRS.

Step 17 - How to create block group report with subtotal and grand total in SSRS.

Step 18 - Create Drilldown Group Report with Group Total and Grand Total from Basics.

Step 19 - Create Multi Group Drilldown report with Group Totals and Grand Total.

Step 20 - Create Report with Group on Page Level from SSRS basic.

Step 21 - How to create list report SSRS.

Step 22 - How Display Report Name and Header Row on Each Page in SSRS Report.

Step 23 - How to Display all the rows on Single Page in SSRS Report.

Step 24 - How to Add Running Total to Tabular Report in SSRS.

Step 25 - How to Add Running Total by Group and Dataset Level in SSRS Report.

Step 26 - How to Add Row Number to rows in SSRS Report.

Step 27 - How to Create Statics Values Parameter with Default Value in SSRS Report.

Step 28 - How to Single Value Parameter with Values from Query in SSRS Report.

Step 29 - How to Create Multi Value Parameter in SSRS Report.

 

Step 30 - How to create Date Parameters with Calendar in SSRS Report

 

Step 31 - How to Create Radio Button Parameters in SSRS Report

 

Step 32 - How to Create Cascade Parameters in SSRS Report

 

Step 33 - Allow Null Value Parameter Option to Pass Null Value from Parameter in SSRS Report.

 

Step 34 - How to make SSRS Report Parameter Optional (Ignore the Parameter)

Step 35 - How to Create DrillThrough Report in SSRS

 

Step 36 - Use Stored Procedure with Single Value Parameter in SSRS Report

Step 37 - Use Stored Procedure with Multi value Parameter in SSRS Report

 

Step 38 - Wildcard Search in SSRS Report Parameter

 

Step 39 - Show Null value for Multi Value Parameter in SSRS Report

 

Step 40 - Default Multi Value Parameters are Not Selected in SSRS Report

https://www.youtube.com/watch?v=WUnBl0PrWpE&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8&index=40

 

Step 41 - How to Add, Remove or Rename Parameter in SSRS Report.

https://www.youtube.com/watch?v=pz0a-iBJeHA&index=41&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8

 

Step 42 - Create Sub Reports and Call them in Master Main Report

https://www.youtube.com/watch?v=F8KMTuXEHs0&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8&index=42

 

Step 43 - How to change Colour of Alternative Row in SSRS Report

https://www.youtube.com/watch?v=j-bCd_p4VvQ&index=43&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8

 

Step 44 - How to change colour of Rows per Group in SSRS Report

https://www.youtube.com/watch?v=qDjI4ekV8qQ&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8&index=44

 

Step 45 - How to Replace Null Values in SSRS Report

https://www.youtube.com/watch?v=NCgo3n4Bg6A&index=45&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8

 

Step 46 - How to Hide Empty Rows in SSRS Report

https://www.youtube.com/watch?v=QqMFybeXsHw&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8&index=46

 

Step 47 - How to use IIF and Switch Function in SSRS Report

https://www.youtube.com/watch?v=gl3v79XpxaA&index=47&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8

 

Step 48 - Show Report Parameter values while displaying Rows in SSRS Report

https://www.youtube.com/watch?v=IFH6bjq3IGI&index=48&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8

 

 

Step 49 - How to use Expressions in SSRS Report

https://www.youtube.com/watch?v=1owrVg0XmVU&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8&index=49

 

Step 50 - Show Different Images depending upon value of Cell in SSRS Report

https://www.youtube.com/watch?v=s1lQTRlsKgE&index=50&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8

 

Step 51- Add Page X of Total Pages in Report Footer Or Header In SSRS Report

https://www.youtube.com/watch?v=9DQ4EPD5QAs&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8&index=51

 

Step 52 - What is Page Break in SSRS Report

https://www.youtube.com/watch?v=4UJR5dTmscs&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8&index=52

 

Step 53 - How to Handle Number of Rows Per Page in SSRS Report

https://www.youtube.com/watch?v=ZPxyrwflUmw&index=53&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8

 

Step 54 - Limit Rows Per Page with Groups in SSRS Report

https://www.youtube.com/watch?v=HYgyxANrqf4&index=54&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8

 

Step 55 - Limit Number of Rows per Page by Parameter Vaule in SSRS Report

https://www.youtube.com/watch?v=39EMPVKazqs&index=55&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8

 

Step 56 - Pass Parameter Value from Image Click in SSRS Report

https://www.youtube.com/watch?v=E__VZIz09pk&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8&index=56

 

Step 57 - Hide or Un-Hide Columns by Using Parameter Value in SSRS Report

https://www.youtube.com/watch?v=5sOrVArOMHU&index=57&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8

 

 

Step 58 - Creating Tabs in SSRS Report

https://www.youtube.com/watch?v=NLJ1fF3SWu0&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8&index=58

 

Step 60 - How to Create Column Chart in SSRS

https://www.youtube.com/watch?v=DuIP9bioLmM&index=61&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8

 

Step 61 - Highlight Columns in Chart for Max and Min Values in SSRS Report.

https://www.youtube.com/watch?v=1xdZd6JKC9Y&index=62&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8

 

Step 62 - How to Format Text Differently in the Same Text Box in SSRS Report.

https://www.youtube.com/watch?v=xsIUWpRfXM8&index=63&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8

 

Step 63 - Create Master Report with Report Selection Parameter To Display Selected Report.

https://www.youtube.com/watch?v=l4CVNYHWSzI&index=64&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8

 

Step 64 - How to Rotate Text in SSRS Report.

https://www.youtube.com/watch?v=OWgY2bJjOJQ&index=65&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8

 

Step 65 - How to Create Stacked Column Chart Report in SSRS.

https://www.youtube.com/watch?v=gwSoOc8odp0&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8&index=66

 

Step 66 - How to Display Total on top of Stacked Chart in SSRS Report.

https://www.youtube.com/watch?v=s7qsClWDlqM&index=67&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8

 

Step 67 - How to Combine Column Chart with Line Chart in SSRS Report.

https://www.youtube.com/watch?v=wtU20dqSy60&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8&index=68

 

Step 68 - How to Plot multiple lines on Same Graph from Same Dataset in SSRS Report.

https://www.youtube.com/watch?v=udKkc3Twqqc&index=69&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8

 

Step 69 - How to Custom Colour Columns in Column Chart in SSRS Report.

https://www.youtube.com/watch?v=65M9xDvq-Ag&index=70&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8

 

Step 70 - How to Create Pie Chart in SSRS Report.

https://www.youtube.com/watch?v=e4fBsnaECEo&list=PLWf6TEjiiuICDOPAosEL32PLghuHcp5i8&index=71


Best SSRS Videos.