You could update the ~\umbraco\plugins\umbracoContour\xslt\excel.xslt file, that is responsable for the excel export of course if you then upgrade Contour it will overwrite your changes so if you are up for it you can also create your own custom export type using the provider model :) Details can be found in the contour developer docs on the contour project page (http://our.umbraco.org/projects/umbraco-pro/contour) but you'll just need a custom xslt file and a class for your provider that looks like
I may have found another solution, which is even more simple.The customer wouldn't mind to get the information each time a new entry was submitted, so my suggestion to them, was to create a new workflowentry, which would send them a XSLT formatted email, with just the informations they need, in the layout they want it.
They are just interested in 4-5 columns out of the entire 40 column form, which then should be copy/pasted to a word-document.
So that might be the way we solve this issue.
But I will definitely look into the providermodel.
I'm trying to create a custom export that lets the user choose the status of the records they want. It keeps exporting all records no matter what the user picks though. In debugging I can see that List<Umbraco.Forms.Core.Enums.FormState> States has the correct value, so that's not it.
public class VerticalHtmlTable : ExportType
{
[Umbraco.Forms.Core.Attributes.Setting("Export _X_ Records",
description = "Only exports records of the selected status.",
control = "Umbraco.Forms.Core.FieldSetting.Dropdownlist",
prevalues = "Approved, Submitted, Partially Submitted, All")]
public string recordStatus { get; set; }
public VerticalHtmlTable()
{
this.Description = "Exports all data to a vertical HTML table. Ideal for large forms.";
this.Name = "Vertical HTML Table";
this.Id = new Guid("BB0E1863-F963-4B8D-B028-94494844D901");
this.FileExtension = "html";
}
private string xslt = Configuration.Path + "/xslt/verticalHtmlTable.xslt";
public override string ExportForm(Form form)
{
List<Umbraco.Forms.Core.Enums.FormState> States = GetRecordStates();
RecordsViewer rv = new RecordsViewer();
XmlDocument xs = new XmlDocument();
XmlNode XmlRecords;
if (States.Any())
{
XmlRecords = rv.GetXmlRecords(form, 0, States, xs);
}
else
{
XmlRecords = rv.GetXmlRecords(form, xs);
}
rv.Dispose();
return XsltConvert(XmlRecords, HttpContext.Current.Server.MapPath(xslt));
}
private List<Umbraco.Forms.Core.Enums.FormState> GetRecordStates()
{
List<Umbraco.Forms.Core.Enums.FormState> states = new List<Umbraco.Forms.Core.Enums.FormState>();
states.Clear();
switch(recordStatus.Trim()){
case "Approved":
states.Add(Umbraco.Forms.Core.Enums.FormState.Approved);
break;
case "Submitted":
states.Add(Umbraco.Forms.Core.Enums.FormState.Submitted);
break;
case "Partially Submitted":
states.Add(Umbraco.Forms.Core.Enums.FormState.PartiallySubmitted);
break;
}
return states;
}
}
Create custom XLS when exporting
Is it possible... oh sorry... everything is possible... but is it somewhat straighforward to change the exported XLS layout, when saving for xls.
The customer wants the informationer for each entry to be listed vertically.
So the info from entry #1 is in column A, info from entry #2 is in column B etc...
Comment author was deleted
Hey Kristoffer,
You could update the ~\umbraco\plugins\umbracoContour\xslt\excel.xslt file, that is responsable for the excel export of course if you then upgrade Contour it will overwrite your changes so if you are up for it you can also create your own custom export type using the provider model :) Details can be found in the contour developer docs on the contour project page (http://our.umbraco.org/projects/umbraco-pro/contour) but you'll just need a custom xslt file and a class for your provider that looks like
Hey Tim
Perfect. I just didn't know where to look.
I may have found another solution, which is even more simple.The customer wouldn't mind to get the information each time a new entry was submitted, so my suggestion to them, was to create a new workflowentry, which would send them a XSLT formatted email, with just the informations they need, in the layout they want it.
They are just interested in 4-5 columns out of the entire 40 column form, which then should be copy/pasted to a word-document.
So that might be the way we solve this issue.
But I will definitely look into the providermodel.
Comment author was deleted
Yup that would also work, glad I could help!
@Tim
I'm trying to create a custom export that lets the user choose the status of the records they want. It keeps exporting all records no matter what the user picks though. In debugging I can see that List<Umbraco.Forms.Core.Enums.FormState> States has the correct value, so that's not it.
is working on a reply...