SSRS

In SSRS classes this week.

Use BIDS to create a new SSRS project. Open Visual Studio 2008 with BIDS installed. First create a new project (File| New | Project). On the dialog page, click Report Server Project and enter a project name:

newProj

First thing to do is create a ‘Shared Data Source’ (if not using an already created shared data source), in the Solution Explorer.  To create the Shared Data Source, right click on ‘Shared Data Sources’ in the Solution Explorer and click ‘Add new data source’. Follow the wizard to complete the process of creating a data source ( a data source is a pointer to a database and is basically a connection string: nothing more.).

CreateDataSource

So  a Data Source is a connection string and you will most likely want to use Shared Data sources. A Dataset is set of data that is pulled back from the database (or a defined query). Like data sources, there are shared and embedded version. Shared Datasets don’t appear to be as useful as embedded datasets because you will probably want to customize the query for each report and change the parameters and fields that need to be in the report.

Creating a report:

So you’ve created a Shared Data Source, which we will use as we create the new report.

In the Solution Explorer, right click Reports, then click ‘Add’, and ‘New Item’. Then select ‘Report’ as the type and enter a name for the report.

Now in the ‘Report Data’  explorer right click ‘Data Sources’, and ‘Add Data Source’. In the dialog, you will change the radio button to ‘Use Shared Data Source’ and

enter a better name than DataSource1, then hit ‘OK’

AddDataSource

Now you need to create a Dataset, which is the query that will be used to get the data that goes into the report. Right click Dataset and click ‘Add Dataset’, which opens the Dataset dialog. Click use ‘Use a dataset embedded in my report’. The select the datasource you created in the previous step (this points you to the right database). Then you can click the ‘Query Designer’ button, which will open a GUI for you to build the query which will pull the data for your report to display.

NewDatasource

WCF service crashes after several calls (approx 30 calls).

I was using the WCF client to call a WCF service. After approximately 30 calls the host would stop responding, and then give a timeout error. The website associated with the host service would also become non-responsive for several minutes. It would come back online after several minutes and then my client calls would work for approximately 30 more calls, then the application would die again with timeout errors from the host.

 

The problem was that I needed to close the ServiceModel.ClientBase channel explicitly. I also made sure to use Try{}Catch{} with an Abort() call in the catch in case the code failed.

The code that caused errors looked like this:

WCFSomeAPI.SomeAPIClient client = new WCFSomeAPI.SomeAPIClient(“WSHttpBinding_SomeAPI”);
string cd = client.GetSomeInformation(sID);

 

 

The corrected code looks like this:

 

WCFSomeAPI.SomeAPIClient client = new WCFSomeAPI.SomeAPIClient(“WSHttpBinding_SomeAPI”);

try

{
string cd = client.GetSomeInformation(sID);

client.Close();

… (do something)

}

catch

{

client.Abort();
}

 

This seems simple an obvious, but I was under the impression that GC was taking care of cleaning up my resources on this, which was not the case, and I was either causing too many open connections or memory leaks (watching process didn’t really make me think this was a memory issue on my client side, but the article I read about this said this was a memory leak issue, but it appeared more like I was killing the host with memory leaks or open connections (similar to DOS attack)).