Thursday, September 21, 2006

asp.net session has expired

when using report viewer web control in a sharepoint web part and view it using IE6. if open it with firefox, it works fine

A simple reason might be the report server name has a dash("_") in it. like http://local_server/ReportServer
this won't work.

try to use IP or change the server name.

as for others deep reason, waiting for the VS2005 SP1.

Friday, September 15, 2006

Reporting Services 2005: Report Image missed

If a report generated by URL like:
http://local_host/reportserver?/myreportpath/myreport&rs:Command=render

open this page from IE, if the report has some images inside, they might lost.

if check the image property, the image url might be:
http://local_host/reportserver/Reserved.ReportViewerWebControl.axd?ExecutionID=rfya3z2fwdlbzfvwudmikfq1&ControlID=158feba3-730b-4235-9caf-32219d427036&Culture=1033&UICulture=9&ReportStack=1&OpType=ReportImage&StreamID=78ce3977-0e12-4cf3-a731-ef643359c355

but if you open it in FireFox, it will show there!

here is the solution:
open report server database, fird the table of configurationinfo, change enablesessioncookie to false.

the resaon is if the server name include a "-" or "_", IE session will not contain it properly.

it works!

Tuesday, September 12, 2006

web part debugging

hard to trace/debug web part step by step?
here is a great tool for that:
http://dotnetjunkies.com/WebLog/victorv/archive/2005/11/08/133629.aspx

Thursday, September 07, 2006

webresource.axd

if there is a treeview created for a web part by visual studio 2005, the node icon might not be there.

Reason/Solution:
(from Jan Tielens, http://weblogs.asp.net/jan/archive/2005/11/24/431425.aspx)

Many of the default ASP.NET 2.0 controls use this feature to store scripts and images, a good example is the TreeView control. If you want to use the same technique in SharePoint

The problem is that the ISAPI filter of SharePoint will try to process the request to WebResource.axd, so you won’t be able to retrieve any resources.

To prevent that the ISAPI filter will try to process the requests to WebResource.axd, you have to exclude it as a managed path. On your SharePoint server, open up the SharePoint Central Administration site from the Administrative Tools start menu group and click the “Configure virtual server settings” link. On the next page you will see a list of all your virtual servers, click on the one that you would like to configure (you have to repeat the steps for each virtual server). Next, click the “Define managed paths” link. In the “Add a New Path” section, fill out WebResource.axd as the name of the path, for the type select “Exclude path”. Finally click the OK button. Now you can use WebResource in SharePoint sites!

Wednesday, September 06, 2006

create sharepoint webpart(wss2) with vs2005

1. Create a class library;
2. Reference microsoft.sharepoint.dll;
3. Inherits the Microsoft.SharePoint.WebPartPages.WebPart;
4. compile->dll;
5. copy dll to sharepoint server root \bin or GAC;
6. add safecontrol to web.config of sharepoint server root;
7. browse ../_layouts/1033/newdwp.aspx to populate the webpart;

Note:
1. Enviroment: Windows Sharepoint service 2.0, sharepoint web server running on .net framework 2.0 (as for upgrade or downgrade to ver1.1, http://support.microsoft.com/kb/894903)

2. about "Name apears to be ..": check the web.config: trust level=..., set to "Full" for test.

3. About local machine debug, download windows work flow and vs2005 extension. can attach the instance to the workflow with w3wp.

4.about reference others dll, drag them into GAC for test usage.

5.Basiclly, it's hard to debug the custom web part(if it's developed by a class libraty instead of web controls). there are some simple tips for debugging the web part. if there is a win2003 server with VS 2005/2003 and sql server integrated, you are lucky. mostly,there is a virtual server for development and test use only. a small tip, compile your assembly into the virtual server directly, so you do not need copy/paste them every time which take your long time. another small thing, if you have try...catch...end try for exception handler(you would better have it !) , it's better to have a small label control added in the catch cluse, so you could get the exception message shown.