Showing posts with label Reporting Services. Show all posts
Showing posts with label Reporting Services. Show all posts

Monday 13 July 2015

SQL Server Reporting Services is not compatible with Internet Explorer 11- Resolved

 

When I was running SQL Server 2008 R2. All these reports were working fine until we upgraded IE from 10 to 11. Every time we run a report, it will just stuck at loading forever

The following instructions implement the Chrome fix and IE11 fix into an unmodified ReportingServices.js on the Reporting server.
1)    Create a backup copy of ReportingServices.js (C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportManager\js)
2)    Edit ReportingServices.js Find the fixChrome function. Rename the fixChrome function to pageLoad. This causes the function to get called each time the page changes and is required to make the chrome fix actually work.
3)    Modify the pageLoad function to the following

function pageLoad()
{
    var i, el = document.getElementById("ctl32_ctl09"),
        navBar = document.getElementById('ctl32_ctl05'),
        navBarTables = navBar.getElementsByTagName('table'),
        navBarTable;

    //Fix Chrome invisible report
    if (el)
        el.style.overflow = "visible";

    //Fix IE11 Navigation Bar over multiple rows
    for (i = 0; i < navBarTables.length; i++)
    {
        navBarTable = navBarTables[i];
        if (!!navBarTable.className.match(/WidgetSetSpacer/) || !!navBarTable.className.match(/WidgetShortSpacer/))
        {
            navBarTable.style.Display = '';
        }
    }
}

Use below url or more detail..

https://connect.microsoft.com/SQLServer/feedback/details/810527/sql-server-reporting-services-is-not-compatible-with-internet-explorer-11

Friday 12 June 2015

SSRS Summery data export issue

 

The user has requested to include the summary record in the report but to exclude the additional columns that have been appended to the data records. The other limitation they have imposed is that no other textboxes appear in the .csv file export. They only want to see the detail records with one header record at the top. The report needs to be exported as a .csv file because it exceeds the number of records which Excel can handle.

So far my research has reminded me that exporting a .csv file from SSRS exports only the data and strips out all formatting, therefore, the summary data is associated with each data record.

Here is the solution for this.

For each data element you want to exclude:

  1. Open the properties menu for the TextBox with F4
  2. Set the DataElementOutput property to NoOutput

    screenshot

 

SRS 2008 report which has 3 column groups which when i export to Excel the resulting excel spreadsheet has an additional total column for each of the groups.  I dont have this displayed in the report and dont want it displayed in teh excel export, is there anyway to turn this off?

SSRS 2008 report which has 3 column groups which when i export to Excel the resulting excel spreadsheet has an additional total column for each of the groups.Below is the trick for overcome this issue.

If you are running SSRS 2008 R2, you can set the total columns / cells ' visibility to =(Globals!RenderFormat.Name ="Excel") to hide them when exporting to Excel.

Following url has more in formation about rendering formats.

http://blogs.msdn.com/b/robertbruckner/archive/2010/05/02/globals-renderformat-aka-renderer-dependent-report-layout.aspx

Tuesday 8 July 2014

The attempt to connect to the report server failed

 

Many times, I saw this error in asp.net log files, when I used asp.net reportviewer for render SSRS reports on asp.net page.

The attempt to connect to the report server failed.  Check your connection information and that the report server is a compatible version.
Debug Info: RepReportViewer::Page_Load-Page could not be loaded: Error occured
StackTrace:    at Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.ProxyMethodInvocation.Execute[TReturn](RSExecutionConnection connection, ProxyMethod`1 initialMethod, ProxyMethod`1 retryMethod)
   at Microsoft.Reporting.WebForms.ServerReport.EnsureExecutionSession()
   at Microsoft.Reporting.WebForms.ServerReport.GetParameters()
   at repreportviewer.Page_Load(Object sender, EventArgs e) in C:\www\clinics\View.aspx.vb:line 108
InnerException:Client found response content type of '', but expected 'text/xml'.
The request failed with an empty response.

In order to solve the problem, I opened the rssrvpolicy.config reporting services configuration file in the ReportServer virtual directory of the IIS where the report server exists. That is the C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer folder with a default installation.

I updated the following CodeGroup block permission set from Nothing

<CodeGroup
                            class="FirstMatchCodeGroup"
                            version="1"
                            PermissionSetName="Nothing">

to FullTrust in order to let the application access the assemblies successfully.

<CodeGroup
                            class="FirstMatchCodeGroup"
                            version="1"
                            PermissionSetName="FullTrust">

For more information follow these threads.

http://social.msdn.microsoft.com/Forums/sqlserver/en-US/07a1db31-1fad-4555-ad66-7195c44328b6/client-found-response-content-type-of-but-expected-textxml

http://social.msdn.microsoft.com/Forums/sqlserver/en-US/f9d04ca5-6605-4a33-af75-3f72428889d1/rsrender-the-request-failed-with-an-empty-response

Friday 10 January 2014

Report Builder 3.0: Creating a Basic Report

