May 25th, 2004 by unclaimed blog
It is supposed to allow me to upload a document into a library of my choice except that the document completely disappeared. The bit I was originally missing is now highlighted in red. I wish the article could have mentioned this, it would have saved me alot of time! The problem was that I was starting off in the root site 'myintranet:8099', and I wanted to access a document library in 'myintranet:8099/sites/it'. Even though I was supplying the GUID it couldnt find the list from the root web, I had to also tell it to move up to the 'sites/it' web before it would find it. Needless to say the documentation does not make this at all clear.
However this still does not explain what happened to the documents that were being reported as being saved OK?!
Now I want to set the value of a custom field (i.e. a Column) in this List, and I'm having trouble doing that too (see my other post). This is not a good week
Here's how it was supposed to work. The web service was registered OK, the client code calls the upload method sending the folder URL, the filename and the binary data, and the web service uses the SPFolder.Files.Add method to create the file. It appeared to do so because it then returns the SPFile.Title, and .TimeCreated properties correctly, however the document completely disappeared into the void and didn't appear in the list (nor in any other list that I could find either)!
Here's (some of) the code:
[WebMethod (UploadDocument)
targetWebsite = SPControl.GetContextWeb(Context).Webs.Item("sites/IT")
Dim folder As SPFolder = targetWebSite.GetFolder(targetFolder)
Dim NewFile As SPFile = folder.Files.Add(fileName, fileContents)
Return NewFile.Title + " created " + NewFile.TimeCreated.ToLongDateString()
]
[Client code:
DialogResult = OpenFileDialogUpload.ShowDialog()
If DialogResult = DialogResult.OK Then
sFilePath = OpenFileDialogUpload.FileName
sFileName = sFilePath.Substring(sFilePath.LastIndexOf("") + 1)
Dim fStream As IO.FileStream = CType(OpenFileDialogUpload.OpenFile, IO.FileStream)
Dim nBytes As Integer = CInt(fStream.Length)
Dim binFile(nBytes) As Byte
' get the file contents into a buffer
Dim nBytesRead As Integer = fStream.Read(binFile, 0, nBytes)
' send the document to sharepoint
Dim spf As New SPFiles.SPFiles
spf.Credentials = System.Net.CredentialCache.DefaultCredentials
MessageBox.Show(spf.UploadDocument(sFileName, binFile, sDestination))
End If
This topic is currently active on a newsgroup thread

Posted in Uncategorized | No Comments »
May 18th, 2004 by unclaimed blog
Currently watching this thread with great interest – I love the new Google Groups
Great work guys, here's one person who's definitely interested in the final solution!
respect to:
Mike Walsh
Bart Waeterschoot
and Ian Morrish
UPDATE: Respect also, of course, to Jim Duncan. Mads Nissen has also now posted his own solution

Posted in Uncategorized | No Comments »
April 13th, 2004 by unclaimed blog
I have been mulling over this for a long time so I thought I'd start a post and see where it went, and I'll keep this up to date (or write an article) if I get somewhere with it. I am the sole developer in an IT team of 5, our other main function therefore is systems admin and support for all IT systems within the office (other than printer maintenance which is out-sourced). I wrote our in-house fault-logging/issue tracking application in ASP.Net but it's lacking some features we need (I was only learning when I worte it!), and I want to do a complete re-write in SharePoint as this seems like a sensible place to host such a solution as we begin to make more and more use of SharePoint.
I like the look of the Issues list in WSS and would like to use it as a simple fault logging system. However 'out of the box' it doesnt have everything we'd need and I'm going to have to extend it somewhat:
For example
- I would prefer the ' Assign to' drop-down list to only list site administrators (or users with some other specific level of permission) rather than every user of the site – or be some other form of custom look-up that could be configured.
- I would prefer the notification email to also be cc' d to the user logging the issue. That way the person to whom the call has been assigned can quickly ' Reply to All' so that everyone involved knows what' s going on. The other (even better) solution to this would be if the system could automatically create an alert for the user logging the issue (and maybe even the person who has been assigned the issue) to be notified of changes to the issue (with maybe a quick link to an opt-out to this alert).
- It would be nice if this could be somehow be linked to tasks, either in a task list in WSS or in Outlook (i.e. the person who has the issue assigned to them also has a new task created for them). I had already written a post on using an issues list and a tasks list connected via two web parts but I saw some limitations with this approach which I outlined, and would need to be resolved.
on Javascript 'listeners' which sounds like just the kind of thing I'm looking for in point (2) but I'm not too sure just yet what Andrew is using these listeners for so I'm going to ask!… more to come…
Update: a while ago I printed off an article by Mark Bower at Microsoft on how to customise the context-menu for list items, but all I can find now is this article which is not quite as friendly but it gives you a starting point. It occurs to me that you could use this for a 'send email to person who logged the fault' function. Not quite as nice as the solution I hoped for in point (2) but better than nothing.
Update2: Mark Bower has since posted about this on his blog. Here's a link to his updated article

Posted in Uncategorized | No Comments »
April 8th, 2004 by unclaimed blog
I had been reading in Bryan Keller's post "How hard is it to write Reporting Services Extensions?"
The documentation for Reporting Services includes a sample, however, that sample does not cover the use of data extensions that handle parameters. This is the only area where it gets confusing. Hopefully we will include a more comprehensive sample in the future.
…but I didnt need to search too far to find Gavin Joyce's post with some sample source code for doing just that.
Now to try it out for myself!

Posted in Uncategorized | No Comments »
April 2nd, 2004 by unclaimed blog
"you can supply parameters at runtime. The Default Value combo box supplies several options, including [QueryString(arg)] and [Form(arg)]. Select [QueryString(arg)] if you will be supplying the parameter at runtime via a querystring item."
However, it wasn't made at all clear how you would do this in practice, I know what forms and querystrings are but at first I couldn't fathom how you are supposed to pass these parameters to the Web Part. Also, it is not clear whether you can use web part connections (i.e. a provider web part on the same page) to supply the parameter to the consumer web part at runtime. I would have thought this is the ideal way to use dataview web parts without needing to do any coding?… so I started to do some digging.
So then I have discovered 'Insert | Form | Form Web Part' in FrontPage which looked promising. I put one onto the page and made a web part connection to my dataview web part with the following settings
Source Web Part: Form Web Part
Source action: Provide Form Values To
Target Web Part: [my dataview web part]
Target action: Modify View Using Parameters From
…and it just works!
NB: After much tearing out of hair I also discovered this article, which states that you need to enable update support before you can used Stored Procs in FrontPage

Posted in Uncategorized | No Comments »