Wednesday, September 17, 2008

WebPart Connections getting information from Property page - By Paul Culmsee

Wouldn’t it be great if we could somehow pass the device name (or some other device information) to the report web part automatically.

That way, each time you opened up a device entry, the report would retrieve performance information for the device currently being viewed. That would be very, very cool.

Fortunately for us it can be easily done. The report services web part, like many other web parts is connectable. This means that it can accept information from other web parts. This means that it is possible to have the parameters automatically passed to the report!

Wohoo!

So here is how I am going to do this. I am going to add two new columns to my device list. Each column will be the parameter passed to the report. This way, I can tailor the report being generated on a device by device basis. For example, for a SAN device I might want to report on disk I/O, but a server I might want CPU. If I store the parameter as a column, the report will be able to retrieve whatever performance data I need.

Below shows the device list with the additional two columns added. the columns are called TAGPARAM1 and TAGPARAM2. The next screen below, shows the values I have entered for each column against the device DM01. These values will be passed to the report server report and used to find matching performance data.

image image

So the next question becomes, how do I now transparently pass these two parameters to the report? We now have the report and the parameters on the same page, but no obvious means to pass the value of TagParam1 and TagParam2 to the report viewer web part.

The answer my friends, is to use a filter web part!

Using the toolpane view hack, we once again edit the view item page for the Device List. We now need to add two additional web parts (because we have two parameters). Below is the web part to add.

image

The result should be a screen looking like the figure below

image

Filter web parts are not visible when a page is rendered in the browser. They are instead used to pass data between other web parts. There are various filter web parts that work in different ways. The Page Field filter is capable of passing the value of any column to another web part.

Confused? Check out how I use this web part below…

The screen above shows that the two Page Field filters web parts are not configured. They are prompting you to open the tool pane and configure them. Below is the configuration pane for the page field filter. Can you see how it has enumerated all of the columns for the "IT device" list? In the second and third screen we have chosen TagParam1 for the first page filter and TagParam2 for the second page filter web part.

image image image

Now take a look at the page in edit mode. The page filters now change display to say that they are not connected. All we have done so far is tell the web parts which columns to grab the parameter values from

image

Almost Home - Connecting the filters

So now we need to connect each Page Field filter web part to the report viewer web part. This will have the effect of passing to the report viewer web part, the value of TagParam1 and TagParam2. Since these values change from device to device, the report will display unique data for each device.

To to connect each page filter web part you click the edit dropdown for each page filter. From the list of choices, choose "Connections", and it will expand out to the choice of "Send Filter Values To". If you click on this, you will be promoted to send the filter values to the report viewer web part on the page. Since in my example, the report viewer web part requires two parameters, you will be asked to choose which of the two parameters to send the value to.

image image

Repeat this step for both page filter web parts and something amazing happens, we see a performance report on the devices page!! The filter has passed the values of TagParam1 and tagParam2 to the report and it has retrieved the matching data!

image

Let’s now save this page and view it in all of its glory! Sweet eh!

image

Credit : Paul Culmsee

Link to Original Post : http://www.cleverworkarounds.com/2008/08/09/aint-it-cool-integrating-sharepoint-and-real-time-performance-data-part-2/

Remove "New" icon from newly added Document using JavaScript

Adding JavaScript to a page inside a Content Editor web part can be a great way to perform on-the-fly customizations to your SharePoint sites. This worked great in WSS v2 and SPS 2003. We started noticing that some of those scripts didn’t seem to work in WSS v3 and MOSS 2007, however, and it wasn’t because the names of objects and elements had changed.

For example, here is a JavaScript snippet that we had used to hide the “NEW!” icon on a page in WSS v2.