Report Builder 3.0 is a report-authoring tool that’s part of the Reporting Services suite of tools available in SQL Server 2008 R2. However, Report Builder is a free, stand-alone application that can be used by SQL Server developers and business users alike to create reports rich in data visualizations. It provides an Office-like interface that makes it easy to connect to a variety of data sources—such as SQL Server, SQL Azure, Oracle, and SAP NetWeaver BI—and to display the data from those sources in tables, charts, lists, gauges, and maps.
In this article, you’ll learn how to use Report Builder to create a report that displays data from a SQL Server database. Keep in mind that this article is only the first in a series of articles about Report Builder. This one covers only what you need to know to build a basic report. As we progress through the series, you’ll learn how to use other Report Builder elements that let you create a variety of interesting and informative reports.
You can download Report Builder at the Microsoft Download Center. There you’ll find details about system requirements and additional information about the installation process. You can also download sample reports that you can open in Report Builder.
To try out the examples in this article, you’ll need Report Builder 3.0 installed on your system. You’ll also need access to a SQL Server instance with the AdventureWorks sample database installed. The database will provide the data you need to create your report based on the examples I demonstrate here. On my system, I used a local instance of SQL Server 2012 with the AdventureWorks2012 database installed. But you can use different versions of both SQL Server (2005 and on) and the AdventureWorks database.
The best way to learn Report Builder is to jump right in. In this article, I walk you through the steps necessary to connect to a data source, define a dataset, and present the data in a formatted table. The goal of the article is to provide you with the foundation you need so you can create other types of reports as you need them. Of course, I can’t show you everything in a single article, but I can give you the information you need to start working with Report Builder right away.

Getting Started with Report Builder

All it takes to use Report Builder is to have it installed on your system. Of course, to create a report, you’ll also need to have access to a data source, such as a SQL Server database. But everything else is available through the Report Builder interface, so to get started, your initial step is to launch the application.
When you first open Report Builder, the GettingStarted dialog box appears, as shown in Figure 1. (You can see the Report Builder interface behind it.) The dialog box provides several options for creating a new report or opening an existing one. For the purposes of this article and the ones to follow, we won’t be using this dialog box. If you like, you can select the Don’t show this dialog box at startup option so you don’t have to mess with it going forward. Or you can simply close the box by clicking the red Close button in top-right corner.
The welcome screen that appears when you open Report Builder
Figure 1: The welcome screen that appears when you open Report Builder
After you close the GettingStarted dialog box, you’re presented with the Home tab of the Report Builder interface, which is shown in Figure 2. At the top of the interface is the type of ribbon you’ve become familiar with in Microsoft Office products. It contains the options necessary to create and design your report. For each tab of the interface, the ribbon contains a different set of options. (You’ll learn more about these options as we progress through this article and the ones to follow.)
The Home tab of the Report Builder interface
Figure 2: The Home tab of the Report Builder interface
At the left edge of the Report Builder interface is the ReportData window, which provides a hierarchical view of the built-in fields, parameters, images, data sources, and data sets available to your report. As with the ribbon options, we’ll dig into these more as we progress through this series. Same thing for the RowGroups and ColumnGroups windows, which, as you might expect, are tied to the way you group data on your report.
The main part of the Report Builder interface is the layout window (outlined in red). This is where you construct your report. Here you can add and configure the elements necessary to display your data, such as tables, graphs, and charts. You can also add elements such as text, images, and lines—many of the things that make your reports more appealing and effective.
Report Builder also includes a set of options that apply to the application as a whole. To access these options, click the Report Builder button (the large round button at the top-left corner of the screen), and then click the Options button. This launches the ReportBuilderOptions dialog box, shown in Figure 3.
The Report Builder Options dialog box
Figure 3: The Report Builder Options dialog box
The dialog box opens to the Settings page, which lists a number of options related to the Report Builder interface and report deployment. For now, the only setting that might concern you is the option Use this report server or SharePoint site by default. When you installed Report Builder, you might have specified a Reporting Services (SSRS) report server where you would eventually deploy your reports. If you provided an incorrect URL or that URL has changed, this is the place to enter the correct information. If the information is incorrect, you will have to wait for Report Server to verify the connection every time you start the application, which can be somewhat time-consuming. So if this issue applies to you, enter the path and then click OK.
Note: If you’re connecting to a Reporting Services instance other than the default, you append the instance name onto the path, preceded by an underscore. For example, the report server on my system was installed as part of SQL Server instance ws02/SqlSrv2012. As a result, I appended _sqlsrv2012 onto the URL http://ws02/reportserver so it became http://ws02/reportserver_sqlsrv2012, as you can see in Figure 3.
You might have noticed that the ReportBuilderOptions dialog box also includes a Resources page, which provides access to details about Report Builder and to additional information available online.
One other feature you should be aware of before we get started is how to save a report. When you first open Report Builder, you are essentially starting a new report. You can save this report and then access it as you work on it. To do so, click the ReportBuilder button and then click Save. This launches the SaveAsReport dialog box, shown in Figure 4.
Saving a report in Report Builder
Figure 4: Saving a report in Report Builder
Although the SaveAsReport dialog box shows several option for saving a report, you essentially have two choice: save to the file system or save to the report server you designated in the ReportBuilderOptions dialog box. For now, we’ll simply save our report file to the local file system. On my system I navigated to the C:\DataFiles folder and named the report Annual Sales, which becomes the file name.
Notice that Report Builder reports use the .rdl extension, just like Reporting Services reports. Reporting Services reports and Report Builder reports are created using the Report Definition Language (RDL), an XML-based language that defines how data is retrieved and a report is laid out.
Once you’ve named and saved your report file, you’re ready to start creating your report. Be sure to save the file regularly as you develop your report. That way, you can always come back to the report and start where you left off. So, with that in mind, let’s get started.

