Hi Folks,
I want to display the polling result in graphical format in different page.
At present EPI Server is providing the XFromStatistical control that is showing the graphical result of polling in the same page. But i want it in seperate page. Please guide me.
At present how i'm doing is passing the XForm page id, where the Xform is there to the another page(where i want the result). And using that page Id i am getting the xfrom data through the pagedata class object.
See below my code.
int intPageID=10;
DateTime dtStart = new DateTime();
PageData pd = GetPage(new PageReference(intPageId));
PollingForm = XForm.CreateInstance((new Guid((String)pd["PollingForm"])));
PollingForm.PageId = intPageId;
if (pd["PollingForm"] != null)
{
strVal = pd["PollingForm"].ToString();
}
foreach (EPiServer.XForms.XFormData data in PollingForm.GetPostedData(intPageId, dtStart, DateTime.Now))
{
for (int j = 0; j < data.GetValues().Count; j++)
{
strGetvalue = (data.GetValues()[j].ToString());
list.Add(new ListItem(strGetvalue, j.ToString()));
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(PollingForm.DocumentForTransfer.ToString());
XmlNodeList xnl = xmlDoc.GetElementsByTagName("span");
if (xnl.Item(j).InnerText.ToString() != "")
{
strQuestion = xnl.Item(j).InnerText.ToString();
}
XmlNodeList xnli = xmlDoc.GetElementsByTagName("xforms:label");
intCount = xnli.Count;
// Display the available answer options;
if (strnodevalue == "")
{
for (int i = 0; i < intCount - 1; i++)
{
list1.Add(xnli.Item(i).InnerText.ToString());
strnodevalue = strnodevalue + " " + xnli.Item(i).InnerText.ToString();
}
}
}
}
Afterward i'm creating the HTMl Table object, then i'm pushing the values in to the Html Cell. This is working fine because record less.But when the record is more than that time the performance will get down. So i want to do this one 1)With out using For... Loop..
2)By using the EPI Server XFrom Properties.
if you want more clarification i can attache the sample of my result for your reference.
Please guide me to do this one.
int intPageID=10; DateTime dtStart = new DateTime(); PageData pd = GetPage(new PageReference(intPageId)); PollingForm = XForm.CreateInstance((new Guid((String)pd["PollingForm"]))); PollingForm.PageId = intPageId; if (pd["PollingForm"] != null) { strVal = pd["PollingForm"].ToString(); } foreach (EPiServer.XForms.XFormData data in PollingForm.GetPostedData(intPageId, dtStart, DateTime.Now)) { for (int j = 0; j < data.GetValues().Count; j++) { strGetvalue = (data.GetValues()[j].ToString()); list.Add(new ListItem(strGetvalue, j.ToString())); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(PollingForm.DocumentForTransfer.ToString()); XmlNodeList xnl = xmlDoc.GetElementsByTagName("span"); if (xnl.Item(j).InnerText.ToString() != "") { strQuestion = xnl.Item(j).InnerText.ToString(); } XmlNodeList xnli = xmlDoc.GetElementsByTagName("xforms:label"); intCount = xnli.Count; // Display the available answer options; if (strnodevalue == "") { for (int i = 0; i < intCount - 1; i++) { list1.Add(xnli.Item(i).InnerText.ToString()); strnodevalue = strnodevalue + "
Afterward i'm creating the HTMl Table object, then i'm pushing the values in to the Html Cell. This is working fine because record less.But when the record is more than that time the performance will get down. So i want to do this one 1)With out using For... Loop.. 2)By using the EPI Server XFrom Properties. if you want more clarification i can attache the sample of my result for your reference. Please guide me to do this one." + xnli.Item(i).InnerText.ToString(); } } } }