views:

289

answers:

2

Our customers have asked for Sharepoint and, of course, we are having to implement features for which Sharepoint wasn't really designed. We are first trying to stretch the in-house webparts as far as we can, so we are doing a lot of the work in stored procedures, user defined functions, and custom views in the MSSQL DB.

I am generating html links from fields in the database and wish to display them in something like a Data View web part. Of course, all of the data being displayed is being filtered so that it shows up as unrendered HTML. Is there a way around this?

Alternatively, is there any type of web part that can connect to another webpart or Data source and display unfiltered text/html from that source?

A: 

I get a feeling you’re customizing SharePoint the wrong way. Either that your I don’t really understand the description of your question. I would appreciate a more detailed description of exactly what you are trying to accomplish.

As far as I know you should NEVER touch the SharePoint database directly. I think you should focus on creating lists, field types, WebParts and whatever SharePoint components you might need; instead of messing around in the content database.

SharePoint got a decent development API. It takes some time to learn, but in the end it’s probably worth it.

You can connect your custom made WebParts in SharePoint, here is a sample.

JMD
Ahh, my apologies. We are driving from a lot of data in a separate DB. Yes, we would never WANT to touch the SP db.Say we have a [Foo] table,and a Foo.aspx page, and we can access it "Foo.aspx?FooID=2" to display information about the Foo entry with the given FooID. We have a second table [Bar], and each Bar is associated to a Foo with a FooID foreign key. We want to generate a list of hyperlinks to each Bar page (i.e. /pages/Bar.aspx?BarID=2) that will be rendered as an actual hyperlink.
Corey O.
It is easy enough with a few very short user defined fuctions to have the Bar table query also include extra fields where the Hyperlink itself has already been rendered in proper HTML. Of course, when I try to display the links in those new columns in the Data View, the <a> tags are escaped and all you see is raw HTML
Corey O.
I have seen some pretty funky javascript rendering of charts based on a dataview webpart. Can get pretty cool if you have the time.
Nat
+2  A: 

You need to use the XSLT in the dataview webpart to control the rendering. You have full control over what html is created. disable-output-escaping if necessary.

Nat
Thank you Nat, I believe this solves my immediate problem, and thank you for taking the time to link it. I was able to get my preliminary page to work.
Corey O.
Sweet. w3schools is good, but beware that they do not distinguish between xslt 2.0 and 1.0 calls. SharePoint only supports 1.0
Nat
That is a good distinction to note Nat. As far as I can tell, the "Data View" web part is simply an XSLT container that happens to have access to the dataset of the data connection to which it is connected. If you wanted, you could completely erase any auto-generated XSLT/HTML and create your own, turning this into an all-purpose webpart that can do anything within the XSLT framework.
Corey O.