Adding a Data Source to Your Report

Before you can add data to a report, you must be able to connect to a data source. The data source provides the connection necessary for your report to retrieve the data used to populate its contents. To add a data source, right-click the Data Sources node in the ReportData window, and then click AddDataSource. This launches the DataSourceProperties dialog box, shown in Figure 5.
Adding a data source to your report
Figure 5: Adding a data source to your report
As you can see in the figure, you provide a name for your data source and then choose whether to use a shared connection or a connection embedded in the report. The first option lets you browse to a shared data source that has been published to a report server. Since we have not set up any shared data sources, we’ll go with the second option, which means we need to configure the connection we want to embed in the report.
So provide a name for your data source—I used AdventureWorks on my system—and then select the option Use a connection embedded in my report. When you select this option, new options appear in the DataSourceProperties dialog box, as shown in Figure 6. Notice that you must now select a connection type and define a connection string.
Configuring your data source
Figure 6: Configuring your data source
A Report Builder data source supports numerous connection types. To see a full list of what’s available, click the down arrow on the Selectconnectiontype drop-down list. You can then select the connection type you want to use. For this article, we’ll be using the MicrosoftSQLServer connection type, which is the default value, so in this case, you don’t need to take any steps to specify the connection type.
Next, you must build your connection string. The connection string shown in Figure 6 (in the Connectionstring text box) is the one I built for our examples. To build the connection string, click the Build button. This launches the ConnectionProperties dialog box, shown in Figure 7.
Building a connection string for your data source
Figure 7: Building a connection string for your data source
From the Servername drop-down list, select the SQL Server instance that contains your source data. Then, if necessary, select an authentication model for connecting to that SQL Server instance. If you plan to use Windows Authentication, you don’t need to do anything. However, if you’ll be using SQL Server Authentication, you must select the Use SQL Server Authentication option and provide the necessary credentials. (To keep things simple for these exercises, I used Windows Authentication and ran Report Builder as an administrator.)
Next you must select the database that contains the source data. Since I’m using the AdentureWorks2012 database, that’s the one I selected. Figure 8 shows you what the ConnectionProperties dialog box looked like on my system after I finished configuring the connection properties.
Configuring the connection properties
Figure 8: Configuring the connection properties
After you’ve configured the properties, you should test your connection. Then click OK to close the dialog box. You’ll be returned to the DataSourceProperties dialog box, which should now look similar to the one shown in Figure 6.
You might have also noticed that the DataSourceProperties dialog box includes a Credentials page. (So far, we’ve been working on the General page.) As shown in Figure 9, the Credentials page lets you change the credentials used to connect to the data source. You can configure this page only if your data source connection is embedded in the report (otherwise the options are grayed out). The report server can then use these credentials to connect to that data source. This enables other users to run the report without having to provide credentials for the underlying data source connection.
Changing the credentials used to connect to a data source
Figure 9: Changing the credentials used to connect to a data source
For now, we don’t need to be concerned about setting these credentials. So return to the General page if necessary and again test your connection. Then click OK to close the DataSourceProperties dialog box. Your new data source is added to the DataSources node in the ReportData window.

Adding a Dataset to Your Report

The next step in building your report is to create a dataset. A dataset defines the actual data that you want to retrieve from your data source. For example, if you’re data source is a SQL Server database, the dataset will be based a query or stored procedure that returns a result set you can use to populate your reports. The dataset acts as a bridge between your report and the data source. The data source establishes the connection, and the dataset defines what data is retrieved through that connection.
To create a dataset, right-click the Datasets node in the ReportData window, and then click AddDataset. This launches the DatasetProperties dialog box, shown in Figure 10. The dialog box opens on the Query page, which is the only page we need to be concerned about for now.
Adding a dataset to your report
Figure 10: Adding a dataset to your report
As with the data source, you can use either a shared dataset or embed one in your report. Again, we’ll embed the information in the report. So provide a name for the dataset—I used AnnualSales—and then select the option Use a dataset embedded in my report. When you click this option, you’re presented with a several additional options, as shown in Figure 11.
Configuring a dataset for your report
Figure 11: Configuring a dataset for your report
First, you’ll need to select the data source on which the dataset is based. From the Datasource dropped-down list, select the AdventureWorks data source (or whatever you named your data source). Then, in the Query text box, enter the following query:
SELECT
BusinessEntityID,
FirstName,
LastName,
JobTitle,
City,
StateProvinceName,
CountryRegionName,
TerritoryName,
TerritoryGroup,
SalesQuota,
SalesYTD,
SalesLastYear
FROM
Sales.vSalesPerson
WHERE
TerritoryGroup IS NOT NULL;
As you can see, we’re selecting several columns from the Sales.vSalesPerson view. Each column returned from the query can be used as a field in your report. Click OK to close the DatasetProperties dialog box.
Your dataset should now be listed on the Datasets node in the ReportData window. And beneath the dataset, you should see a list of the fields returned by your dataset. For example, you should see the BusinessEntityID, FirstName, LastName, JobTitle, and all the other columns returned by your result set. You can now use these fields to build your report.

