I am developing a web application using asp.net c# and drawing graphs using FusionCharts. I need to draw a multi-series column chart for which i tries the following code, but in vain
<div id="chartContainer"></div>
<script type="text/javascript">
var myChart = new FusionCharts("Column3D", "myChartId", "400", "300");
myChart.setXMLUrl("Data8.xml");
myChart.render("chartContainer");
</script>
Data8.xml
----------
<chart caption='Sales by Product' numberPrefix='$' formatNumberScale='1' rotateValues='1' placeValuesInside='1' decimals='0' ><categories>
<category label='Product A' />
<category label='Product B' />
<category label='Product C' />
<category label='Product D' />
<category label='Product E' />
<category label='Product F' />
</categories><dataset seriesName='Current Year'>
<set value='567500' />
<set value='815300' />
<set value='556800' />
<set value='734500' />
<set value='676800' />
<set value='648500' />
</dataset><dataset seriesName='Previous Year'>
<set value='547300' />
<set value='584500' />
<set value='754000' />
<set value='456300' />
<set value='754500' />
<set value='437600' />
</dataset></chart>
Please help me to do this...
Try to modify:
var myChart = new FusionCharts("Column3D", "myChartId", "400", "300");
With:
var myChart = new FusionCharts("MSColumn3D", "myChartId", "400", "300");
Column3D is for a single serie, and MSColumn3D is for Multi-series.
Related
I am trying to pull the attribute values for each of the element, that is in this XMl Schema file(XML below). I want the attribute values for the following: type, label, CompTypes, readonly, hidden, and required.
For example, here is one of the elements in the XML file:
<element type="xpowercomponent_FeaturedTiles" UID="40204fc9b5424b349e03134d777d29bc" label="Featured Tiles" readonly="false" hidden="false" default="" required="false" Component="" CompTypes="ThemedTileSetComponent;ThemedTileSetElectedComponent;" AutoEmbed="" WrappedUp="" AllowWrappingChange="" />
The expected result for this element should be:
xpowercomponent_FeaturedTiles, Featured Tiles, ThemedTileSetComponent,
ThemedTileSetElectedComponent, readonly="false", hidden="false",
required="false"
I have started a C# app to get this information, however it is not getting all the information properly. Could you please take a look at the code, and see how this can be fixed or improved? Is there a better way of approaching this, maybe LINQ? The ultimate goal is to then output these attribute values/data in a CSV file.
C#
class Program
{
static void Main(string[] args)
{
Parse();
}
public static void Parse()
{
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(#"D:\New Text Document.xml");
var captureElements = new List<CustomElements>();
var xdocument = xmlDoc.ToXDocument();
foreach (var element in xdocument.Elements())
{
foreach (var node in element.Elements()) //childs...
{
if (node.Name.LocalName.Equals("ElementType"))
{
foreach (var scopeNode in node.Elements())
{
if (scopeNode.Name.LocalName.Equals("element"))
{
var xml = XElement.Parse(scopeNode.ToString());
var customElement = new CustomElements();
customElement.Type = xml.Attribute("type")?.Value;
customElement.Label = xml.Attribute("label")?.Value;
customElement.CompTypes = xml.Attribute("CompTypes")?.Value;
customElement.Readonly = xml.Attribute("readonly")?.Value;
customElement.Hidden = xml.Attribute("hidden")?.Value;
customElement.Require = xml.Attribute("required")?.Value;
captureElements.Add(customElement);
}
}
}
}
}
}
}
public static class DocumentExtensions
{
public static XmlDocument ToXmlDocument(this XDocument xDocument)
{
var xmlDocument = new XmlDocument();
using (var xmlReader = xDocument.CreateReader())
{
xmlDocument.Load(xmlReader);
}
return xmlDocument;
}
public static XDocument ToXDocument(this XmlDocument xmlDocument)
{
using (var nodeReader = new XmlNodeReader(xmlDocument))
{
nodeReader.MoveToContent();
return XDocument.Load(nodeReader);
}
}
}
public class CustomElements
{
public string Type { get; set; }
public string Label { get; set; }
public string CompTypes { get; set; }
public string Readonly { get; set; }
public string Hidden { get; set; }
public string Require { get; set; }
}
Full XML Schema file:
<Schema xmlns:dt="urn:schemas-microsoft-com:datatypes" name="TopTier" xmlns="urn:schemas-microsoft-com:xml-data">
<AttributeType name="ID" dt:type="id" required="yes" />
<AttributeType name="Name" dt:type="string" required="yes" />
<AttributeType name="UniqueID" dt:type="int" default="schemas/107" />
<AttributeType name="Icon" dt:type="int" default="2" />
<AttributeType name="FriendlyName" dt:type="string" default="Top Tier" />
<AttributeType name="SS" dt:type="boolean" default="true" />
<AttributeType name="DSS" dt:type="boolean" default="true" />
<AttributeType name="ViewName" dt:type="" default="" />
<AttributeType name="DefaultCategorization" dt:type="string" default="" />
<AttributeType name="Version" dt:type="int" default="9" />
<ElementType name="Exports" content="textOnly" />
<ElementType name="Title" dt:type="string" content="textOnly" />
<ElementType name="Excerpt" dt:type="string" content="textOnly">
<description>This info is used to display on pages that link to this page.</description>
</ElementType>
<ElementType name="ThumbnailImage" dt:type="imagefile" content="textOnly">
<description>Thumbnail dimension should be 75 x 75 pixels.</description>
</ElementType>
<ElementType name="xhtml_BodyCopy" content="textOnly" />
<ElementType name="xpowerlist_LeftSidebarComponentsOverride" content="eltOnly" />
<ElementType name="xpowercomponent_LeftSidebarComponent" content="eltOnly" />
<ElementType name="xpowercomponent_FeaturedTiles" content="eltOnly" />
<ElementType name="SecondaryTitle" dt:type="string" content="textOnly" />
<ElementType name="xpowerlist_SecondaryComponentList" content="eltOnly" />
<ElementType name="xpowercomponent_SecondaryItem" content="eltOnly" />
<ElementType name="xpowergroupstart_SEOGroup" content="eltOnly">
<description>Search Engine Optimization Group</description>
</ElementType>
<ElementType name="BrowserTitle" dt:type="string" content="textOnly" />
<ElementType name="MetaDescription" dt:type="string" content="textOnly" />
<ElementType name="NoIndex" dt:type="boolean" content="textOnly" />
<ElementType name="NoFollow" dt:type="boolean" content="textOnly" />
<ElementType name="NoODP" dt:type="boolean" content="textOnly" />
<ElementType name="Priority" dt:type="enumeration" values="0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0" content="textOnly" />
<ElementType name="PublishDate" dt:type="localdate" content="textOnly" />
<ElementType name="xpowergroupend_" content="eltOnly" />
<ElementType name="xpowernavigation_BreadcrumbNavigation" content="eltOnly" />
<ElementType name="xpowercomponent_SectionControl" content="eltOnly" />
<ElementType name="TopTier" content="eltOnly" order="seq">
<attribute type="ID" />
<attribute type="Name" />
<element type="Title" UID="2bbcb2816ba743e2bd935d526f47d688" label="Title" readonly="false" hidden="false" default="" required="true" />
<element type="Excerpt" UID="2ac3ade7d9c34cae8a7f304d9754db86" label="Excerpt" readonly="false" hidden="false" default="" required="true" />
<element type="ThumbnailImage" UID="f4940dbfe27f4783a97c356f3ba0f959" label="Thumbnail Image" readonly="false" hidden="false" default="" required="false" Expanded="false" Width="" Height="" Border="" HSpace="" VSpace="" Alignment="" AlternateText="" />
<element type="xhtml_BodyCopy" UID="055d4709ffb24402a14f9d13af417401" label="Body Copy" readonly="false" hidden="false" default="" required="false" Height="" />
<element type="xpowerlist_LeftSidebarComponentsOverride" UID="1d281fa780b6419089c52913640ade93" label="Left Sidebar Components Override" readonly="false" hidden="false" default="" required="false" Enclosed="" AllowEnclosureChange="" List="xpowercomponent_LeftSidebarComponent" Component="" CompTypes="" AutoEmbed="" WrappedUp="" AllowWrappingChange="" />
<element type="xpowercomponent_FeaturedTiles" UID="40204fc9b5424b349e03134d777d29bc" label="Featured Tiles" readonly="false" hidden="false" default="" required="false" Component="" CompTypes="ThemedTileSetComponent;ThemedTileSetElectedComponent;" AutoEmbed="" WrappedUp="" AllowWrappingChange="" />
<element type="SecondaryTitle" UID="3d00fbe341ff4f2481c6199deb046997" label="Secondary Title" readonly="false" hidden="false" default="" required="false" />
<element type="xpowerlist_SecondaryComponentList" UID="3bc6293a826a4f2081dca1c5e1415978" label="Secondary Component List" readonly="false" hidden="false" default="" required="false" Enclosed="" AllowEnclosureChange="" List="xpowercomponent_SecondaryItem" Component="" CompTypes="TaxonomyTileComponent;ServiceComponent;ContactComponent;TitledCollection" AutoEmbed="" WrappedUp="" AllowWrappingChange="" />
<element type="xpowergroupstart_SEOGroup" UID="bf312bbd47d74c758d13695b8fa011c0" label="SEO Group" readonly="false" hidden="true" default="" required="false" Enclosed="" AllowEnclosureChange="" />
<element type="BrowserTitle" UID="c777f36e6f094b50a04692d3bfef387e" label="Browser Title" readonly="false" hidden="false" default="" required="false" />
<element type="MetaDescription" UID="05bab416415541beb05e90b94f7e5248" label="Meta Description" readonly="false" hidden="false" default="" required="false" />
<element type="NoIndex" UID="e224c1a3aaa846d9b19579d59d9b1af7" label="No Index" readonly="false" hidden="false" default="" required="false" />
<element type="NoFollow" UID="b40ae068c0d749c4bb8ecd589388bb1b" label="No Follow" readonly="false" hidden="false" default="" required="false" />
<element type="NoODP" UID="2557027d711d41c3b3ccbd3aab4650dd" label="No ODP" readonly="false" hidden="false" default="" required="false" />
<element type="Priority" UID="f49eec4e94864e03aedbd0e2be6a2822" label="Priority" readonly="false" hidden="false" default="" required="false" values="0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0" />
<element type="PublishDate" UID="5fdba65915744addb710631476822112" label="Publish Date" readonly="true" hidden="true" default="" required="false" />
<element type="xpowergroupend_" />
<element type="xpowernavigation_BreadcrumbNavigation" UID="140b1582e50e4a098e190942980bd728" label="Breadcrumb Navigation" readonly="false" hidden="true" default="" required="true" Expanded="false" Navigation="Ancestors" GenerationOrder="down" StartPage="x5" MaxNodes="" MaxDepth="" Query="">
<element type="Exports" default="" />
</element>
<element type="xpowercomponent_SectionControl" UID="56564fa9c2bd4e9ba44a417960146376" label="SectionControl" readonly="false" hidden="true" default="" required="true" Component="" CompTypes="SectionControl" AutoEmbed="" WrappedUp="" AllowWrappingChange="" />
</ElementType>
</Schema>
you can use System.Xml.Linq to get all the elements and the required attributes as below
XDocument document = XDocument.Load(#"D:\New Text Document.xml");
var eleCollection = document.Elements("element");
foreach (var element in eleCollection)
{
var type = element.Attribute("Type").Value;
}
This is easiest way one can use for loops on nodes to get the information in each node.
use node.ChildNodes property to get the chilenodes.
XmlDocument doc = new XmlDocument();
doc.Load("filepath");
//Here Path could be- "//ElementType" ---> this will give all nodes with name ElementType
XmlNodeList nodes= doc.SelectNodes("//give path of nodes you want attributes for");
foreach (XmlNode node in nodes)
{
//Assuming you want information of element tags
foreach (XmlNode child in node.ChildNodes)
{
string name= node.Attributes["type"].Value;
string name= node.Attributes["label"].Value;
}
}
How can I get a this: val="icon.weapon_small_sword_i00"/> from XML file by giving a itemId. I managed to do something like this but besides of choosing right itemId from file I dont know how to get the value I mentioned above.
Thats a code I have:
int ItemId = 15;
XmlTextReader reader = new XmlTextReader(#"D:\L2Eq\xml\items");
XmlNodeType type;
while (reader.Read())
{
type = reader.NodeType;
if (type == XmlNodeType.Element)
{
if (reader.Name == "item")
{
if (Int32.Parse(reader.GetAttribute(0)) == ItemId)
{
Console.WriteLine(reader.GetAttribute(0));
}
}
}
}
And thats how XML file looks like:
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="items.xsd">
<item id="1" type="Weapon" name="Short Sword">
<set name="icon" val="icon.weapon_small_sword_i00" />
<set name="default_action" val="equip" />
<set name="weapon_type" val="sword" />
<set name="bodypart" val="rhand" />
<set name="random_damage" val="10" />
<set name="attack_range" val="40" />
<for>
<set order="0x08" stat="pAtk" val="8" />
<set order="0x08" stat="mAtk" val="6" />
<set order="0x08" stat="rCrit" val="8" />
<set order="0x08" stat="pAtkSpd" val="379" />
</for>
</item>
<item id="2" type="Weapon" name="Long Sword">
<set name="icon" val="icon.weapon_long_sword_i00" />
<set name="default_action" val="equip" />
<set name="weapon_type" val="sword" />
<set name="bodypart" val="rhand" />
<set name="random_damage" val="10" />
<set name="attack_range" val="40" />
<for>
<set order="0x08" stat="pAtk" val="24" />
<set order="0x08" stat="mAtk" val="17" />
<set order="0x08" stat="rCrit" val="8" />
<set order="0x08" stat="pAtkSpd" val="379" />
</for>
</item>
</list>
XmlTextReader is a very clumsy way to deal with XML; I'd never use it. The old System.Xml.XmlDocument API is a much better choice:
var findID = "1";
string iconValue = null;
var xdoc = new System.Xml.XmlDocument();
xdoc.Load(#"D:\L2Eq\xml\items");
iconValue = xdoc.SelectSingleNode("/list/item[#id=" + findID + "]/set[#name='icon']/#val")?.Value;
Or you could use the shiny new LINQ to XML classes:
var doc = XDocument.Load(#"D:\L2Eq\xml\items");
iconValue = doc.Descendants("item")
.Where(d => d.Attribute("id")?.Value == findID)
.Descendants("set")
.Where(x => x.Attribute("name")?.Value == "icon")
.FirstOrDefault()?.Attribute("val")?.Value;
I am trying to add new attribute to my xml files in c#. my xml file format is shown below:
<Root MessageOfRoot="Welcome to Xml">
<Header Size="36">
<Parameter Name="ID" Index="0" Value="23" />
<Parameter Name="Name" Index="4" Value="Uncle Bob" />
<Parameter Name="Number" Index="8" Value="4" />
</Header>
<Body Size="0">
<Parameter Index="0" UnitNumber="0" Name="UnitBarcode" Type="Integer" />
<Parameter Index="4" PromotionId="0" Name="PromotionalUnit" Type="Integer" />
</Body>
</Root>
I want to add new attribute my xml file which should be like:
<Root MessageOfRoot="Welcome to Xml">
<Header Size="36" NewAttr="1">
<Parameter Name="ID" Index="0" Value="23" NewAttr="1"/>
<Parameter Name="Name" Index="4" Value="Uncle Bob" NewAttr="1"/>
<Parameter Name="Number" Index="8" Value="4" NewAttr="1"/>
</Header>
<Body Size="0" NewAttr="1">
<Parameter Index="0" UnitNumber="0" Name="UnitBarcode" Type="Integer" NewAttr="1"/>
<Parameter Index="4" PromotionId="0" Name="PromotionalUnit" Type="Integer" NewAttr="1"/>
</Body>
</Root>
To do that i write the following code but i am having problem with adding newAttr to all nodes. How can i add NewAttr to my new xml file?
XmlDocument doc = new XmlDocument();
doc.Load("Path of xml");
XmlAttribute NewAttr = doc.CreateAttribute("NewAttr ");
countAttr.Value = "1";
XmlWriter writer = XmlWriter.Create("output.xml", settings);
You can use the following command to load the XML file:
XDocument doc = XDocument.Load(#"C:\Users\myUser\myFile.xml");
Then you can invoke a function that recursively accesses all nodes of the XML starting from the children nodes of the Root element:
AddNewAttribute(doc.Root.Elements());
The function can be like so:
public static void AddNewAttribute(IEnumerable<XElement> elements)
{
foreach (XElement elm in elements)
{
elm.Add(new XAttribute("newAttr", 1));
AddNewAttribute(elm.Elements());
}
}
Finally, you can save the XML back to the original file using:
doc.Save(#"C:\Users\myUser\myFile.xml");
I would like to export my FusionChart to PDF using iTextSharp. I am able to export to PDF by use of setting the charts exportEnabled = '1', but I want to be able to export the fusionchart from my controller.
I have my entire fusionchart in a str variable and tried the following :
public FileStreamResult ExportPDF(int ProjectID)
{
string exportData = String.Format("<html><body>{0}</body></html>", getGraphXMLData(ProjectID));//This Gets the chart and stores into string
var bytes = System.Text.Encoding.UTF8.GetBytes(exportData);
using (var input = new MemoryStream(bytes))
{
var output = new MemoryStream();
var document = new iTextSharp.text.Document(PageSize.A4, 50, 50, 50, 50);
var writer = PdfWriter.GetInstance(document, output);
Font headerFont = FontFactory.GetFont("Verdana", 10);
Font rowfont = FontFactory.GetFont("Verdana", 10);
writer.CloseStream = false;
document.Open();
var xmlWorker = iTextSharp.tool.xml.XMLWorkerHelper.GetInstance();
xmlWorker.ParseXHtml(writer, document, input, System.Text.Encoding.UTF8);
document.Close();
output.Position = 0;
return File(output, "application/pdf", "ProfileChart_Report.pdf");
//return new FileStreamResult(output, "application/pdf");
}
}
I however get an error on this line : document.Close();
The error im getting is :
An exception of type 'System.IO.IOException' occurred in iTextSharp.dll but was not handled in user code
Additional information: The document has no pages.
Below is the data in the exportData field:
<html>
<body>
<chart caption='Project Test' yaxisname='Elevation' xaxisname='Accumulated Length' xaxismaxvalue='1000' xaxisminvalue='100' yaxismaxvalue='200' xnumberprefix='' ynumberprefix='' showcanvasborder='1' canvasborderthickness='0.5' canvasborderalpha= '50' showXAxisLine= '0' showformbtn= '1' formAction='#' submitdataasxml='1' baseFontColor='#333333' baseFont='Helvetica Neue, Arial' captionFontSize='14' subcaptionFontSize='14' subcaptionFontBold='0' showBorder='0' bgColor='#ffffff' showValues='0' showShadow='0' canvasBgColor='#ffffff' divlineAlpha='100' divlineColor='#999999' divlineThickness='1' divLineIsDashed='1' divLineDashLen='1' divLineGapLen='1' usePlotGradientColor='0' showplotborder='0' showAlternateHGridColor='0' showAlternateVGridColor='0' legendBgAlpha='0' legendBorderAlpha='0' legendShadow='0' legendItemFontSize='10' legendItemFontColor='#666666' toolTipColor='#ffffff' toolTipBorderThickness='0' toolTipBgColor='#000000' toolTipBgAlpha='80' toolTipBorderRadius='2' toolTipPadding = '5' labeldisplay= 'rotate' slantlabels= '1' exportEnabled='1' > <categories verticallinecolor='666666' verticallinethickness='1' alpha='40' anchorsides='0' anchorradius='0'><category label='0' x='0' showverticalline='0'/>
<category label='46.17' x='46.17' showverticalline='0'/>
<category label='142.98' x='142.98' showverticalline='0'/>
<category label='543.88' x='543.88' showverticalline='0'/>
<category label='826.58' x='826.58' showverticalline='0'/>
<category label='1037.93' x='1037.93' showverticalline='0'/>
<category label='1106.1' x='1106.1' showverticalline='0'/>
<category label='1338.1' x='1338.1' showverticalline='0'/>
<category label='1838.5' x='1838.5' showverticalline='0'/>
<category label='1889.37' x='1889.37' showverticalline='0'/>
<category label='2538' x='2538' showverticalline='0'/>
<category label='2789.04' x='2789.04' showverticalline='0'/>
<category label='3154.34' x='3154.34' showverticalline='0'/>
<category label='3345.17' x='3345.17' showverticalline='0'/>
<category label='4220.75' x='4220.75' showverticalline='0'/>
<category label='4671.9' x='4671.9' showverticalline='0'/>
<category label='5057.74' x='5057.74' showverticalline='0'/>
<category label='5318.51' x='5318.51' showverticalline='0'/>
<category label='5576.18' x='5576.18' showverticalline='0'/>
<category label='5958.13' x='5958.13' showverticalline='0'/>
<category label='6537.92' x='6537.92' showverticalline='0'/>
<category label='7282.09' x='7282.09' showverticalline='0'/>
<category label='8178.84' x='8178.84' showverticalline='0'/>
<category label='8511.22' x='8511.22' showverticalline='0'/>
<category label='8989.59' x='8989.59' showverticalline='0'/>
<category label='9442.78' x='9442.78' showverticalline='0'/>
<category label='9862.78' x='9862.78' showverticalline='0'/>
<category label='9942.78' x='9942.78' showverticalline='0'/>
<category label='10402.78' x='10402.78' showverticalline='0'/>
<category label='10607.78' x='10607.78' showverticalline='0'/>
<category label='11052.78' x='11052.78' showverticalline='0'/>
<category label='11267.78' x='11267.78' showverticalline='0'/>
<category label='11797.78' x='11797.78' showverticalline='0'/>
<category label='12307.78' x='12307.78' showverticalline='0'/>
<category label='12572.78' x='12572.78' showverticalline='0'/>
<category label='13229.78' x='13229.78' showverticalline='0'/>
<category label='13369.78' x='13369.78' showverticalline='0'/>
</categories>
<dataset drawline= '1' seriesname= 'Elevation' color= '#0045ff' anchorsides= '0' anchorradius= '0' anchorbgcolor= '#0045ff' anchorbordercolor= '#0045ff'>
<set y='321' x='0'/>
<set y='322' x='46.17'/>
<set y='322.54' x='142.98'/>
<set y='309.12' x='543.88'/>
<set y='292.63' x='826.58'/>
<set y='299.12' x='1037.93'/>
<set y='298.68' x='1106.1'/>
<set y='303.49' x='1338.1'/>
<set y='294.23' x='1838.5'/>
<set y='295.77' x='1889.37'/>
<set y='269.98' x='2538'/>
<set y='274.17' x='2789.04'/>
<set y='261.71' x='3154.34'/>
<set y='267.01' x='3345.17'/>
<set y='243.04' x='4220.75'/>
<set y='247.05' x='4671.9'/>
<set y='250.81' x='5057.74'/>
<set y='246.4' x='5318.51'/>
<set y='249.62' x='5576.18'/>
<set y='238.03' x='5958.13'/>
<set y='253.08' x='6537.92'/>
<set y='235.53' x='7282.09'/>
<set y='173.53' x='8178.84'/>
<set y='189.91' x='8511.22'/>
<set y='224.23' x='8989.59'/>
<set y='250' x='9442.78'/>
<set y='250' x='9862.78'/>
<set y='253.45' x='9942.78'/>
<set y='240' x='10402.78'/>
<set y='235' x='10607.78'/>
<set y='210' x='11052.78'/>
<set y='210' x='11267.78'/>
<set y='195' x='11797.78'/>
<set y='170' x='12307.78'/>
<set y='160' x='12572.78'/>
<set y='150' x='13229.78'/>
<set y='141.36' x='13369.78'/>
</dataset>
<dataset drawline= '1' seriesname= 'HGL' color= '#198500' anchorsides= '0' anchorradius= '0' anchorbgcolor= '#198500' anchorbordercolor= '#198500'>
<set y='321' x='0'/>
<set y='320.87' x='46.17'/>
<set y='320.59' x='142.98'/>
<set y='319.46' x='543.88'/>
<set y='318.66' x='826.58'/>
<set y='318.06' x='1037.93'/>
<set y='317.87' x='1106.1'/>
<set y='317.22' x='1338.1'/>
<set y='315.81' x='1838.5'/>
<set y='315.67' x='1889.37'/>
<set y='313.84' x='2538'/>
<set y='313.1' x='2789.04'/>
<set y='312.02' x='3154.34'/>
<set y='311.38' x='3345.17'/>
<set y='308.46' x='4220.75'/>
<set y='306.96' x='4671.9'/>
<set y='305.68' x='5057.74'/>
<set y='304.81' x='5318.51'/>
<set y='303.95' x='5576.18'/>
<set y='302.68' x='5958.13'/>
<set y='300.75' x='6537.92'/>
<set y='298.27' x='7282.09'/>
<set y='294.88' x='8178.84'/>
<set y='293.39' x='8511.22'/>
<set y='291.25' x='8989.59'/>
<set y='285.78' x='9442.78'/>
<set y='281.31' x='9862.78'/>
<set y='280.46' x='9942.78'/>
<set y='275.55' x='10402.78'/>
<set y='273.37' x='10607.78'/>
<set y='256.15' x='11052.78'/>
<set y='247.84' x='11267.78'/>
<set y='227.36' x='11797.78'/>
<set y='204.03' x='12307.78'/>
<set y='191.92' x='12572.78'/>
<set y='156.49' x='13229.78'/>
<set y='148.94' x='13369.78'/>
</dataset>
<dataset drawline= '0' seriesname= 'Peak' color= '#ff0000' anchorsides= '3' anchorradius= '5' anchorbgcolor= '#ff0000' anchorbordercolor= '#ff0000'>
<set y='321' x='0'/>
<set y='322.54' x='142.98'/>
<set y='299.12' x='1037.93'/>
<set y='303.49' x='1338.1'/>
<set y='295.77' x='1889.37'/>
<set y='274.17' x='2789.04'/>
<set y='267.01' x='3345.17'/>
<set y='250.81' x='5057.74'/>
<set y='249.62' x='5576.18'/>
<set y='253.08' x='6537.92'/>
<set y='253.45' x='9942.78'/>
<set y='141.36' x='13369.78'/>
</dataset>
<dataset drawline= '0' seriesname= 'Valve - Change' color= '#198500' anchorsides= '4' anchorradius= '5' anchorbgcolor= '#198500' anchorbordercolor= '#198500'>
<set y='309.12' x='543.88'/>
<set y='235.53' x='7282.09'/>
<set y='235' x='10607.78'/>
<set y='195' x='11797.78'/>
<set y='150' x='13229.78'/>
</dataset>
<dataset drawline= '0' seriesname= 'Valve suggest - Long Node' color= '#fdff00' anchorsides= '4' anchorradius= '3' anchorbgcolor= '#fdff00' anchorbordercolor= '#fdff00'>
<set y='321' x='0'/>
<set y='309.12' x='543.88'/>
<set y='294.23' x='1838.5'/>
<set y='269.98' x='2538'/>
<set y='261.71' x='3154.34'/>
<set y='243.04' x='4220.75'/>
<set y='247.05' x='4671.9'/>
<set y='250.81' x='5057.74'/>
<set y='238.03' x='5958.13'/>
<set y='253.08' x='6537.92'/>
<set y='235.53' x='7282.09'/>
<set y='173.53' x='8178.84'/>
<set y='189.91' x='8511.22'/>
<set y='224.23' x='8989.59'/>
<set y='250' x='9442.78'/>
<set y='250' x='9862.78'/>
<set y='240' x='10402.78'/>
<set y='210' x='11052.78'/>
<set y='195' x='11797.78'/>
<set y='170' x='12307.78'/>
<set y='150' x='13229.78'/>
</dataset>
</chart>
</body>
</html>
I specifically want to do it in iTextSharp as I have other exports that im doing that is also using iTextSharp and ultimately want to combine everything into one PDF.
I would appreciate anyones help. Thanks.
Good Morning :)
Situtation: In SP2010, I've a customer list with a external data field. In the solution I have a BDC Model with an entity which contains a "ReadItem" and a "ReadList" method. When I deploy my feature and set the object permissions, I can read the Item without troubles. Now i have to search an item. I follow this instructions to create a Filter: http://msdn.microsoft.com/en-us/library/ee471425.aspx but it doesn't work, because I have always the same value in my parameter ("**") ..
Question:
1. How can I assign the search input to the parameter?
2. Is something other wrong?
Code
public IEnumerable<Oppertunity> ReadList(String inputParameter)
{
using (CRMDataClassesDataContext db = new CRMDataClassesDataContext("server=xxx;database=xxx; uid=xxx ;pwd=xxx"))
{
List<Oppertunity> oppertunities = new List<Oppertunity>();
var q = from c in db.Opportunities
where c.Name.Contains(inputParameter)
orderby c.Name ascending
select new Oppertunity
{
OppertunityId = c.OpportunityId,
Name = c.Name,
};
foreach (var o in q)
{
Oppertunity oppertunity = new Oppertunity();
oppertunity.OppertunityId = o.OppertunityId;
oppertunity.Name = o.Name;
oppertunities.Add(oppertunity);
}
}
return oppertunities;
}
The BDC part looks like the instructions of msdn:
<?xml version="1.0" encoding="utf-8"?>
<Model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/windows/2007/BusinessDataCatalog" Name="BdcModel1">
<LobSystems>
<LobSystem Name="BdcModel1" Type="DotNetAssembly">
<LobSystemInstances>
<LobSystemInstance Name="BdcModel1" />
</LobSystemInstances>
<Entities>
<Properties>
<Property Name="Class" Type="System.String">NX.Intra.Bcs.BdcModel1.ContactService, BdcModel1</Property>
</Properties>
<Identifiers>
<Identifier Name="ContactId" TypeName="System.Guid" />
</Identifiers>
<Methods>
<Method Name="ReadList">
<Parameters>
<Parameter Name="returnParameter" Direction="Return">
<TypeDescriptor Name="ContactList" TypeName="System.Collections.Generic.IEnumerable`1[[NX.Intra.Bcs.BdcModel1.Contact, BdcModel1]]" IsCollection="true">
<TypeDescriptors>
<TypeDescriptor Name="Contact" TypeName="NX.Intra.Bcs.BdcModel1.Contact, BdcModel1">
<TypeDescriptors>
<TypeDescriptor Name="ContactId" TypeName="System.Guid" IdentifierName="ContactId" IsCollection="false" ReadOnly="true">
<Properties>
<Property Name="ShowInPicker" Type="System.Boolean">false</Property>
</Properties></TypeDescriptor>
<TypeDescriptor Name="FirstName" TypeName="System.String">
<Properties>
<Property Name="ShowInPicker" Type="System.Boolean">true</Property>
</Properties>
</TypeDescriptor>
<TypeDescriptor Name="LastName" TypeName="System.String">
<Properties>
<Property Name="ShowInPicker" Type="System.Boolean">true</Property>
</Properties>
</TypeDescriptor>
<TypeDescriptor Name="AccountIdName" TypeName="System.String">
<Properties>
<Property Name="ShowInPicker" Type="System.Boolean">true</Property>
</Properties>
</TypeDescriptor>
<TypeDescriptor Name="FullName" TypeName="System.String">
<Properties>
<Property Name="ShowInPicker" Type="System.Boolean">false</Property>
</Properties>
</TypeDescriptor></TypeDescriptors></TypeDescriptor></TypeDescriptors></TypeDescriptor></Parameter>
</Parameters>
<MethodInstances>
<MethodInstance Name="ReadList" Type="Finder" Default="true" DefaultDisplayName="Read List" ReturnParameterName="returnParameter" />
</MethodInstances></Method>
<Method Name="ReadItem">
<Parameters>
<Parameter Name="returnParameter" Direction="Return">
<TypeDescriptor Name="Contact" TypeName="NX.Intra.Bcs.BdcModel1.Contact, BdcModel1">
<TypeDescriptors>
<TypeDescriptor Name="ContactId" TypeName="System.Guid" IsCollection="false" IdentifierName="ContactId" />
<TypeDescriptor Name="LastName" TypeName="System.String" />
<TypeDescriptor Name="FirstName" TypeName="System.String" />
<TypeDescriptor Name="AccountIdName" TypeName="System.String" />
<TypeDescriptor Name="FullName" TypeName="System.String" /></TypeDescriptors>
</TypeDescriptor>
</Parameter>
<Parameter Name="id" Direction="In">
<TypeDescriptor Name="ContactId" TypeName="System.Guid" IdentifierName="ContactId" IsCollection="false" /></Parameter>
</Parameters>
<MethodInstances>
<MethodInstance Name="ReadItem" Type="SpecificFinder" Default="true" DefaultDisplayName="Read Item" ReturnParameterName="returnParameter" />
</MethodInstances>
</Method>
</Methods></Entity>
<Entity Name="Oppertunity" Namespace="NX.Intra.Bcs.BdcModel1" Version="1.0.0.144">
<Properties>
<Property Name="Class" Type="System.String">NX.Intra.Bcs.BdcModel1.Oppertunity, BdcModel1</Property>
<Property Name="Title" Type="System.String">FirstName</Property>
</Properties>
<Identifiers>
<Identifier Name="OppertunityId" TypeName="System.Guid" />
</Identifiers>
<Methods>
<Method Name="ReadList" IsStatic="false">
<FilterDescriptors>
<FilterDescriptor Name="OppertunityNameFilter" Type="Wildcard" DefaultDisplayName="Suche nach Name" FilterField="Name">
<Properties>
<Property Name="UsedForDisambiguation" Type="System.Boolean">true</Property>
</Properties>
</FilterDescriptor>
</FilterDescriptors>
<Parameters>
<Parameter Name="returnParameter" Direction="Return">
<TypeDescriptor Name="OppertunityList" TypeName="System.Collections.Generic.IEnumerable`1[[NX.Intra.Bcs.BdcModel1.Oppertunity, BdcModel1]]" IsCollection="true">
<TypeDescriptors>
<TypeDescriptor Name="Oppertunity" TypeName="NX.Intra.Bcs.BdcModel1.Oppertunity, BdcModel1">
<TypeDescriptors>
<TypeDescriptor Name="OppertunityId" TypeName="System.Guid" IsCollection="false" IdentifierName="OppertunityId">
<Properties>
<Property Name="ShowInPicker" Type="System.Boolean">false</Property>
</Properties></TypeDescriptor>
<TypeDescriptor Name="Name" TypeName="System.String">
<Properties>
<Property Name="ShowInPicker" Type="System.Boolean">true</Property>
</Properties></TypeDescriptor></TypeDescriptors></TypeDescriptor></TypeDescriptors></TypeDescriptor></Parameter>
<Parameter Name="inputParameter" Direction="In">
<TypeDescriptor Name="OppertunityFinderTD" TypeName="System.String" AssociatedFilter="OppertunityNameFilter">
<TypeDescriptors>
<TypeDescriptor Name="Oppertunity" TypeName="NX.Intra.Bcs.BdcModel1.Oppertunity, BdcModel1">
<TypeDescriptors>
<TypeDescriptor Name="OppertunityId" TypeName="System.Guid" IdentifierName="OppertunityId" IsCollection="false">
<Properties>
<Property Name="ShowInPicker" Type="System.Boolean">false</Property>
</Properties></TypeDescriptor>
<TypeDescriptor Name="Name" TypeName="System.String">
<Properties>
<Property Name="ShowInPicker" Type="System.Boolean">true</Property>
</Properties></TypeDescriptor></TypeDescriptors></TypeDescriptor></TypeDescriptors></TypeDescriptor></Parameter>
</Parameters>
<MethodInstances>
<MethodInstance Name="ReadList" Type="Finder" ReturnParameterName="returnParameter" Default="true" DefaultDisplayName="Read List">
<Properties>
<Property Name="UseClientCachingForSearch" Type="System.String"></Property>
<Property Name="RootFinder" Type="System.String"></Property>
</Properties></MethodInstance>
</MethodInstances></Method>
<Method Name="ReadItem">
<Parameters>
<Parameter Name="returnParameter" Direction="Return">
<TypeDescriptor Name="Oppertunity" TypeName="NX.Intra.Bcs.BdcModel1.Oppertunity, BdcModel1">
<TypeDescriptors>
<TypeDescriptor Name="OppertunityId" TypeName="System.Guid" IdentifierName="OppertunityId" IsCollection="false" />
<TypeDescriptor Name="Name" TypeName="System.String" /></TypeDescriptors></TypeDescriptor>
</Parameter>
<Parameter Name="id" Direction="In">
<TypeDescriptor Name="OppertunityId" TypeName="System.Guid" IdentifierName="OppertunityId" IsCollection="false" /></Parameter>
</Parameters>
<MethodInstances>
<MethodInstance Name="ReadItemList" Type="SpecificFinder" ReturnParameterName="returnParameter" Default="true" DefaultDisplayName="Read Item" />
</MethodInstances></Method>
</Methods></Entity>
</Entities>
</LobSystem>
</LobSystems>
</Model>
Ususally when you use an external list, you can configure value for your filter parameter by editing the default view of a list (or creating new view).
Hope this will help ;-)