Jump to content

 

BigE

Member Since 03 Dec 2009
Offline Last Active Feb 19 2010 05:26 PM
-----

Posts I've Made

In Topic: Sum a SharePoint list and display in a chart

17 December 2009 - 03:18 AM

Unfortunately that did not work. Right now my chart is displaying the overall accuracy for both 1st and 2nd as the same value and it should be a different value for each shift. I understand about the filter which is what I would like to do for the shifts. I also would like to be able to group the data by month. I was searching for something today and came across this post: http://www.xml.com/p...3/11/05/tr.html regarding grouping data.

It may be that how I am trying to render the data will not let me do this. As I stated earlier, I followed the steps found here to display my data: http://planetparker....Post.aspx?ID=43

Thanks so much for your help on this. You have opened my eyes to how things work and I really do appreciate it.

Eric

In Topic: Sum a SharePoint list and display in a chart

15 December 2009 - 02:11 PM

That seems to be what I am looking for. What I would like to see is one chart that shows the overall accuracy for both 1st and 2nd shift. Maybe a stacked column of the two dataseries or a side by side column.

In Topic: Sum a SharePoint list and display in a chart

14 December 2009 - 09:39 PM

Daniel,

Thanks for taking the time to look in to this for me. I was able to finally show a value. I had to change the value of select statement to this to make it show the value:
"format-number(100-(sum(/dsQueryResponse/Rows/Row/@Reject_x0020_Qty) div sum(/dsQueryResponse/Rows/Row/@Sample_x0020_Qty)), '#,##0.00;-#,##0.00')" />
.

I didn't know how to setup a web part to use the code that you provided. I have been following the steps listed here: http://planetparker....Post.aspx?ID=43 . The rest of the time we just use the Smart Tools for sharepoint.

If you happen to know how to group data that would be greatly appreciated. Other than that, I just wanted to say thanks again for helping me out with this.

Eric

In Topic: Sum a SharePoint list and display in a chart

11 December 2009 - 02:58 PM

Here is my code for the list. To explain further, I have a calculated column that is providing a percentage of two other columns. =(1-([Reject Qty.]/[Sample Qty.])) . Then, I created another calculated column to mimic the autosum function in excel to give me a combined percentage of the first calculated column. Here is the formula for this one: =SUM([Calculated Accuracy 2])/COUNT([Calculated Accuracy 2]) . This of course does not work.

My goal is to have an overall accuracy to display in one chart for 1st and 2nd shift. I would like to be able to include the month if possible. Here is my code.

------------------------------------

<%-- _lcid="1033" _version="12.0.4518" _dal="1" --%>
<%-- _LocalBinding --%>
<%@ Page language="C#" MasterPageFile="~masterurl/default.master"    Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" meta:webpartpageexpansion="full" meta:progid="SharePoint.WebPartPage.Document" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<asp:Content ContentPlaceHolderId="PlaceHolderPageTitle" runat="server">
	<SharePoint:ListProperty Property="Title" runat="server"/> - 
	<SharePoint:ListItemProperty Property="BaseName" MaxLength=40 runat="server"/>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderPageTitleInTitleArea" runat="server">
	<WebPartPages:WebPartZone runat="server" Title="loc:TitleBar" ID="TitleBar" AllowLayoutChange="false" AllowPersonalization="false"><ZoneTemplate>
	<WebPartPages:TitleBarWebPart runat="server" ZoneID="TitleBar" PartImageLarge="" MissingAssembly="Cannot import this Web Part." IsIncluded="True" Description="" PartOrder="1" AllowHide="True" ChromeType="None" AllowMinimize="False" Image="/_layouts/images/wpicon.gif" HeaderTitle="CalculatedCode" DetailLink="" PartImageSmall="" FrameState="Normal" AllowRemove="False" ExportMode="All" AllowConnect="True" IsVisible="True" FrameType="None" AllowClose="False" HelpLink="" IsIncludedFilter="" HelpMode="Modeless" ConnectionID="00000000-0000-0000-0000-000000000000" AllowZoneChange="True" ID="g_62e3373c_51a1_4243_8c8d_ffba6978651b" Title="Web Part Page Title Bar" ExportControlledProperties="True" SuppressWebPartChrome="False" Dir="Default" AllowEdit="True" __MarkupType="vsattributemarkup" __WebPartId="{62E3373C-51A1-4243-8C8D-FFBA6978651B}" WebPart="true" Height="" Width=""></WebPartPages:TitleBarWebPart>