Adding a Table to Your Report

Once you’ve added your data source and dataset, you can add a data region or data visualization. A data region is a report object that displays your source data in a tabular format (rows and columns). Report Builder supports the following data region objects:
  • Table: A tabular object that contains a fixed number of columns. But the rows are dynamic, which means they can expand to accommodate the data you’re trying to display. It also means you don’t need to know how many rows of data will be returned by the data source when you add your table to the report, although you do have to specify the columns.
  • Matrix: A tabular object similar to a table, except that your columns can be static or dynamic, which means the report can grow both vertically and horizontally. A matrix is a lot like a crosstab or pivot table.
  • List: A tabular object that presents data in a freeform fashion. Lists are handy for creating forms such as invoices.
As we work through this series, we’ll dig deeper into each of these data region types. But for now, let’s look at the data visualizations. A data visualization is an object that displays the source data graphically in order to provide a conceptual overview of the underlying information. Report Builder supports the following data visualizations:
  • Chart: A graphical presentation of the data in the form of such objects as bar, pie, and line charts.
  • Gauge: A key performance indicator (KPI) that presents a range of data, with an indicator that points to a specific value within that range.
  • Map: Data presented against a geographical background. The data can be based on SQL Server spatial data, an Economic and Social Research Institute (ESRI) shapefile, or Microsoft Bing map tiles.
  • Data bar: A simple chart used in conjunction with other data and charts to present complex information in a small space. A data bar typically represents only a single data point.
  • Sparkline: A simple chart similar to a data bar, except that it typically presents a series of information.
  • Indicator: A small gauge that displays the state of a single data value.
As with the various types of data regions, we’ll go into each of the data visualizations more deeply as we progress through this series. For now, let’s focus on how to add a table to our report. To do so, go to the Insert tab, shown in Figure 12. As you’ll discover, the ribbon includes the data regions and data visualizations—along with other elements—that you can add to your report.
The Insert tab of the Report Builder interface
Figure 12: The Insert tab of the Report Builder interface
If you want, you can modify your design surface to make it bigger. You can also reduce the size of the RowGroups and ColumnGroups windows. For example, as you can see in Figure 13, I made the design surface bigger and moved the text box within the footer. (The footer is the region beneath the dotted line near the bottom of the design surface.)
Modifying the design surface in Report Builder
Figure 13: Modifying the design surface in Report Builder
The best way to learn how to move these elements around is to experiment with them. Normally it involves dragging a corner or side from one point to the other. If you’ve ever worked with a draw program, you’ll find the principles to be essentially the same.
Now let’s add out table. Click the down arrow beneath the Table icon on the ribbon, and then click InsertTable. Next, move your cursor to the design surface. The cursor becomes a plus sign with a tiny table icon. Position the cursor where you want the top-left corner of your table to sit, click the left mouse button, and then drag the cursor to the point where you want the bottom-right corner to sit. The red arrow in Figure 14 shows the direction to move the cursor.
Adding a table to your report
Figure 14: Adding a table to your report
When you let go your cursor, the table object is added to your report. It should look similar to the one shown in Figure 14 (without the red arrow, of course). The next step is to add the fields you want to include in your report. For the report I’m demonstrating here, we’ll add the following fields (in the specified order): FirstName, LastName, TerritoryGroup, SalesQuota, and SalesYTD.
To add a field, drag it from the list of fields in the ReportData window to the appropriate column in the table object. For example, drag the FirstName field to the first column and the LastName field to the second column. For the fourth column, drag the field to the right side of the table. When a heavy blue line appears, drop the field on that line. The column will be added to the table. You might have to play around with this a bit, but over all you should find the process very straightforward. Once you’ve added all five columns, your table should look similar to the one shown in Figure 15.
Adding columns to your table
Figure 15: Adding columns to your table
That’s all there is to adding a table to a report. You can now view the report so you can see how the table will look after the report has been deployed report. To view the report, click the View button at the left end of the ribbon. This will take you to the Run tab, as shown in Figure 16.
Viewing the table you’ve added to your report
Figure 16: Viewing the table you’ve added to your report
As you can see, the table is now populated with the columns and rows of data from your data source, with the column headings displayed in the first row. Notice that Report Builder automatically changes compound column names to separate words. By previewing the report in this way, you know how it will be rendered once it is actually deployed. The data might change, but the format itself will remain.

Moving Ahead with Report Builder

Of course, the way the table is currently displayed in the report is fairly inadequate. Although you now know how to add a data source, dataset, and table, that’s not enough to make a report something that people will want to look at. You must attend to the elements that control how the table and the rest of the report look so you’re presenting data in a readable and accessible way. In the next article, I’ll show you how to format your report to address these issue. Be sure to save the report you created here, because we’ll be building on that as we learn more about the various ways you can make your report a lot more appealing.
 
https://www.simple-talk.com/sql/reporting-services/report-builder-3.0-creating-a-basic-report/














































































Wednesday 13 November 2013

