In Crystal Report Web Viewer, image button icons do not appear in a new web site other than the Default web site in IIS.

November 5, 2012

Why Can Fail?!

You have created a web based Crystal Report Viewer in the IIS default web site. Everything looks fine. However, when you move it to a different web site under a different application pool, the crystal report viewer button icons all goes missing, becoming red “x”s.

Why Like That?!

This is because the image icons for Crystal Report viewer actually reside in aspnet_client folder, rather than the application directory. It is already included in the default web site, (C:\inetpub\wwwroot\), so the buttons will appear with no issues. If you move it to a different web site without a reference to the aspnet_client directory, the crystal report viewer will be unable to find the images and display red “x”s.

 

What To Do?!

In your newly created web site, create a virtual directory reference called “aspnet_client” and point it to the original folder path (C:\inetpub\wwwroot\aspnet_client), with the same permissions.

Where Got Say?!
The solution is inferred from a few sources, which mentions copying the aspnet_client image files to your application directory. (Not a good idea IMO). Still, credit goes to them for figuring out the cause of the issue.

2 references are stated here
http://www.santry.com/Blog/tabid/90/ID/1153/Deploying-a-Crystal-Reports-Application-to-a-Remote-Server.aspx
http://social.msdn.microsoft.com/Forums/en/vscrystalreports/thread/e2dc93b3-e594-4ae6-ba92-9440ccc7f6be

Import Data from Text file fails in SQL 2005 with error 0xc02020a1

July 20, 2012

Why Can Fail?!

You export some data from a database table as a text file. You run the SQL Server Import and Export Wizard, wanting to import the data into a table with the EXACT SAME STRUCTURE. You go through the steps, click on finish to start running and “Boom!”, SQL Server 2005 hits you with error logs such as these:

Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data conversion for column “Column 1” returned status value 4 and status text “Text was truncated or one or more characters had no match in the target code page.”.
(SQL Server Import and Export Wizard)

Error 0xc020902a: Data Flow Task 1: The “output column “Column 1″ (14)” failed because truncation occurred, and the truncation row disposition on “output column “Column 1″ (14)” specifies failure on truncation. A truncation error occurred on the specified object of the specified component.
(SQL Server Import and Export Wizard)
 

Why Like That?!

This probably has something to with the length of your table columns. Although the source and destination both have a length of e.g. 128.  in the SQL Server Import and Export Wizard they only set the column length into the temp tables they use to length 50  by default. (Huh?) If your data exceeds 50 characters, you will hit that error.

 

What To Do?!

After selecting “Flat File Source” as the Data source, look at the panel called “Advanced” on the left hand side of the wizard. Click on it, then you set manually set the length of the offending column(s) to whatever size you like. The property to change is called “OutputColumnWidth”

 

Where Got Say?!

The answer can be found here.

http://social.msdn.microsoft.com/forums/en-US/sqlintegrationservices/thread/94399ff2-616c-44d5-972d-ca8623c8014e/

Hope this saves you the frustration of  wondering why SQL Server 2005 can’t even import a simple text file properly. 😉

 

Dropdownlist in Updatepanel does not work (play nice) in Sharepoint 2007 webpart

December 21, 2009

Why Can Fail?!

Put a dropdownlist into an AJAX Updatepanel inside a user control to suppress page refreshes during postbacks. Put that user control into a apsx page, works perfectly. Put that same user user control into a Sharepont 2007 webpart, the AJAX UpdatePanel fails to function as expected and we see ugy page refreshes.

Why Like That?!

From Microsoft, it is what they say.

“This issue occurs because both Windows SharePoint Services and ASP.NET AJAX cache some types of form actions. Therefore, conflicts may occur.”

A better explanation from Mike Ammerlaan:

“Windows SharePoint Services JavaScript has a “form onSubmit wrapper” which is used to override the default form action.  This work is put in place to ensure that certain types of URLs, which may contain double byte characters, will fully work across most postback and asynchronous callback scenarios.  However, if your scenarios do not involve double byte character URLs, you may successful disable this workaround and gain the ability to use ASP.NET AJAX UpdatePanels.”

What To Do?!

This is the workaround from the blogs.

Register a client startup script which disables this workaround, in addition to resetting the default form action:

<script type=’text/javascript’>_spOriginalFormAction = document.forms[0].action; _spSuppressFormOnSubmitWrapper=true;</script>
Embed the startupScript into the Page or user control that uses the UpdatePanel. e.g.
private void EnsureUpdatePanelFixups()
{
if (this.Page.Form != null)
{
string formOnSubmitAtt = this.Page.Form.Attributes[“onsubmit”];
if (formOnSubmitAtt == “return _spFormOnSubmitWrapper();”)
{
this.Page.Form.Attributes[“onsubmit”] = “_spFormOnSubmitWrapper();”;
}
}

ScriptManager.RegisterStartupScript(this, typeof(AjaxUpdatePanelPart), “UpdatePanelFixup”, “_spOriginalFormAction = document.forms[0].action; _spSuppressFormOnSubmitWrapper=true;”, true);
}

Where Got Say?!

Information gleamed from these sources:

http://sharepoint.microsoft.com/blogs/mike/Lists/Posts/Post.aspx?ID=3

http://www.marten-online.com/sharepoint/ajax-second-postback-not-working-in-sharepoint-in-updatepanel.html

http://bloggingabout.net/blogs/rick/archive/2008/03/21/dropdownlist-selectedindexchanged-doesn-t-trigger-updatepanel-in-sharepoint-2007-sp1.aspx

Wordy MS explanation:

http://support.microsoft.com/kb/941955

This issue occurs because both Windows SharePoint Services and ASP.NET AJAX cache some types of form actions. Therefore, conflicts may occur.

“window.scrollTo” javascript function does not work in Internet Explorer 6

August 1, 2008

Why Can Fail?!

This is a wierd one. I’m trying to call “window.scrollTo(x,y)” javascript function to scroll my sharepoint webpage to the end. Other than inheriting the sharepoint header, it can be considered a normal aspx page.In IE6, the page refuses to scroll. In Mozilla Firefox, the page scrolls just fine. Figures. :\

Why Like That?!

No idea. This is probably 1 of those javascript bugs in IE6. :\

What To Do?!

Found a workaround on the web. Encase the window.scrollTo method within a setTimeout method, and then it works.

e.g.

setTimeout(‘window.scrollTo(0, 100)’,1);

This works in IE6. 🙂

window.scrollTo(0, 100)

This does not work in IE6. 😦

Where Got Say?!

This is the forum post from I got the workaround.

http://www.velocityreviews.com/forums/t163430-why-is-the-scrolling-function-not-working-with-internet-explorer.html

Cannot add Microsoft XML v6.0 “msxml6.dll” as COM reference in Visual Studio 2008

July 23, 2008

Why Can Fail?!

When adding Microsoft XML v6.0 “msxml6.dll”  as COM reference to my project in Visual Studio 2008. Visual Studio shows a yellow “!” exclamation mark and an error saying “The system cannot find the file specified” even though I tried to

1. Add through COM references
2. Directly point to the file in my “system32” folder
3. Copying the file to my local bin directory and adding the reference there.

I have Microsoft XML versions 2.6, 3.0, 5.0 and 6.0 installed and only v6.0 seems to exhibit this issue. Searched the net for more information but was so for was unable to find any related information regarding this issue.

Why Like That?!

After much frustration, finally found the answer in the registry. Looked for

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TypeLib\{F5078F18-C551-11D3-89B9-0000F81FE221}\6.0

Which was the GUID for MSXML v6.0

There were 2 value under this entry.

“PrimaryInteropAssemblyName”=”Microsoft.SqlServer.msxml6_interop, Version=6.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91”