</ZoneTemplate></WebPartPages:WebPartZone>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderTitleAreaClass" runat="server">
	<style type="text/css">
	Div.ms-titleareaframe {
	height: 100%;
	}
	.ms-pagetitleareaframe table {
	background: none;
	}
  </style>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderAdditionalPageHead" runat="server">
	<META Name="GENERATOR" Content="Microsoft SharePoint">
	<META Name="ProgId" Content="SharePoint.WebPartPage.Document">
	<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
	<META Name="CollaborationServer" Content="SharePoint Team Web Site">
	<script>
	var navBarHelpOverrideKey = "wssmain";
	</script>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderSearchArea" runat="server">
	<SharePoint:DelegateControl runat="server"
		ControlId="SmallSearchInputBox"/>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderLeftActions" runat="server">
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderPageDescription" runat="server">
	<SharePoint:ProjectProperty Property="Description" runat="server"/>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderBodyRightMargin" runat="server">
	<div height=100% class="ms-pagemargin"><IMG SRC="/_layouts/images/blank.gif" width=10 height=1 alt=""></div>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderPageImage" runat="server"></asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderLeftNavBar" runat="server"></asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderNavSpacer" runat="server"></asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
		<table cellpadding="4" cellspacing="0" border="0" width="100%">
				<tr>
					<td id="_invisibleIfEmpty" name="_invisibleIfEmpty" valign="top" width="100%"> 
					<WebPartPages:WebPartZone runat="server" Title="loc:FullPage" ID="FullPage" FrameType="TitleBarOnly"><ZoneTemplate>
					<WebPartPages:DataFormWebPart runat="server" IsIncluded="True" NoDefaultStyle="TRUE" ViewFlag="0" Title="PPM Accuracy Report" __markuptype="vsattributemarkup" partorder="1" __WebPartId="{BB29659B-3D22-41EC-A48D-1A8A43A6A76C}" id="g_bb29659b_3d22_41ec_a48d_1a8a43a6a76c" pagesize="10">
	<DataSources><SharePoint:SPDataSource runat="server" DataSourceMode="List" UseInternalName="true" selectcommand="&lt;View&gt;&lt;/View&gt;" id="dataformwebpart2"><SelectParameters><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{504DABC6-35CD-4384-9444-41FCDDFFDD29}"/><asp:Parameter Name="StartRowIndex" DefaultValue="0"/><asp:Parameter Name="nextpagedata" DefaultValue="0"/><asp:Parameter Name="MaximumRows" DefaultValue="10"/></SelectParameters><DeleteParameters><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{504DABC6-35CD-4384-9444-41FCDDFFDD29}"/></DeleteParameters><UpdateParameters><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{504DABC6-35CD-4384-9444-41FCDDFFDD29}"/></UpdateParameters><InsertParameters><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{504DABC6-35CD-4384-9444-41FCDDFFDD29}"/></InsertParameters></SharePoint:SPDataSource></DataSources>
	
	<datafields>@Title,Title;@Location,Location;@Select_x0020_Shift,Select Shift;@Component0,Component;@Defect0,Defect;@Sample_x0020_Qty_x002e_,Sample Qty.;@Reject_x0020_Qty_x002e_,Reject Qty.;@Date,Date;@Calculated_x0020_Month,Month;@Calculated_x0020_PPM,Calculated PPM;@Calc_x002e_MM,Calc.MM;@Calculated_x0020_Accuracy,Calculated Accuracy;@Calculated_x0020_Accuracy_x0020_,Calculated Accuracy 2;@ID,ID;@ContentType,Content Type;@Modified,Modified;@Created,Created;@Author,Created By;@Editor,Modified By;@_UIVersionString,Version;@Attachments,Attachments;@File_x0020_Type,File Type;@FileLeafRef,Name (for use in forms);@FileDirRef,Path;@FSObjType,Item Type;@_HasCopyDestinations,Has Copy Destinations;@_CopySource,Copy Source;@ContentTypeId,Content Type ID;@_ModerationStatus,Approval Status;@_UIVersion,UI Version;@Created_x0020_Date,Created;@FileRef,URL Path;</datafields>
	<XSL><xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal">
	<xsl:output method="html" indent="no"/>
	<xsl:decimal-format NaN=""/>
		<xsl:param name="dvt_apos">'</xsl:param>
		<xsl:param name="dvt_firstrow">1</xsl:param>
		<xsl:param name="dvt_nextpagedata" />
		<xsl:variable name="dvt_1_automode">0</xsl:variable>
								
		<xsl:template match="/">
		<xsl:call-template name="dvt_1"/>
	</xsl:template>
		<xsl:template name="dvt_1">
		<xsl:variable name="dvt_StyleName">Table</xsl:variable>
		<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row"/>
		<xsl:variable name="dvt_RowCount" select="count($Rows)" />
		<xsl:variable name="RowLimit" select="10" />
		<xsl:variable name="FirstRow" select="$dvt_firstrow" />
		<xsl:variable name="LastRow" select="$FirstRow + $dvt_RowCount - 1" />
		<xsl:variable name="IsEmpty" select="$dvt_RowCount = 0" />
		<table border="0" width="100%" cellpadding="2" cellspacing="0">
			<tr valign="top">
				<xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
				<th class="ms-vh" width="1%" nowrap="nowrap"></th>
				</xsl:if>
				<th class="ms-vh" nowrap="nowrap">Title</th>
				<th class="ms-vh" nowrap="nowrap">Location</th>
				<th class="ms-vh" nowrap="nowrap">Select Shift</th>
				<th class="ms-vh" nowrap="nowrap">Component</th>
				<th class="ms-vh" nowrap="nowrap">Defect</th>
				<th class="ms-vh" nowrap="nowrap">Sample Qty.</th>
				<th class="ms-vh" nowrap="nowrap">Reject Qty.</th>
				<th class="ms-vh" nowrap="nowrap">Month</th>
				<th class="ms-vh" nowrap="nowrap">Calculated Accuracy</th>
				<th class="ms-vh" nowrap="nowrap">Calculated Accuracy 2</th>
			</tr>
		<xsl:call-template name="dvt_1.body">
																				<xsl:with-param name="Rows" select="$Rows"/>
																				<xsl:with-param name="FirstRow" select="1" />
																				<xsl:with-param name="LastRow" select="$dvt_RowCount" />
		</xsl:call-template>
		</table>
		<xsl:call-template name="dvt_1.commandfooter">
		<xsl:with-param name="FirstRow" select="$FirstRow" />
		<xsl:with-param name="LastRow" select="$LastRow" />												<xsl:with-param name="RowLimit" select="$RowLimit" />												<xsl:with-param name="dvt_RowCount" select="$dvt_RowCount" />
		<xsl:with-param name="RealLastRow" select="number(ddwrt:NameChanged('',-100))" />
	</xsl:call-template>
	</xsl:template>
		<xsl:template name="dvt_1.body">
		<xsl:param name="Rows"/>
		<xsl:param name="FirstRow" />
		<xsl:param name="LastRow" />
		<xsl:for-each select="$Rows">
		<xsl:variable name="dvt_KeepItemsTogether" select="false()" />
		<xsl:variable name="dvt_HideGroupDetail" select="false()" />
	<xsl:if test="(position() &gt;= $FirstRow and position() &lt;= $LastRow) or $dvt_KeepItemsTogether">
																			<xsl:if test="not($dvt_HideGroupDetail)" ddwrt:cf_ignore="1">
																			<xsl:call-template name="dvt_1.rowview" />
																			</xsl:if>
	</xsl:if>
	</xsl:for-each>
	</xsl:template>
	<xsl:template name="dvt_1.rowview">
		<tr>
		<xsl:if test="position() mod 2 = 1">
		<xsl:attribute name="class">ms-alternating</xsl:attribute>
		</xsl:if>
		<xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
			<td class="ms-vb" width="1%" nowrap="nowrap">
			<span ddwrt:amkeyfield="ID" ddwrt:amkeyvalue="ddwrt:EscapeDelims(string(@ID))" ddwrt:ammode="view"></span>
			</td>
			</xsl:if>
			<td class="ms-vb">
				<xsl:value-of select="@Title"/>
			</td>
			<td class="ms-vb">
				<xsl:value-of select="@Location"/>
			</td>
			<td class="ms-vb">
				<xsl:value-of select="@Select_x0020_Shift"/>
			</td>
			<td class="ms-vb">
				<xsl:value-of select="@Component0"/>
			</td>
			<td class="ms-vb">
				<xsl:value-of select="@Defect0"/>
			</td>
			<td class="ms-vb">
				<xsl:value-of select="format-number(@Sample_x0020_Qty_x002e_, '#,##0.00;-#,##0.00')"/>
			</td>
			<td class="ms-vb">
				<xsl:value-of select="format-number(@Reject_x0020_Qty_x002e_, '#,##0.00;-#,##0.00')"/>
			</td>
			<td class="ms-vb">
				<xsl:value-of select="@Calculated_x0020_Month"/>
			</td>
			<td class="ms-vb">
				<xsl:value-of select="format-number(@Calculated_x0020_Accuracy, '#,##0.00;-#,##0.00')"/>
			</td>
			<td class="ms-vb">
				<xsl:value-of select="format-number(@Calculated_x0020_Accuracy_x0020_, '#,##0.00;-#,##0.00')"/>
			</td>
		</tr>
	</xsl:template>
		<xsl:template name="dvt_1.commandfooter">
		<xsl:param name="FirstRow" />
		<xsl:param name="LastRow" />
		<xsl:param name="RowLimit" />
		<xsl:param name="dvt_RowCount" />
		<xsl:param name="RealLastRow" />
		<table cellspacing="0" cellpadding="4" border="0" width="100%">
			<tr>
		<xsl:if test="$FirstRow &gt; 1 or $dvt_nextpagedata">
		<xsl:call-template name="dvt_1.navigation">
		<xsl:with-param name="FirstRow" select="$FirstRow" />
		<xsl:with-param name="LastRow" select="$LastRow" />
		<xsl:with-param name="RowLimit" select="$RowLimit" />
		<xsl:with-param name="dvt_RowCount" select="$dvt_RowCount" />
		<xsl:with-param name="RealLastRow" select="$RealLastRow" />
		</xsl:call-template>
		</xsl:if>
		</tr>
		</table>
		</xsl:template>
		<xsl:template name="dvt_1.navigation">
		<xsl:param name="FirstRow" />
		<xsl:param name="LastRow" />
		<xsl:param name="RowLimit" />
		<xsl:param name="dvt_RowCount" />
		<xsl:param name="RealLastRow" />
		<xsl:variable name="PrevRow">
		<xsl:choose>
																				<xsl:when test="$FirstRow - $RowLimit &lt; 1">1</xsl:when>
																				<xsl:otherwise>
		<xsl:value-of select="$FirstRow - $RowLimit" />
		</xsl:otherwise>
		</xsl:choose>
		</xsl:variable>
		<xsl:variable name="LastRowValue">
		<xsl:choose>
																				<xsl:when test="$LastRow &gt; $RealLastRow">
		<xsl:value-of select="$LastRow"></xsl:value-of>
		</xsl:when>
																				<xsl:otherwise>
		<xsl:value-of select="$RealLastRow"></xsl:value-of>
		</xsl:otherwise>
		</xsl:choose>
		</xsl:variable>
		<xsl:variable name="NextRow">
		<xsl:value-of select="$LastRowValue + 1"></xsl:value-of>
		</xsl:variable>
		<td nowrap="nowrap" class="ms-paging" align="right">
		<xsl:if test="$dvt_firstrow &gt; 1" ddwrt:cf_ignore="1">
		<a>
																		<xsl:attribute name="href">javascript: <xsl:value-of select="ddwrt:GenFireServerEvent('dvt_firstrow={1};dvt_startposition={}')" />;</xsl:attribute>
																		Start</a>
																		<xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
		<a>
		<xsl:attribute name="href">javascript: history.back();</xsl:attribute>
		<img src="/_layouts/images/prev.gif" border="0" alt="Previous" />
		</a>
																		<xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
		</xsl:if>
		<xsl:value-of select="$FirstRow" />
		 - <xsl:value-of select="$LastRowValue" />
		<xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
		<xsl:if test="$LastRowValue &lt; $dvt_RowCount or string-length($dvt_nextpagedata)!=0" ddwrt:cf_ignore="1">
				<a>
																		<xsl:attribute name="href">javascript: <xsl:value-of select="ddwrt:GenFireServerEvent(concat('dvt_firstrow={',$NextRow,'};dvt_startposition={',$dvt_nextpagedata,'}'))" />;</xsl:attribute>
		<img src="/_layouts/images/next.gif" border="0" alt="Next" />
		</a>
			</xsl:if>
		</td>
		</xsl:template>
		</xsl:stylesheet></XSL>
<parameterbindings>
		<ParameterBinding Name="ListID" Location="None" DefaultValue="{504DABC6-35CD-4384-9444-41FCDDFFDD29}"/>
			<ParameterBinding Name="dvt_apos" Location="Postback;Connection"/>
			<ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
			<ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/>
			<ParameterBinding Name="dvt_startposition" Location="Postback" DefaultValue=""/>
			<ParameterBinding Name="dvt_firstrow" Location="Postback;Connection"/>
			<ParameterBinding Name="dvt_nextpagedata" Location="Postback;Connection"/>
			</parameterbindings></WebPartPages:DataFormWebPart></ZoneTemplate></WebPartPages:WebPartZone> </td>
			</tr>
		<script language="javascript">if(typeof(MSOLayout_MakeInvisibleIfEmpty) == "function") {MSOLayout_MakeInvisibleIfEmpty();}</script>
		</table>
</asp:Content>

In Topic: SmartTools Sharepoint Display Stacked Columns

03 December 2009 - 07:13 PM

Nevermind. I found out what I was doing wrong. I found this site that contained one piece on information that I did not know about.

"Copy the VisiFire.xap and .js files into the document library that will hold your web part page."

This was preventing my charts from populating data. It now works. Thanks for this great post. It was very helpful!