Google chrome opens blank pages when open SSRS Reports


This is a very painful issue that took my entire time and effort in solving it.
I am not sure how many of you know that SQL Server 2012 Reporting Services doesn’t support Safari and Chrome browsers (in fact, it’s only partially supported). But it’s high time, you know it. There is a browser support page on Microsoft website, that can be seen here: Planning for Browser Support.
Append to "C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportManager\js\ReportingServices.js" (on the SSRS Server) the following script:
function pageLoad() {    
var element = document.getElementById("ctl31_ctl10");
if (element) 
{
    element.style.overflow = "visible"; 
} }

For Chrome version 21 with SQL 2008 R2 SP1 and none of the above fixes worked for me. Below is the code that did work, as with the other answers I added this bit of code to Append to "C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportManager\js\ReportingServices.js" (on the SSRS Server) :

//Fix to allow Chrome to display SSRS Reports
function pageLoad() {
    var element = document.getElementById("ctl31_ctl09");
    if (element)
    {
        element.style.overflow = "visible";        
    }
}

 
Stack Overflow forum has got this gem of an article, which helped me in fixing this issue: SSRS 2008 R2 reports are blank in Safari and Chrome.
The original question was for SQL Server 2008 R2, but the solution works for SQL Server 2012 as well.
I am sure, some of you would face this issue in future, as more and more clients are moving toward different technologies other than Microsoft for day-to-day IT requirements, such as Linux, Mac, mobile OSes (iOS, Android, WP, etc.), but would still want all their BI solutions work as it would on native technology base (in this case, Microsoft).
 
http://social.msdn.microsoft.com/forums/sqlserver/en-US/c8708ca5-85db-4c7f-9a0c-4340b962ab3c/google-chrome-opens-blank-pages-when-an-open-ssrs-reports
http://vaidymohan.com/2012/06/26/sql-server-2012-reporting-services-on-safari-chrome-browsers/
http://stackoverflow.com/questions/5968082/ssrs-2008-r2-reports-are-blank-in-safari-and-chrome/










Thursday 17 October 2013

Resolution : Max 65,536 Rows Limitation While Exporting SSRS Report to Excel 2003

Excel 2003 has limitation of supporting only 65,536 Rows in the worksheet.
Suppose we have  SSRS report which has more than 65,536 Rows data and the system where we export SSRS report to Excel Format having Excel 2003 installed on the system, then  we got the error as shown in below post.
Let’s  do workaround to resolve the issue.
Select table where rows are greater than the above said limit i.e. 65,536.
As shown in below snapshot.

Write the SQL query to fetch the result to shown in the SSRS report as shown in below snapshot.

Create the report using above query and drag the table into the layout and assign the fields from the dataset.
When we run the report we will get the Save icon from where we can store the report into different formats as shown in below snapshot.

When we using above shown Save icon to save the report in Excel we encountered the error as shown in below snapshot as we have the Excel 2003 installed on our local machine.

Lets resolve the error by moving the data to other sheet when we reached the maximum or defined rows per sheet. Let’s see how we can implement moving data to next sheet in same excel.
Go back to table we already designed in SSRS report. Select the Detail row and add Parent group as shown in below snapshot.

After selecting Parent group it will open the below screen where we have to write the expression .

Clicking on above expression button we will get the expression editor where we need to write the expression “=CInt(Ceilng(RowNumber(Nothing)/65000))” as shown in below screen.

Now press ok and run the report, we will get the below error as by default it will write the sorting expression for the group.

Now go to the group properties as shown in below screen and click on the sorting .

Delete the sorting expression in below screen.

Now delete the group column as it is dummy one and don’t want in report.
Click on the Group and click on delete as shown in below screen.

Only Delete the Column not the group associated with it as shown in below screen.

Now again go to the group properties and click on page break and select the check box as shown in below screen.

Now we want header should be in different sheets as well for that add column header repeated for every page as shown in below screenshot.

Now run the report and save it to the hard disk and now it’s not throwing the error . instead of it asking for the location where to store the excel.

Finally we have the report exported in excel as shown in below screen.

 
Source http://msbitips.com/?p=624







































Tuesday 24 September 2013

Launching Report Builder from a Winform or Webform Application

At times, you may need to launch Report Builder from your custom application as either the currently logged in user, or under a different, arbitrary identity. Here's how!
Regardless of the technique you use, you're basically going to be hitting the URL http://yourServerName/reportserver/reportbuilder/reportbuilder.application . Most of the samples below are really just doing the "heavy lifting" of creating the necessary process and/or user identity to run Report Builder under:
Winform / Current User:
Use System.Diagnostics.Process.Start to launch IE and point it to the URL above:
System.Diagnostics.Process.Start("IExplore.exe","http://localhost/reportserver/reportbuilder/reportbuilder.application");
Winform / Other Identity:
You'll still be using Process.Start, but you'll also need to utilize some of the new framework 2.0 StartInfo members to specify the username/domain/password, etc. You also will use the new SecureString class to pass your password to StartInfo:
ProcessStartInfo startInfo = new ProcessStartInfo(@"c:\program files\internet explorer\iexplore.exe");
startInfo.UserName = "TestUser";
startInfo.Domain = "aDomain";
startInfo.WorkingDirectory = @"c:\program files\internet explorer";
System.Security.SecureString sS = new System.Security.SecureString();
sS.Clear();
sS.AppendChar('P');
sS.AppendChar('a');
sS.AppendChar('s');
sS.AppendChar('s');
sS.AppendChar('W');
sS.AppendChar('o');
sS.AppendChar('r');
sS.AppendChar('d');
sS.AppendChar('1');
sS.AppendChar('2');
sS.AppendChar('3');
startInfo.Password = sS;
startInfo.Arguments = "http://localhost/reportserver/reportbuilder/reportbuilder.application";
startInfo.UseShellExecute = false;
startInfo.LoadUserProfile = true;
Process.Start(startInfo);




















