Feeds:
Posts
Comments

Dundas control is powerful 3rd party tool to develop report using SQL Server Reporting Service.

Microsoft declared that they integrated Dundas Control with SQL Server Reporting Service 2008 but in reality I found that I had to install Dundas control in my SQL Server Report Service 2008 server to make my reports working, which is little disappointing.

Another disappointing thing is, you need to manually setup the configuration files every time you deploy your reports in a new server even after installing Dundas Control.

If you see the following error “The Dundas Chart for Reporting Services report item is unavailable” even after installing Dundas Control for SQL Server reporting Service you need to do the following things to make it working.

1. Modify C:\Program Files\Microsoft SQL Server\MSSQL.x\Reporting Services\ReportServer\rsreportserver.config

2. Modify C:\Program Files\Microsoft SQL Server\MSSQL.x\Reporting Services\ReportServer\rssrvpolicy.config

3. Remember if you use any external dll files for your report you need to add the reference manually too in C:\Program Files\Microsoft SQL Server\MSSQL.x\Reporting Services\ReportServer\rssrvpolicy.config

You will get the config code for all the configuration here http://support2.dundas.com/Default.aspx?article=1107, so just copy paste the configurations in you server’s configuration files and restart the SQL Server Report Service. Hope now your reports with Dundas controls are working now. happy reporting 🙂

I was calling my WCF services from JQuery. Basically I was calling $getJSON to retrieve JSON data to display it in a dynamic table.

I started facing problem with the data sequence. It looked like i was not getting data at the same sequence it is in the class. My class looked like that
[DataContract]
public class MyClass
{
public DateTime Interval { get; set; }
public Double Actual { get; set; }
public String Units { get; set; }

public MyClass(DateTime interval, double actual, string units)
{
this.Interval = interval;
this.Actual = actual;
this.Units = units;
}
}

It was returning data in the order of Actual, Interval, Units.
Looks like it sends data sorting by DataMember Name
To Solve the issue we need to add Order option for every DataMember.
[DataContract]
public class MyClass
{
[DataMember(Order = 0)]
public DateTime Interval { get; set; }
[DataMember(Order = 1)]
public Double Actual { get; set; }
[DataMember(Order = 2)]
public String Units { get; set; }

public MyClass(DateTime interval, double actual, string units)
{
this.Interval = interval;
this.Actual = actual;
this.Units = units;
}
}

By the way it did not solve my problem fully either. I needed to call DataContractSerializer to serialize/sequence/order the data before sending.
public List GetData(string token)
{
List data = null;
foreach (DataRow dr in dt.Rows)
{
MyClass points = new MyClass(param1,param2,param3);
DataContractSerializer contractSerializer = new DataContractSerializer(typeof(MyClass));
data.Add(points);
index++;
}
}

return data;
}

This post describes this too.

Error message is:
Rule “Reporting Services Catalog Database File Existence” failed. The Reporting Services catalog database file exists. Select a Reporting Services files-only mode installation.

Solution: 

This issue occurs because the databases for the SQL Server 2008 Reporting Services instance that you want to install already exist on the computer.
To resolve this issue, move, rename, or delete the existing Report Server databases. Or, use a different instance name here %ProgramFiles%\Microsoft SQL Server\MSSQL10.Instance Name\MSSQL\DATA

Error message is:
The server principal “<username>” is not able to access the database “<database>” under the current security context.
Solution:
That error can happen due to attach a copied database from a different source.  When we attach a copy of database it will have the user account attached from is previous server and created server. If these two SID does not match the error will occur.

The error is:

Rule “Windows Firewall” generated a warning. The Windows Firewall is enabled. Make sure the appropriate ports are open to enable remote access. See the rules documentation at http://go.microsoft.com/fwlink/?LinkId=94001 for information about ports to open for each feature.

Solution:

Turn off firewall or allow ports rules. Follow the link to setup MSSQL 2008 Firewall Rules. (http://www.coverboy.co.kr/plugin/print/?id=263)

I was having trouble to install windows 8 in my dell inspiron n5110.

At the end of the installation is tries to boot up and display black screen.

After googling, I understood that the problem is happening due to the graphics card.  Following steps solved the problem:
1. I connected the computer to another monitor, So the black screen is not coming anymore in the extended monitor.

2. Then update the BIOS, I restart the computer 2-3 times and fixed the problem.
Hope that will help you too.

In my aspx page I have several CheckBoxList and the requirement is client side validation for all the CheckBoxList in the page before page submission.
As CheckListBox do not support Required Validator we need to user Custom Validator for this validation.

Here is the sample of my ASPX code

<div>
<asp:CheckBoxList runat=”server” ID=”chkList1″>
<asp:ListItem Text=”List Item 1_1″ Value=”11″></asp:ListItem>
<asp:ListItem Text=”List Item 1_2″ Value=”12″></asp:ListItem>
</asp:CheckBoxList>

<asp:CustomValidator ID=”validator_chkList1″ ClientValidationFunction=”ValidateCheckList” runat=”server”>*Select at least one item</asp:CustomValidator>

<asp:CheckBoxList runat=”server” ID=”chkList2″>
<asp:ListItem Text=”List Item 2_1″ Value=”21″></asp:ListItem>
<asp:ListItem Text=”Lsit Item 2_2″ Value=”22″></asp:ListItem>
</asp:CheckBoxList>
<asp:CustomValidator ID=”validator_chkList2″ ClientValidationFunction=”ValidateCheckList” runat=”server”>*Select at least one item</asp:CustomValidator>

<asp:Button runat=”server” ID=”btnSubmit” onclick=”btnSubmit_Click” />
</div>

&nbsp;

I used the following javascript to do the validation

function ValidateCheckList(sender, args) {
var chkControlId = sender.id.replace("validator_", "");
alert(chkControlId);
var options = document.getElementById(chkControlId).getElementsByTagName('input');
var ischecked = false;
args.IsValid = false;
for (i = 0; i < options.length; i++) {
var opt = options[i];
if (opt.type == "checkbox") {
if (opt.checked) {
ischecked = true;
args.IsValid = true;
}
}
}
}

Nice and easy trick but it took around two hours for me to figure out, that’s why sharing.
Happy coding. 🙂

are you automating test of a product?

are you sure that the automation is really important or not?

be sure that manual test cost > automated test cost.

How??

easy… just calculate first

manual test cost = manual preparation cost + (N x manual execution cost)

automated test cost = automated test preparation + (N x automated execution cost)

… where N is the number of time test run.

We should use test automation only when it advances the mission of testing.

I needed to download directory from ftp server modify it and uploaded back to server using powershell. At fist i found that [System.Net.WebRequestMethods+Ftp]::UploadFile and [System.Net.WebRequestMethods+Ftp]::DownloadFile works fine and in real life when my zip file size is bigger it does not work.

I have not found any solution to make it working so I used alternative way to solve it. I have written two batch fildes upload.bat and downlaod.bat and calling these batch files from my PS Script to execute.

Actually if anyone use bat file he/she need not to call the bat file from PS Scripts but in my case after downloading zip file from ftp server I modified many things in the files using powershell and then upload it back to server.

Here are the batch files you can try if needed upload.bat and download.bat

to rename a file we use Rename-Item command in powershell the command is very simple

Rename-Item $source $dest -force

But what about changing a folder/directory name? I made mistake to write the same command in case of folder/directory rename and it does not work, shows exception file not found which proves that the command is searching for a file not ready to rename and folder/directory.

After googling for some minutes I found the solution and the command is

Rename-Item -path $destFolder -newName $folderNewName

Example: Rename-Item -path ‘C:\AshrafTest\MyFolder’ -newName ‘MyFolder_New’

By the way the folder should contain some data to be rename. Pretty simple but wasted time to search internet so sharing 🙂