“PrimaryInteropAssemblyCodeBase”=”D:\\Program Files\\Microsoft SQL Server\\90\\DTS\\Microsoft.SqlServer.msxml6_interop.dll”

It mentions that the Primary Interop Assembly for MSXML6 is already created and it is stored under

“D:\Program Files\Microsoft SQL Server\90\DTS\Microsoft.SqlServer.msxml6_interop.dll”

HOWEVER, the dll is actually stored in

D:\Program Files\Microsoft SQL Server\90\DTS\Binn\ Microsoft.SqlServer.msxml6_interop.dll

So (I am assuming) when VS 2008 tries to add the reference, it skips the compilation by tlbImp.exe since a primary Interop assembly is already registered, tries to look for it in the folder specified in the registry, but fails because it is not there.

I was able to replicate this on my colleague’s machines, so this seems to be a scripting error in SQL 2005 Server installer.  /facepalm

What To Do?!

So, to resolve this issue, you can either

a) correct the path in the registry  to the actual location

“D:\Program Files\Microsoft SQL Server\90\DTS\Binn\ Microsoft.SqlServer.msxml6_interop.dll”

or

b) delete the entry in the registry to force a recompilation every time the reference is added.

Cheers.

Error: The target principal name is incorrect

July 17, 2008

Why Can Fail?!

After <security mode=”Transport”> is set, when my web application tries to call my WCF service, which is residing on a different server, this error pops up.

“The target principal name is incorrect.”

( >_< )

Why Like That?!

Apparently this issue has to do with Kerberos authenication, NTLM, SPN and all those stuff. (welcome any others to give a more accurate definition of “all those stuff”) If the client and service reside on the same server, all works fine as it is using NTLM. On separate servers, Kerberos authenication is used, which fails.

What To Do?!

A workaround is to insert a dummy identity element into the endpoint section of the client config.

<endpoint name=””
address=”
http://localhost:8000/servicemodelsamples/service
binding=”wsHttpBinding”
bindingConfiguration=”Binding1″
contract=”ICalculator” >

<identity>
<servicePrincipalName value=”MYSERVICE/MyMachine”/>
</identity>

</endpoint>
</client>

Ironically, what this does is to force the service to fall back to NTLM authentication after Kerberos authentication using the dummy identity element fails. The service does not fall back to NTLM authentication without a identity element, don’t ask me why…. ( @_@; )

A more concrete solution seems to define the ServicePrincipalName for the assigned username or run the service (or client) under higher privileges. Both of these solutions has yet to be tested. To be investigated further if time permits.

Where Got Clue?!

I got the information from these 2 forum posts.

http://www.bokebb.com/dev/english/2047/posts/204720629.shtml

http://www.bokebb.com/dev/english/2047/posts/204721253.shtml

Why I wrote this blog…

June 24, 2008

1. To say “Hello World!”

2. To clog up the tubes with more junk. (See Ted Stevens)

3. To further stress test the Wayback Machine. (See World’s Biggest Backup)

4. To act “hip” and hop on the “blogging craze”. (and test out WordPress.com) :p

5. To mimic thousands of others and blog about my (mis)adventures with WCF, .NET and other programming stuff. (As if there isn’t already enough out there…:p)

6. To log the problems I faced during my programming, and then curse and swear at them (#$%&/@*?!…)

7. To note down how I resolved the problems , if they are ever resolvable in the first place. ( See (#$%&/@*?!…)

8. To let another fellow hapless programmer, whom just might chance upon this blog while searching for a solution to his/her problems, (see Cure All), and in the highly unlikely scenario,  find some information that just might be useful to him / her.

9. To act as a backup FAQ in case the that fellow hapless programmer happens to be me. AGAIN. (see 8.)

10. To say “Hello World!”

(Oops..Infinite Loop!) :p

Hello world!

May 12, 2008

Hello World! 🙂