Another thing on this sample - You need to have LoadUserProfile set to true or Report Builder won't get installed (basically because the ClickOnce cache is located in C:\Documents and Settings\<username>\LocalSettings\Apps...so if you don't have a user profile loaded, there will be nowhere to drop the bits).
Webform / Current user:
Just use any technique you want to navigate to the http://yourServerName/reportserver/reportbuilder/reportbuilder.application URL
Webform / Other Identity:
It doesn't appear that this is (easily) doable. If any of you come up with a cool workaround, please let me know and I’ll post it
The basic problem is that regardless of how you launch the process (whether by Process.Start, LoginUserW and CreateProcessAsUser, etc.), it will get launched on the SERVER and will never become interactive. So, you may successfully LAUNCH an instance of IE, but the only place you'll see it is in task manager J There may be a way to locally launch an "impersonated" IE via JavaScript and RunAs, but I didn't have the patience to try and figure it out.
source http://blogs.msdn.com/b/bimusings/archive/2005/11/02/488141.aspx











Monday 23 September 2013

SSRS Report and Report builder integration in ASP.NET Web Page

1)Open VS 2010 and Create a ASP.NET Web Application project.

 
2)Add a ScriptManager (AJAX Externsions), ReportViewer (Reporting) and Button (Standard) control from the toolbox in the Default.aspx page.

3)Double Click on the button, to add the following code in the button event.
protected void Button1_Click(object sender, EventArgs e)
{
ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://localhost/ReportServer");
ReportViewer1.ServerReport.ReportPath = "/Report Project2/Report4";
ReportViewer1.ServerReport.Refresh();

// Below code demonstrate the Parameter passing method. User only if you have parameters into the reports.
Microsoft.Reporting.WebForms.ReportParameter[] reportParameterCollection = new Microsoft.Reporting.WebForms.ReportParameter[1];
reportParameterCollection[0] = new Microsoft.Reporting.WebForms.ReportParameter();
reportParameterCollection[0].Name = Perks.Constants.Pages.ClientAdmin.ShowInvoice.QueryStrings.INVOICEID;
reportParameterCollection[0].Values.Add(Request.QueryString[Perks.Constants.Pages.ClientAdmin.ShowInvoice.QueryStrings.INVOICEID].ToString());
ReportViewer1.ServerReport.SetParameters(reportParameterCollection);

ReportViewer1.ServerReport.Refresh();


}




 
Following code will return list of all reports deployed on report server.

dynamic clientCredentials = new NetworkCredential("user", "password", "domain");
ReportingService2010.ReportingService2010SoapClient client = new ReportingService2010.ReportingService2010SoapClient();
client.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
client.ClientCredentials.Windows.ClientCredential = clientCredentials;
client.Open();
TrustedUserHeader t = new TrustedUserHeader();
CatalogItem[] items = null;
ServerInfoHeader oServerInfoHeader = client.ListChildren(t, "/", true, items);
foreach (CatalogItem item in items) {
    ListBox1.Items.Add(item.Name);
}

Open a report in Report Builder from URL

As per this MDN link, we can start report builder by typing URL in browser. Suppose, we can open Report Builder 1.0 from URL by following URL
http://localhost:8080/ReportServer/reportbuilder/reportbuilder.application
This way we can also open Report Builder 2.0 or Report builder 3.0. Following URL opens Report Builder 2.0
http://localhost:8080/ReportServer/reportbuilder/reportbuilder_2_0_0_0.application
If we have configured SSRS in SharePoint integration mode then as per above mentioned MSDN link, we get an option to start Report Builder with a report or model pre-loaded.
In one of the projects, we need the same kind of functionality in SSRS configured without SharePoint integration mode. So, after searching, I found something interesting in this link. As per this, we can open the report by passing the report name after report builder URL.
I have created a test report (“TestFromURL.rdl”) to test this and deployed this into root directory on Report Server. By clicking following URL, report successfully opened in Report Builder 2.0.
http://localhost:8080/ReportServer/reportbuilder/reportbuilder_2_0_0_0.application?http://localhost:8080/reportserver/testfromUrl
As the same way, we can also open report from any path inside report server.

source http://beyondrelational.com/modules/2/blogs/115/posts/11145/open-a-report-in-report-builder-from-url.aspx














Wednesday 7 August 2013

SSRS Tablix Report having Data from Multiple Datasets – LookupSet Function SSRS 2008 R2

In SSRS 2008 R2 versions there are some functions introduced to provide extra functionality which we frequently required in BI reporting.

