I'm trying to format a field in a BDC (Business Data Catalog) definition, in SharePoint, with a thousand separator.
It doesn't appear to be possible in the BDC XML definition, and only possible through the SharePoint Designer(!). The fields I've got at present are System.Decimal, so it displays as 12345.98, but I'm wanting it to display as 12,345.98.
Do you know if it can be achieved through the BDC XML Definition ?
<Parameter Direction="Return" Name="#ContactTotals">
<TypeDescriptor TypeName="System.Data.IDataReader, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" IsCollection="true" Name="Reader">
<TypeDescriptors>
<TypeDescriptor TypeName="System.Data.IDataRecord, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Name="Record">
<TypeDescriptors>
<TypeDescriptor TypeName="System.Int32" IdentifierName="dim_claims_key" Name="dim_claims_key" />
<TypeDescriptor TypeName="System.Decimal" Name="total_outstanding" DefaultDisplayName="Total Outstanding (USD)" />
<TypeDescriptor TypeName="System.Decimal" Name="total_paid" DefaultDisplayName="Total Paid (USD)" />
<TypeDescriptor TypeName="System.Decimal" Name="total_incurred" DefaultDisplayName="Total Incurred (USD)" />
</TypeDescriptors>
</TypeDescriptor>
</TypeDescriptors>
</TypeDescriptor>
</Parameter>
</Parameters>
Cheers
Nick
XML is a meta-language not intended to format or present information, it describes and stores other vocabularies. That in mind, the answer is: No, you cannot achieve what you asked using XML only.
A recommended way would be to use the XSLT <xsl:decimal-format /> element in the BDC List View or BDC Item View webpart you are using. If you are consuming the data trough other ways you can easily format the output during rendering.
Say you have this portion of code displaying your decimal type:
<xsl:value-of select="$ColName_0" />
You need to encapsulate it with something like (based on the sample in the link):
<xsl:value-of select="format-number($ColName_0, '#.###,00', 'euro')"/>
You can find the XSLT for the webpart in the Modify Shared WebPart menu, or, as you said, using SharePoint Designer.
Seems possible to define Complex Formatting at TypeDescriptor elements. As I don't have an environment to properly test this solution, following definitions seems to be valid and addresses your particular scenario:
<Parameter Direction="Return" Name="#ContactTotals">
<TypeDescriptor TypeName="System.Data.IDataReader, ..."
IsCollection="true" Name="Reader">
<!-- note this -->
<Properties>
<Property Name="ComplexFormatting"
Type="System.String" />
</Properties>
<TypeDescriptors>
<TypeDescriptor TypeName="System.Data.IDataRecord, ..." Name="Record">
<TypeDescriptors>
<TypeDescriptor TypeName="System.Int32"
IdentifierName="dim_claims_key"
Name="dim_claims_key" />
<TypeDescriptor TypeName="System.Decimal"
Name="total_outstanding"
DefaultDisplayName="Total Outstanding (USD)" />
<!-- note this -->
<Properties>
<Property Name="FormatString"
Type="System.String">{0:#.###,00}</Property>
</Properties>
</TypeDescriptor>
...
</TypeDescriptors>
</TypeDescriptor>
</TypeDescriptors>
</TypeDescriptor>
</Parameter>
</Parameters>
Note as warned in MSDN documentation, "ComplexFormatting is slow". Maybe is better to stick with F.Aquino answer
Related
I have an Excel 2016 taskpane add-in written which worked flawlessly both online and on desktop. However, now that I am trying to convert it into a command add-in, I have stumbled accross a really odd deployment issue concerning this manifest:
<?xml version="1.0" encoding="UTF-8"?>
<!--Created:325c27b6-9566-4641-a1c6-175f0039f620-->
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides"
xsi:type="TaskPaneApp"
>
<!--BasicSettings-->
<Id>bcb30953-453a-4cbb-93c3-f3d289de0ee3</Id>
<Version>1.1.5.6</Version>
<ProviderName>My Corporation</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="MyAddin" />
<Description DefaultValue="My addin's description"/>
<IconUrl DefaultValue="https://i.imgur.com/MPuvMiq.png" />
<HighResolutionIconUrl DefaultValue="https://i.imgur.com/MPuvMiq.png" />
<SupportUrl DefaultValue="https://google.com" />
<!-- http://dev.office.com/reference/add-ins/office-add-in-requirement-sets -->
<Permissions>ReadWriteDocument</Permissions>
<!--EndBasicSettings-->
<!--BeginTaskpaneMode-->
<Hosts>
<Host Name="Workbook" />
</Hosts>
<DefaultSettings>
<SourceLocation DefaultValue="https://odsample.azurewebsites.net/Pages/Home.aspx" />
</DefaultSettings>
<!--EndTaskpaneMode-->
<!--BeginAddinCommandsMode-->
<!-- https://github.com/OfficeDev/Office-Add-in-Commands-Samples/blob/master/Tools/XSD/TaskPaneAppVersionOverridesV1_0.xsd -->
<VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
<Description resid="MyAddin.Description" />
<Hosts>
<Host xsi:type="Workbook">
<DesktopFormFactor>
<GetStarted>
<Title resid="MyAddin.Title"/>
<Description resid="MyAddin.Description"/>
<LearnMoreUrl resid="MyAddin.LearnMore"/>
</GetStarted>
<FunctionFile resid="MyAddin.FunctionFile" />
<ExtensionPoint xsi:type="PrimaryCommandSurface">
<CustomTab id="MyAddin" >
<Group id="MyAddin.Tab1.Group1">
<Label resid="MyAddin.Tab1.Group1.Label" />
<Icon>
<bt:Image size="16" resid="MyAddin.Tab1.Group1.Icon.16" />
<bt:Image size="32" resid="MyAddin.Tab1.Group1.Icon.32" />
<bt:Image size="80" resid="MyAddin.Tab1.Group1.Icon.80" />
</Icon>
<Control xsi:type="Button" id="MyAddin.Tab1.Group1.RunFunctionButton">
<Label resid="MyAddin.Tab1.Group1.RunFunctionButton.Label" />
<Supertip>
<Title resid="MyAddin.Tab1.Group1.RunFunctionButton.Title" />
<Description resid="MyAddin.Tab1.Group1.RunFunctionButton.Description" />
</Supertip>
<Icon>
<bt:Image size="16" resid="MyAddin.Tab1.Group1.RunFunctionButton.Icon.16" />
<bt:Image size="32" resid="MyAddin.Tab1.Group1.RunFunctionButton.Icon.32" />
<bt:Image size="80" resid="MyAddin.Tab1.Group1.RunFunctionButton.Icon.80" />
</Icon>
<Action xsi:type="ExecuteFunction">
<FunctionName>writeText</FunctionName>
</Action>
</Control>
</Group>
<Label resid="MyAddin.Tab1.Label"/><!-- order is important-->
</CustomTab>
</ExtensionPoint>
</DesktopFormFactor>
</Host>
</Hosts>
<Resources>
<bt:Images>
<bt:Image id="MyAddin.Tab1.Group1.Icon.16" DefaultValue="https://i.imgur.com/FkSShX9.png" />
<bt:Image id="MyAddin.Tab1.Group1.Icon.32" DefaultValue="https://i.imgur.com/FkSShX9.png" />
<bt:Image id="MyAddin.Tab1.Group1.Icon.80" DefaultValue="https://i.imgur.com/FkSShX9.png" />
<bt:Image id="MyAddin.Tab1.Group1.RunFunctionButton.Icon.16" DefaultValue="https://i.imgur.com/qDujiX0.png" />
<bt:Image id="MyAddin.Tab1.Group1.RunFunctionButton.Icon.32" DefaultValue="https://i.imgur.com/qDujiX0.png" />
<bt:Image id="MyAddin.Tab1.Group1.RunFunctionButton.Icon.80" DefaultValue="https://i.imgur.com/qDujiX0.png" />
</bt:Images>
<bt:Urls>
<bt:Url id="MyAddin.LearnMore" DefaultValue="https://commandsimple.azurewebsites.net/FunctionFile.html" />
<bt:Url id="MyAddin.FunctionFile" DefaultValue="https://commandsimple.azurewebsites.net/FunctionFile.html" />
</bt:Urls>
<bt:ShortStrings>
<bt:String id="MyAddin.Title" DefaultValue="MyAddin" />
<bt:String id="MyAddin.Tab1.Label" DefaultValue="MyAddin" />
<bt:String id="MyAddin.Tab1.Group1.Label" DefaultValue="Execute Function" />
<bt:String id="MyAddin.Tab1.Group1.RunFunctionButton.Label" DefaultValue="Execute Function" />
<bt:String id="MyAddin.Tab1.Group1.RunFunctionButton.Title" DefaultValue="Execute Function" />
</bt:ShortStrings>
<bt:LongStrings>
<bt:String id="MyAddin.Description" DefaultValue="MyAddin's description" />
<bt:String id="MyAddin.Tab1.Group1.RunFunctionButton.Description" DefaultValue="Click to Execute Function" />
</bt:LongStrings>
</Resources>
</VersionOverrides>
<!--EndAddinCommandsMode-->
</OfficeApp>
, which is mostly based on the official command addin example. This manifest, as it is, can be perfectly imported on Excel Online for testing and shows the expected commands group on the ribbon. However, it fails to be imported on the desktop version of Excel, since no addin at all is shown after clicking on 'Insert'=>'My Addins'=>'Shared folder' (where I store the manifests for testing purposes), which to my current understanding is due to some kind of failed validation.
After long hours of trial and error, I am pretty sure the xml namespaces and schema definitions are to be blamed. However, I am still struggling.
I have checked that if I change <VersionOverrides> to <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.0"> (note the extra trailing /1.0), then I can deploy the manifest both online and on desktop, but then they both fallback to the taskpane version (which as far as I understand is due to the fact of the <VersionOverrides> part being omited because of malformation.
In a similar question, where the problem lay on the declaration of the namespaces being uncompleted, the accepted answer opted for using <OfficeApp xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0> (note the extra /1.0) and`. When using this configuration, I get the add-in to work as expected online (command add-in) but fails to even load on desktop.
Likewise, I am sure this is not a version problem, and thereby this question does not apply, since I am running Version: 16.0.7070.2033, which theoretically meets the requirements.
As I said, I am really struggling to work out how to solve this issue. So, any help will be utterly appreciated (I am so tired I am problably missing something obvious). Thanks
There seems to be a limit on the length of the id attribute that can be used. Sticking to 32-character strings solved the problem for me.
we have submited successfully an Office AddIn in the Office Store.
Through the Requirements in our Manifest our app should be availale in the following Office products:
Word
Excel
Excel Online
Our Office AddIn is NOT listed in Excel Online!?
When we deploy through our internal Sharepoint this works as desired (App in Excel Online, NOT in Word Online ).
The Manifest of our Store-Upload looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!--Created:cb85b80c-f585-40ff-8bfc-12ff4d0e34a9-->
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="TaskPaneApp">
<Id>925fda0f-5c39-49a8-85fe-0e9aad7cb71f</Id>
<Version>2.0.0.0</Version>
<ProviderName>XXX Name</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="DISP-NAME" />
<Description DefaultValue="Bla bla."/>
<IconUrl DefaultValue="URI/Images/app32x32.png" />
<HighResolutionIconUrl DefaultValue="URI/Images/app64x64.png" />
<RequestedWidth>320</RequestedWidth>
<SupportUrl DefaultValue="URL" />
<Hosts>
<Host Name="Document" />
<Host Name="Workbook" />
</Hosts>
<Requirements>
<Sets>
<Set Name="TableBindings" MinVersion="1.1" />
<Set Name="Settings" MinVersion="1.1" />
<Set Name="Selection" MinVersion="1.1" />
<Set Name="TextCoercion" MinVersion="1.1" />
</Sets>
<Methods>
<Method Name="Document.goToByIdAsync"/> <!-- blocks Word Online -->
</Methods>
</Requirements>
<DefaultSettings>
<SourceLocation DefaultValue="URI/Index.html" />
<!--<SourceLocation DefaultValue="~remoteAppUrl/Index.html" />-->
<!--<SourceLocation DefaultValue="~remoteAppUrl/appdirectory-build/Index.html" />-->
</DefaultSettings>
<Permissions>ReadWriteDocument</Permissions>
</OfficeApp>
(Some privat informations are removed in the Manifest)
Any ideas why our Office AddIn is NOT listed in Excel Online by the store!?
as the title says i'm trying get some list items from my sharepoint website into my SSRS 2005 report. I tryed to folow and adapt some tutorials for SSRS 2008 like this one :
http://nikspatel.wordpress.com/2010/04/30/step-by-step-consuming-sharepoint-lists-data-in-the-ssrs-reports/
The thing is that I get stuck int the 6th step when I try to validate my query. I tryed to pass some queries that i post below:
<Query>
<SoapAction>http://schemas.microsoft.com/sharepoint/soap/GetListItems
</SoapAction>
<Method Namespace='http://schemas.microsoft.com/sharepoint/soap/' Name = 'GetListItems'>
<Parameters>
<Parameter Name='listName'>
<DefaultValue>EraDemandes</DefaultValue>
</Parameter>
<Parameter Name='rowLimit'>
<DefaultValue>100</DefaultValue>
</Parameter>
<Parameter Name='query' Type='xml'>
<DefaultValue>
<Query>
<Where>
<Eq>
<FieldRef Name='ID'/>
<Value Type='Integer'>1016</Value>
</Eq>
</Where>
</Query>
</DefaultValue>
</Parameter>
<Parameter Name='viewFields' Type='xml'>
<DefaultValue>
<ViewFields>
<FieldRef Name='Title' />
<FieldRef Name='ID' />
</ViewFields>
</DefaultValue>
</Parameter>
<Parameter Name='queryOptions' Type='xml'>
<DefaultValue>
<QueryOptions>
<IncludeMandatoryColumns>FALSE</IncludeMandatoryColumns>
<DateInUtc>TRUE</DateInUtc>
</QueryOptions>
</DefaultValue>
</Parameter>
</Parameters>
</Method>
<ElementPath IgnoreNamespaces='True'>*</ElementPath>
</Query>
<Query>
<SoapAction>http://schemas.microsoft.com/sharepoint/soap/GetListItems</SoapAction>
<Method Namespace="http://schemas.microsoft.com/sharepoint/soap/" Name="GetListItems">
<Parameters>
<Parameter Name="listName">
<DefaultValue>Liste des Demandes</DefaultValue>
</Parameter>
</Parameters>
</Method>
<ElementPath IgnoreNamespaces="True">*</ElementPath>
</Query>
I tryed to remove / modify all the parameters without succes. I'm realy not familiar with SSRS so plz go on and ask every question you need.
I have few question myself:
On the 2 queries i used 2 differents name for the list: "EraDemandes" is the name I got in my URL when i'm accessing my list through sharepoint and "Liste des Demandes" is the name of the list in Sharepoint. I beleive that in sharepoint there is 2 name, a display name and a sharepoint name. Which one should i use ?
My root Sharepoint Site collection is 'http://m-epderaqua/default.aspx' and the list I want to casses are on all the subsites from this collection (http://m-epderaqua/ERA73/default.aspx or http://m-epderaqua/ERA38/default.aspx). Which web address should I use in my datasource ? Should i use many datasource (like one for each subsites) ?
Help plz.
I can't tell why but it's just working perfectly fine right now. I suppose the maintenance team did somthing during the week-end but I don't know what...
it is a big question since long time and now I am facing it....
I have to add list view web part through CAML to publish page.
I have used the code:
<View List="0GeneralInformationandReports" RowLimit="5" FreeForm="TRUE"
BaseViewID="0"
RecurrenceRowset="TRUE"
WebPartZoneID="bottomLeft_LeftZone"
WebPartOrder="1">
<![CDATA[
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="Microsoft.SharePoint.WebPartPages.XsltListViewWebPart,Microsoft.SharePoint,Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="Title">0 - General Information and Reports</property>
<property name="AllowConnect" type="bool">True</property>
<property name="AllowClose" type="bool">False</property>
<property name="Height" type="unit">215px</property>
</properties>
</data>
</webPart>
</webParts>
]]>
</View>
and it is rendering fine with the list view on the page. But i have to add more control to the web part like show only limited columns and top 5 modified by date ascending. This is not working using the tag as there are no other ways I can add sorting, view fields etc...
please help.
I have tried that and still it is not working. This is my list view in schema.xml.
<View DisplayName="" BaseViewID="0" Type="HTML" MobileView="TRUE" ImageUrl="/_layouts/images/dlicon.png" Hidden="TRUE" XslLink="main.xsl"
WebPartZoneID="bottomLeft_LeftZone" WebPartOrder="0">
<XslLink>main.xsl</XslLink>
<Query />
<ViewFields>
<FieldRef Name="DocIcon" />
<FieldRef Name="LinkFilenameNoMenu" />
</ViewFields>
<RowLimit>5</RowLimit>
<Aggregations Value="Off" />
</View>
</Views>
Still it is showing the same fields... No ideas how to get to it... I have referenced BaseView="0" in the of my elements.xml. Still no luck.
To do that, you'll probably have to define a new View in your List Definition, and then use BaseViewID to specify the new view by that ID.
I'm trying to retrieve files from sharepoint via SSRS and an XML Datasource.
This is what I'm currently using:
<Query>
<SoapAction>http://schemas.microsoft.com/sharepoint/soap/GetListItems</SoapAction>
<Method Namespace="http://schemas.microsoft.com/sharepoint/soap/" Name="GetListItems">
<Parameters>
<Parameter Name="listName">
<DefaultValue>account</DefaultValue>
</Parameter>
<Parameter Name="queryOptions" Type="xml">
<DefaultValue>
<QueryOptions>
<Folder>account/testfolder</Folder>
</QueryOptions>
</DefaultValue>
</Parameter>
</Parameters>
</Method>
</Query>
I can retrieve all of the files from the testfolder located under account (that's good!) however. If I create a query like this:
<Query>
<SoapAction>http://schemas.microsoft.com/sharepoint/soap/GetListItems</SoapAction>
<Method Namespace="http://schemas.microsoft.com/sharepoint/soap/" Name="GetListItems">
<Parameters>
<Parameter Name="listName">
<DefaultValue>Invoice City</DefaultValue>
</Parameter>
<Parameter Name="queryOptions" Type="xml">
<DefaultValue>
<QueryOptions>
<Folder>Invoice City/testfolder</Folder>
</QueryOptions>
</DefaultValue>
</Parameter>
</Parameters>
</Method>
</Query>
The second that I add the space in the library name (Invoice City) it just returned everything in the Invoice City library (folders and files).
I would just make the folder name without spaces but I'm using CRM Documents and it auto creates folders as the entity name (Invoice City).
I've tried putting the folder name in quotes, and a billion other tries of escape characters and other things. I would expect this to work as the web service is just expecting a string.
Has anyone else ran into this issue? Help is greatly appreciated.
Figured out the problem! It didn't have anything to do with spaces in the end (though I thought it might have been).
I was using the library name instead of the path name.. So for the fix:
<Parameter Name="queryOptions" Type="xml">
<DefaultValue>
<QueryOptions>
<Folder>**new_invoicecity**/testfolder</Folder>
</QueryOptions>
</DefaultValue>
</Parameter>