Note: In all code examples below, replace the square brackets around the SCRIPT tags with angle brackets. If I included the angle brackets, the browser tried to execute the code. :o(
[script language="JavaScript"]
var fields,i;
fields = document.getElementsByTagName('IMG');
for( i = 0; i < fields.length; i ++ ) {
 var imgsrc = fields[i].getAttribute('SRC');
 if(imgsrc.indexOf("new.gif") != -1) {
  fields[i].style.visibility = "hidden";
 }
}
[/script]

When we added this to a Content Editor web part in a WSS v3 page, nothing seemed to happen. I added code to make it run on the onLoad event, and that didn’t work either. I did a little experimentation and discovered that if I added a short delay, even a delay of 1/1000 of a second, it worked fine. I placed the core code within a function and then called it with the setTimeout() method.

[script language="JavaScript"]
setTimeout(HideNewIcons,1);
function HideNewIcons(){
 var fields,i;
 fields = document.getElementsByTagName('IMG');
 for( i = 0; i < fields.length; i ++ ) {
   var imgsrc = fields[i].getAttribute('SRC');
   if(imgsrc.indexOf("new.gif") != -1) {
    fields[i].style.visibility = "hidden";
   }
 }
}
[/script]

The problem occurs because most WSS v3 pages use a master page that contains the “body” element, and the page content code loads after the master page code. I didn’t know it at the time, but recently discovered (thanks to this article on the Microsoft SharePoint Products and Technologies Team Blog) that the SharePoint developers had given us a way to work around that issue—it’s the _spBodyOnLoadFunctionNames array. We can use JavaScript’s “push” method to load items into this array where they will run when the body’s onLoad event fires .

Here is what the JavaScript looks like with the setTimeout replaced with a line that pushes the function name “HideNewIcons” into the _spBodyOnLoadFunctionNames array.

[script language="JavaScript"]
_spBodyOnLoadFunctionNames.push("HideNewIcons");
function HideNewIcons(){
 var fields,i;
 fields = document.getElementsByTagName('IMG');
 for( i = 0; i < fields.length; i ++ ) {
   var imgsrc = fields[i].getAttribute('SRC');
   if(imgsrc.indexOf("new.gif") != -1) {
    fields[i].style.visibility = "hidden";
   }
 }
}
[/script]

If you’ve been having trouble getting some of your legacy JavaScript scripts to run from within Content Editor web parts in WSS v3 or MOSS 2007 pages, give this technique a try, and let me know if it works for you.

Credit : Rickey Spears

Show Quick launch bar in all pages in MOSS including System page

Many times we come across to a situation where you are updating a item in a list or document library Or you are Viewing the item and you want to quickly navigate to any list, then all you need is go back to default.aspx of yor site and then go from there. so question is : how to show quick luanch bar in All pages in Moss site? If we find a way where we can have that quick launch bar visible on eveypage, so that we can navigate to anywhere from anywhere. So here is a trick to go for this : (1)open your master page ( Better to create your own and attaching it with your site collection, otherwise it will affect whole farm setup) And better to take the backup of even your master pages before doing anything in them. (2) Search for the following content : div class="ms-quicklaunchouter"> div class="ms-quickLaunch" style="width:100%"> h3 class="ms-standardheader"> You will find these content in one contentplaceholder. This tag is : asp:ContentPlaceHolder id="PlaceHolderLeftNavBar" runat="server"> /asp:ContentPlaceHolder> So cut all the code inside this start tag and end tag and paste it outside of endtag of that contentplaceholder. That's it. your job is done: See the below figures after applying change : Above figure : EditForm.aspx Above figure : NewForm.aspx Above figure : DispForm.aspx Source: http://www.sharepointkings.com/2008/07/show-quick-launch-bar-in-all-pages-in.html

Make Edit Page option available in list forms like NewForm.aspx, EditForm.aspx and DispForm.aspx

Most common question among SharePoint customization is that
“Why Edit Page option is not available in list forms like NewForm.aspx, EditForm.aspx and DispForm.aspx?”
If we need to edit New/Edit/Display Form of list most of the time we are using SharePoint designer. But here is the one nice trick to achieve this functionality. Just add “&ToolPaneView=2” at the end of the URL and refresh the page. So that you’re URL will be like this.
http://sharepointkings/... /Lists/Demo/NewForm.aspx?RootFolder...&Source=…&ToolPaneView=2 http://sharepointkings/... /Lists/Demo/EditForm.aspx?RootFolder...&Source=…&ToolPaneView=2 http://sharepointkings/... /Lists/Demo/DispForm.aspx?RootFolder...&Source=…&ToolPaneView=2
You can see add webpart tool pan beside this web part.

Just add or remove your webpart and your work is done. Updated :

Let's examine the command: The MSO presumably stands for Microsoft Office, the TlPn (that's a lowercase L not a 1 and unfortunately JavaScript is case sensitive) presumably stands for Tool Pane, and ShowToolPane is the specific method that we are executing. The required ViewID parameter identifies which Tool Pane view to show:

ViewID Tool Pane view to show
-1 Extensible View
0 Close task pane
1 Web Part Properties and Custom ToolParts
2 Add Web Parts – Browse
3 Add Web Parts – Search
4 Navigation (Downlevel only)
5 Add Web Parts – Import
6 Web Part Menu (Downlevel only)
7 Error

RootComponent types in solution.xml file in Dynamics CRM 365/2016

In Microsoft Dynamic CRM 2016/365 are you as confused as me when looking at the solution.xml from the solution export? looking at the xml a...