LookupSet is one of the functions which is used to join two dataset on similar key value having one to- many relationships and can be used to show from two different dataset fields in one tablix report.
Syntax and Description can be seen in below screenshot.

Let’s create sample report and see how we can use the function and achieve the functionality.
Let’s prepare tables and data for our learning purpose as shown in below screenshot.

Now we have two different queries fetching results having one key value common as “empid”.
Lets create two dataset each having different query as “EmpDS” and “DeptDS” as shown in below snapshot.

Let’s create one tablix report by dragging tablix from toolbox into report body.  Set the dataset name one of them in above created dataset as shown in below snapshot.                                                                        

Now we need to add the field from other dataset to the current tablix using LookupSet, for that create one column and go to the expression. Now write the expression as
=LookUpSet(Fields!deptid.Value,Fields!deptid.Value,Fields!Name.Value, “EmpDS”) and run the report it will show #Error in the report as shown in the below screenshot.

Edit the above expression and replace with the below expression. In below expression just we used join expression to join the multiple values.
=Join(LookUpSet(Fields!deptid.Value,Fields!deptid.Value,Fields!Name.Value, “EmpDS”),” ” + vbcrlf)
So we are fetching the “EmpDS” dataset field “Name” into the tablix using key value common in both dataset is “Deptid”.

Save the report and run it will appear as shown in below screenshot. Salary column is generated as per the correct employee.



















Wednesday 10 July 2013

Error in SSRS – System.Web.HttpException: Maximum request length exceeded

After finishing developing a new report on a new solution on reporting services (this case on SSRS 2008 R2) I receive the following error while trying to deploy the project:

System.Web.Services.Protocols.SoapException: There was an exception running the extensions specified in the config file. —> System.Web.HttpException: Maximum request length exceeded. at System.Web.HttpRequest.GetEntireRawContent() at System.Web.HttpRequest.get_InputStream() at System.Web.Services.Protocols.SoapServerProtocol.Initialize() — End of inner exception stack trace — at System.Web.Services.Protocols.SoapServerProtocol.Initialize() at System.Web.Services.Protocols.ServerProtocol.SetContext(Type type, HttpContext context, HttpRequest request, HttpResponse response) at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)

This error occurs because exists a property MaxRequestLength under the httpRuntime element in the file web.config (<your SSRS folder>\Reporting Services\ReportServer) where its default value is 4096 KB (4 MB) and when the report size is higher than this value, Reporting Services can’t upload a report successfully.

This error can be solved by doing the following steps:
1. Go to
(Example-> C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer)

2. Open the File
web.config

3. On the file web.config change the line
<httpRuntime executionTimeout=”9000″/>
To (for example):
<httpRuntime executionTimeout=”9000″ maxRequestLength = “16384″ />
By default, the property maxRequestLength doesn’t exist in the config file and the default value is 4096 KB so you have to increase that value. In example above I am increasing the value to 16384 KB.

Monday 1 July 2013

SSRS Subscriptions cannot be created because the credentials used to run the report are not stored, or if a linked report, the link is no longer valid.

Are you facing any message like this?

"Subscriptions cannot be created because the credentials used to run the report are not stored or if a linked report, the link is no longer valid"

This is an error that is easily avoided. When deploying a report to the report server we need to ensure that the data source have the credentials stored. Simply click on the data sources link in the report server web interface. Then select the data source that is being used for the report. Change the data source to stored credentials and enter in the user name and password of the user name that will be used to run the subscription. Usually this is a user name just used for subscriptions and not an actual person. The password should be set to not expire also. If the password for the user expires then your subscriptions will stop running.

If you are running a report from an OLAP cube in analysis services you will need to ensure the credentials are stored there also. The only way to connect to analysis services is with windows credentials so you will need to set up the stored credentials as above and also check the box for Use as Windows credentials. This will allow subscriptions to be created for reports pointing to analysis services.

When scheduling reports the best thing to use for security is data driven subscriptions. This allows you to use a table with the users information to give them an export of the report to a secure location. The folder locations can be locked down to just a location only the specific user can get into with active directory.

http://msdn.microsoft.com/en-us/library/ms159736.aspx

http://www.bidn.com/blogs/mikedavis/ssis/147/ssrs-subscriptions-cannot-be-created-because-the-credentials-are-not-stored

Thursday 27 June 2013

HTTP 404 Not Found with Reporting Services and Windows 7

Here are some steps to fixing an issue I ran into with Window 7 and Reporting Services 2008. The problem was when I attempted to access the Report Server or Report Manager from my browser I received the error HTTP 404 Not Found. I didn’t find a direct answer on the web for this but I did see a lot of people being directed to change the port used to 8080 without any explanation why. I don’t think this is an issue exclusive to Windows 7 but it happened immediately after installing it (maybe someone could shed some light on this part for me). I didn’t have this same problem while using Vista. I did the following steps to solve the problem.
1. Open Reporting Services Configuration Manager
2. Changed the Web Service URL to use TCP Port 8080 instead of the default 80.
3. Changed the Report Manager URL Advanced properties to use TCP Port 8080 instead of the default 80.
4. Restarted the service and I was good to go.



Friday 7 June 2013

