Friday, November 10, 2006

ReportingService vs. ReportingService2005

Two versions of Reporting Service Soap API. Confused me a little bit.
Originally I want to find a method called "ListDependentItems", could not get it in the api I referenced.

then I noticed the schema of soap api head has a timestamp of 2003. I got it in reportingservice2005 version, which soap api head timestamp is 2006/06/30!

once I update my reference from 2003 to 2006 version, a error said "Soap Exception: server can not recognize the head"....like that.

The answer is: rs url sould be http://rptserver/ReportServer/ReportService2005.asmx?wsdl
these two version co-exist on report server.

Thursday, November 09, 2006

XMLDocument.CreateNode

1. NamespaceURI is default required. if no value, the new node will have a attribute xmlns=""

The way to get rid of it is to pass the root namespaceuri of xmldocument to the method of createnode;

2.samething happened on prefix of a node. a xmlns prefix namespaceuri must be passed to the method.

Friday, November 03, 2006

A tiny getting

play with Ajax with XMLHTTP object.
Get an error with "Unkown name",
It's because the URL of webpage includes "localhost".

Another error from Firefox, which is "invalid length".
Solution is simple. replace xmphttpobject.send(null) with send('')

that's it.

Thursday, October 19, 2006

Decode Report Explorer and Report Viewer web part

Shppied with Reporting services, there are two sharepoint web part to explorer&view reports:
Report Explorer and Report Viewer
They are connected web part and a little bit difficult to customize them.
let's say, we just want to use report explorer web part to generate a list of all reports, if one of reports being clicked, we want to make another simple web part,webpart1, to print the link being clicked from report explorer.

simple task, isn't it?

but no. there are some tricks behind the click operation.
1. the webpart1 must has a interfacename "RSWebPartInterface_WPQ_", also being registed as report explorer web part.
2. obviousely, webpart1 should implements ICellConsumer interface.
3. Open the source of html generated by report explorer web part, there is an link attached on the report name, which point to a frame, or iframe,it's ID is like "fmViewerg_cb9ac473_a81c_4f76_bc81_df2e41516c0d", the number follows "fmViewer" is the webpart1's ID!

so, report explorer web part just grab the report manager report list page as its inline iframe!
if the page can not find a ifame whose ID is "fmViewer...", it will open another window to show the report,else make the iframe's src as the report link.

that's it.

T-SQL: Update a table from another table(s)

1.
UPDATE TABLE ASET A.FLD_SUPV = ( SELECT B.FLD_SUPVFROM TABLEA A, TABLEB B, TABLEC C,TABLED DWHERE A.FLD1= B.FLD1AND A.FLD_DT >= B.FLD_FM_DTAND A.FLD_DT <= B.FLD_THRU_DTAND A.FLD_DT > D.FLD_THRU_DTAND A.FLD_DT < fld1=" B.FLD1AND">= B.FLD_FM_DTAND A.FLD_DT <= B.FLD_THRU_DTAND A.FLD_DT > D.FLD_THRU_DTAND A.FLD_DT < C.FLD_EFF_DT )

2.
MERGE INTO TABLEA AUSING (SELECT B.FLD_SUPVFROM TABLEB B, TABLEC C,TABLED DWHERE (A.FLD1= B.FLD1AND A.FLD_DT >= B.FLD_FM_DTAND A.FLD_DT <= B.FLD_THRU_DT)AND A.FLD_DT > D.FLD_THRU_DTAND A.FLD_DT < C.FLD_EFF_DT) AS SON 1=1WHEN MATCHED THENUPDATE SET A.FLD_SUPV = S.FLD_SUPV

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.