Archive for the ‘Programming’ category

Making group in Reporting Service

August 15th, 2009

I was recently try to make sample grouping in report using reporting service. I working with Sql Server Management Studio (2005) and Microsoft Visual Studio 2005.

First Step :  I working with with Sql Server Management Studio (2005)

In SQL Server 2005 I create a table, entry data to the table and make Store Procedure as the link to Reporting Services to view report. For example I will create my own table, Employee Table.
create-table

This is the content of Employee Table

table-content

And then make simple Store Procedure, I make SP_ViewEmployees procedure. This is the script:

create-sp

Second Step : Working with Microsof Visual Studio 2005

The step to create reporting service  are as below:

- I start with open this menu : File - New - Project, In the New Project Window I  choose Other Project Types, and then choose Visual Studio Solution.

- I give Report01 as the solution name, Right click the solution and then Add New Project from this menu : Add - New  Project.

- In New Project window I choose Business Intelligence Project, and the click Report Server Project.And I give Report01 as the project name.

- Right click Share Data Sources Folder in Report01 Project, choose Add New Data Source

datasource

To set the properties, click button Edit and follow the below picture to set Connection String properties base on your database connection setting.

connection

- Right click Reports Folder in Report01 Project, choose Add - New Item and then click Report, I give rptGrouping as the report Name

- In Data tab see Dataset drop down list. Click the drop down list -  choose DataSet and  entry all requirement as the below picture

dataset

- In the report Layout tab you can make the design as below picture by using table and in the detail rows insert groups

grouping

Set the Group properties as picture below, uncheck  include group header and include group footer

grouping-properties

To set the value of each column you can right click in the column detail and choose expression.To Employee ID, Name, Gender  and Group No value  follow this step. For example Employee ID column, right click  in the Employee ID detail and then choose expression,after edit expression window appears,choose Fields (Dataset1)  double click Employee_ID Fields (DataSet1) and then click button OK.

edit-expression

I make the grouping in the column No, so right click in the No column detail and then choose expression.

report-expression

And give the expression value as below picture.

expression- In the preview tab you will see the result like this, before insert the year value. For example 2008

report-result

Hope you enjoyed trying this!

My Reporting Service Problem In Excel Output

June 13th, 2009

My client complain to me about his report result when he export the report to excel.I use reporting service to create the report and the project is Accounting Project. My report result vexes my client because in the report result there are merged cells in the Excel ouput.

This merged cell can be the big problem for him because this project is Accounting Project. He can not sorting his data and sum his data appropriately.So I must render the merge cell.

Here the solutions that I have, I solve the problem from this link.

1. When you design your report with reporting service make sure the left and and the right edges of all reports item line up  with another

12

2.  Export your report to excel

22

3. Finally the excel result will be like this

31

Alert and Link page code with ASP.NET

February 13th, 2009

Yersterday I was confused with my project program code. About a half hour I try to create alert program on a web form, after alert program displayed the web form will directly on redirect to another web page. The language is VB.Net .Finally I get the solution.

The example code is like this:

ScriptManager.RegisterStartupScript(Me, Me.GetType, "alert", "alert('Go to page Default');window.location='/Default.aspx';", True)