Working with a Recursive Hierarchy in SSRS 2008

This article explains how to create a recursive hierarchy group, which organizes data in a report to include multiple hierarchical levels. This is helpful when you want to display hierarchical data in a report. For example: employees in an organizational chart, or product subcategory in a product list. The image below is an example:
clip_image002
This article assumes you have the following:
  • SQL Server 2008 and Reporting Services installed
  • Business Intelligence Development Studio (BIDS) or Report Builder 3.0 is installed. Note: We are using Report Builder 3.0 for this example.
  • AdventureWorks database
  • Experience working with Reporting Services
Steps Taken:
  1. Create a new report
  2. Add a Data Source and Dataset
  3. Add a Table to the report and include dataset field
  4. Edit Group properties and reference a Recursive Parent
  5. Add custom format expressions
  6. Run code
Create a new Report
1) Open Report Builder 3.0 and create a new report.
Note: If you have not done this before, please view my previous article "Creating a Report" for more information.
2) Save the report to your desired Report Server location and name it "RecursiveHierarchyGroup".
Add Data Source and Dataset
Creating the Data Source
1) From the Report Data pane, click New and select Data Source
clip_image004
the data source dialog will open...
clip_image006
Note: You may choose an existing shared data source, if you have previously created one. For this example, we will be using an embedded connection.
2) Provide a name for your data source. We will use the default value provided in this example.
3) Select "Use a connection embedded in my report" option
4) Select your Connection Type from the drop down. For this example we are using Microsoft SQL Sever.
5) Click the Build button from the right of the "Connection string:" textbox. You will see the Connection Properties dialog below.
clip_image008
6) Enter the same values in the property fields, found in the image above.
  1. Test the connection when you are done.
  2. If test is successful, click OK.
  3. Click OK to close the Connection Properties window.
  4. Click OK to close the Data Source Properties window.
  5. You should now see your data source name on the left Report Data pane.
Note: the value in Server Name property is a period "."
clip_image010
Creating the Dataset
1) From within the Report Data pane, select New >> Data Set
2) Make sure the Query item is selected in the left pane of the Dataset Properties window. Enter "Organization" in the Name field.
3) Select "AventureWorks" from the Data Source dropdown, or the name you gave your data source.
4) Copy and paste the following T-SQL script to the Query textbox:
select hr.EmployeeID, hr.ManagerID, c.FirstName + ' ' + c.LastName as 'Name', hr.Title
from HumanResources.Employee as hr inner join
Person.Contact c on hr.ContactID = c.ContactID
you should have something similar to below:
clip_image012
5) Click OK to save changes and close the window.
Add Table to Report
1) In Design view, add a table, and drag the following dataset fields to display:
  1. Name
  2. Title
2) Insert a new column to the right of the Title field and name it "Level".
3) Click in the "Click to add Title" field and enter "Organizational Hierarchy"
Your design view should look similar to the image below:
clip_image014
Edit Group properties and reference a Recursive Parent
4) Right-click anywhere in the table to select it. The Grouping pane displays the details group for the selected table. Optionally, you can select View from menu tab clip_image016and check Grouping. In the Row Groups pane, right-click Details, and select Group Properties. The Group Properties dialog box opens.
5) In Group expressions section, click Add. A new row appears in the grid.
6) In the Group on list, type or select the field to group - EmployeeID.
Your Group Properties General tab should look similar
clip_image018
7) Click the Advanced tab, from within the left pane of the Group Properties dialog.
8) In the Recursive Parent list, type or select the field to group on - ManagerID.
9) Click OK.
10) Run the report. You will notice the list of Employee names and titles. However, we need to do some formatting to indent the hierarchy accordingly.
Add custom format expressions
Indent Hierarchy
1) Right click on the [Name] field and select Text Box Properties...
2) From the left property pane, select the Alignment tab.
3) From under the Padding options section, select the Left expression button.
clip_image020
After clicking the expression button, you should see the following expression dialog.
clip_image022
4) Enter the following script in the expression textbox:
=CStr(2 + (Level()*10)) + "pt"
The Padding properties all require a string in the format nnyy, where nn is a number and yy is the unit of measure. The example expression builds a string that uses the Level function to increase the size of the padding based on recursion level. For example, a row with a level of 1 would result in a padding of (2 + (1*10))=12pt, and a row with a level of 3 would result in a padding of (2 + (3*10))=32pt.
Set Font Style
1) From the left property pane, select Font.
2) Under the Style section, click Bold expression button.
3) Enter the following script in expression textbox:
=IIF(Count(Fields!Name.Value, "Details", Recursive) > 1, "Bold", "Normal")
Essentially the Count function is searching the Fields!Name.Value, from within the "Details" group, recursively. If the recursive parent has children, then the parent is set to Bold, else Normal.
4) Click OK.
5) Right click on the Level field and click Expression...
6) Enter the following script:
=Level()
The Level() Function returns the current level (Integer) of depth in a recursive hierarchy.
7) Click OK.
5) Run the report. You should see similar results.
clip_image024
That's all there is to it.










































































Azure AzCopy Command in Action

Azure AzCopy Command  in Action -  Install - Module - Name Az - Scope CurrentUser - Repository PSGallery - Force # This simple PowerShell ...