add ConvertService.ashx delimiterChar param for open/save csv with user defined delimiters

This commit is contained in:
Sergey Konovalov
2017-05-04 14:03:32 +03:00
parent 26abeefcbe
commit cab0b29c38
3 changed files with 14 additions and 3 deletions

View File

@ -51,6 +51,7 @@ function InputCommand(data) {
this['saveindex'] = data['saveindex'];
this['codepage'] = data['codepage'];
this['delimiter'] = data['delimiter'];
this['delimiterChar'] = data['delimiterChar'];
this['embeddedfonts'] = data['embeddedfonts'];
if (data['mailmergesend']) {
this['mailmergesend'] = new CMailMergeSendData(data['mailmergesend']);
@ -99,6 +100,7 @@ function InputCommand(data) {
//nullable
this['codepage'] = undefined;
this['delimiter'] = undefined;
this['delimiterChar'] = undefined;
this['embeddedfonts'] = undefined;//bool
this['mailmergesend'] = undefined;
this['thumbnail'] = undefined;
@ -201,6 +203,12 @@ InputCommand.prototype = {
setDelimiter: function(data) {
this['delimiter'] = data;
},
getDelimiterChar: function() {
return this['delimiterChar'];
},
setDelimiterChar: function(data) {
this['delimiterChar'] = data;
},
getEmbeddedFonts: function() {
return this['embeddedfonts'];
},

View File

@ -218,7 +218,8 @@ function convertRequest(req, res) {
cmd.setOutputFormat(formatChecker.getFormatFromString(outputtype));
cmd.setCodepage(commonDefines.c_oAscEncodingsMap[params.codePage] || commonDefines.c_oAscCodePageUtf8);
cmd.setDelimiter(parseIntParam(params.delimiter) || commonDefines.c_oAscCsvDelimiter.Comma);
cmd.setDoctParams(parseIntParam(params.doctparams));
if(undefined != params.delimiterChar)
cmd.setDelimiterChar(params.delimiterChar);
cmd.setPassword(params.password);
var thumbnail = params.thumbnail;
if (thumbnail) {

View File

@ -79,8 +79,9 @@ function TaskQueueDataConvert(task) {
this.fileFrom = null;
this.fileTo = null;
this.formatTo = cmd.outputformat;
this.csvTxtEncoding = cmd.codepage;
this.csvDelimiter = cmd.delimiter;
this.csvTxtEncoding = cmd.getCodepage();
this.csvDelimiter = cmd.getDelimiter();
this.csvDelimiterChar = cmd.getDelimiterChar();
this.paid = task.getPaid();
this.embeddedFonts = cmd.embeddedfonts;
this.fromChanges = task.getFromChanges();
@ -108,6 +109,7 @@ TaskQueueDataConvert.prototype = {
xml += this.serializeXmlProp('m_nFormatTo', this.formatTo);
xml += this.serializeXmlProp('m_nCsvTxtEncoding', this.csvTxtEncoding);
xml += this.serializeXmlProp('m_nCsvDelimiter', this.csvDelimiter);
xml += this.serializeXmlProp('m_nCsvDelimiterChar', this.csvDelimiterChar);
xml += this.serializeXmlProp('m_bPaid', this.paid);
xml += this.serializeXmlProp('m_bEmbeddedFonts', this.embeddedFonts);
xml += this.serializeXmlProp('m_bFromChanges', this.fromChanges);