Invalid character at line 410, Column 5 in WebResources.axd
Posted: Wed Feb 19, 2014 6:35 pm
We are receiving the error "Invalid character at line 410, Column 5 in WebResources.axd" upon exiting the following action. However, the report does render. The same approach of Loading the report, setting parameters and returning 'StiMvcMobileViewer.GetReportSnapshotResult(HttpContext, report);" is used elsewhere without the error. I had previously posted on this issue but once the 'RouteValueDictionary' line of code was removed that report started working. However, the error is happening here regardless of whether that line is included or not. I've attached the report definitions and the Utils class
The value of the jsText parameter on line 408 of is:
"Error: Not Found"
The value of jsObject on line 408 is:
Code: Select all
public ActionResult GetReportSnapshot(UsageReportModel r)
{
UsageReportModel model = Session["ItemAndClassUsageReportModel"] as UsageReportModel;
StiReport report = null;
if (Session["SelectedItemClass_ItemAndClassUsage"] != null)
{
report = Utils.LoadReport("~/Content/Reports/ItemClassUsage.mrt", model.Consignment);
report.Dictionary.Variables.Add("Dates", new Stimulsoft.Report.DateTimeRange(model.FromDate, model.ToDate));
report.Dictionary.DataSources["ItemClassUsage"].Parameters["pItemClass"].Value = string.Format("\"{0}\"", Session["SelectedItemClass_ItemAndClassUsage"].ToString());
Session.Remove("SelectedItemClass_ItemAndClassUsage");
}
else if (Session["SelectedItemNumber_ItemAndClassUsage"] != null)
{
report = Utils.LoadReport("~/Content/Reports/ItemUsage.mrt", model.Consignment);
report.Dictionary.Variables.Add("Dates", new Stimulsoft.Report.DateTimeRange(model.FromDate, model.ToDate));
report.Dictionary.DataSources["ItemUsage"].Parameters["pItemNumber"].Value = string.Format("\"{0}\"", Session["SelectedItemNumber_ItemAndClassUsage"].ToString());
Session.Remove("SelectedItemNumber_ItemAndClassUsage");
}
else
throw new ArgumentOutOfRangeException("Drill level not defined");
// Restore the route values collection and get the id value
//RouteValueDictionary routeValues = StiMvcMobileViewer.GetRouteValues(this.HttpContext);
return StiMvcMobileViewer.GetReportSnapshotResult(HttpContext, report);
}
"Error: Not Found"
The value of jsObject on line 408 is:
Code: Select all
?jsObject
{...}
options: {...}
prepareStyles: function (images) {
var head = this.options.head;
var cssForRemoving = [];
for (i = 0; i < head.childNodes.length; i++) {
var node = head.childNodes[i];
if (node.type == "text/css") {
if (node.sheet) {
createXMLHttp: function () {
if (typeof XMLHttpRequest != "undefined") return new XMLHttpRequest();
else if (window.ActiveXObject) {
var allVersions = [
"MSXML2.XMLHttp.5.0",
"MSXML2.XMLHttp.4.0",
"MSXML2.XMLHttp.
createUrlParameters: function (asObject) {
var params = {
"mvcviewerid": this.options.mvcViewer.id,
"routes": this.options.routes,
"reportguid": this.options.reportGuid,
"servercachemode": this.options.serverCacheMode,
"servert
postAjax: function (url, postData, callback) {
var jsObject = this;
var xmlHttp = this.createXMLHttp();
var parameters = this.createUrlParameters(false);
if (postData)
for (var key in postData) {
parameters += "&" + key + "=
postForm: function (url, postData, doc) {
if (!doc) doc = document;
var params = this.createUrlParameters(true);
if (postData)
for (var key in postData) {
params[key] = postData[key];
}
postData = params;
postViewerEvent: function (action, bookmarkPage, bookmarkAnchor) {
switch (action) {
case "Print": {
switch (this.options.printDestination) {
case "Pdf": this.postPrint("PrintPdf"); break;
case "Direc
postPrint: function (action) {
if (this.options.actionPrintReport == "") return;
var postData = {
"bookmarksprint": this.options.bookmarksPrint,
"printaction": action
};
switch (action) {
case "PrintPdf": this.printA
printAsPdf: function (url, postData) {
this.postForm(url, postData);
}
printAsPopup: function (url, postData) {
var doc = window.open("about:blank", "PrintReport", "height=900, width=790, toolbar=no, menubar=yes, scrollbars=yes, resizable=yes, location=no, directories=no, status=no").document;
this.postForm(url, postData, doc);
printAsHtml: function (text, jsObject) {
if (navigator.userAgent.indexOf("Opera") != -1) {
var operaWin = window.open("about:blank");
operaWin.document.body.innerHTML = text;
operaWin.opener.focus();
operaWin.print();
o
clickExport: function (exportFormat) {
this.options.forms["ExportForm"].exportFormat = exportFormat;
this.options.forms["ExportForm"].show();
if (!this.options.showExportDialog || exportFormat == "SaveXml")
this.postExport(this.options.forms["Ex
postExport: function (format, settings) {
if (this.options.actionExportReport == "") return;
var postData = {
"exportformat": format,
"exportsettings": JSON.stringify(settings)
};
var doc = null;
if (settings.OpenAfterExp
postDesign: function () {
document.location = this.options.requestUrl.replace("{action}", this.options.actionDesignReport);
}
postInteraction: function (sendParams) {
if (this.options.actionInteraction == "") {
if (this.options.buttons["Parameters"]) this.options.buttons["Parameters"].setEnabled(false);
return;
}
// Interaction parameters
if (sendParams) {
postInteractionResult: function (jsText, jsObject) {
jsObject.options.isParametersReceived = true;
paramsProps = JSON.parse(jsText);
jsObject.options.paramsProps = paramsProps;
if (jsObject.options.parameters == null) {
if (paramsProps != null)
parseParameters: function (htmlText) {
if (htmlText.substr(0, 1) == "{") {
var parameters = JSON.parse(htmlText.substr(0, htmlText.indexOf("##")));
htmlText = htmlText.substr(htmlText.indexOf("##") + 2);
this.options.pageNumber = parameter
scrollToAnchor: function (anchor) {
for (var i = 0; i < document.anchors.length; i++) {
if (document.anchors[i].name == anchor) {
anchorElement = document.anchors[i];
targetTop = this.FindPosY(anchorElement, this.options.scrollbarsM
showReportPage: function (htmlText, jsObject) {
if (htmlText == "null" && isReportRecieved) {
isReportRecieved = false;
jsObject.postAction();
return;
}
isReportRecieved = true;
htmlText = jsObject.parseParameters(htmlText)
AddControl: function (id, type) {
control = document.getElementById(id);
switch (type) {
case "Button": this.InitializeButton(control); break;
case "Menu": this.InitializeMenu(control); break;
case "ReportPanel": this.InitializeR
InitializeMenu: function (menu) {
menu.jsObject = this;
menu.menuName = menu.getAttribute("menuName");
menu.headerTriangle = document.getElementById(menu.id + "HeaderTriangle");
menu.itemsPanel = document.getElementById(menu.id + "ItemsPanel");
me
InitializeButton: function (button) {
button.jsObject = this;
button.buttonName = button.getAttribute("buttonName");
button.isParametersButton = button.getAttribute("isParametersButton") == "True";
button.captionText = document.getElementById(button.id +
TouchEndButton: function (button, flag) {
if (button.jsObject.options.fingerIsMoved || button.isDisable) return;
if (flag) {
button.className = "stiPressedButton";
if ('preventDefault' in event) event.preventDefault();
setTimeout("js
ShowAnimationForScroll: function (reportPanel, finishScrollTop, endTime) {
currentScrollTop = 0;
if (reportPanel.jsObject.options.scrollbarsMode) currentScrollTop = reportPanel.scrollTop;
else {
currentScrollTop = document.documentElement.scrollTop;
ShowAnimationForm: function (formId, endTime) {
var form = document.getElementById(formId);
if (!form.flag) { form.currentOpacity = 1; form.flag = true; }
clearTimeout(form.animationTimer);
var d = new Date();
var t = d.getTime();
var step = M
FindPosX: function (obj, mainClassName) {
var curleft = 0;
if (obj.offsetParent) {
while (obj.className != mainClassName) {
curleft += obj.offsetLeft;
if (!obj.offsetParent) {
break;
}
FindPosY: function (obj, mainClassName) {
var curtop = 0;
if (obj.offsetParent) {
while (obj.className != mainClassName) {
curtop += obj.offsetTop;
if (!obj.offsetParent) {
break;
}
isContainted: function (array, item) {
for (var index in array)
if (item == array[index]) return true;
return false;
}
IsTouchDevice: function() {
try {
document.createEvent("TouchEvent");
return true;
} catch (e) {
return false;
}
}
SetZoom: function (zoomIn) {
zoomValues = ["25", "50", "75", "100", "150", "200"];
var i = 0;
for (i = 0; i < zoomValues.length; i++)
if (zoomValues[i] == this.options.zoom) break;
if (zoomIn && i < zoomValues.length - 1) this.postV
getCssParameter: function (css) {
if (css.indexOf(".gif]") > 0 || css.indexOf(".png]") > 0) return css.substr(css.indexOf("["), css.indexOf("]") - css.indexOf("[") + 1);
return null;
}
newGuid: function (len, radix) {
var chars = CHARS, uuid = [], rnd = Math.random;
radix = radix || chars.length;
if (len) {
for (var i = 0; i < len; i++) uuid[i] = chars[0 | rnd() * radix];
} else {
va
dateTimeObjectToString: function (dateTimeObject, typeDateTimeObject) {
date = new Date();
date.setYear(dateTimeObject.year);
date.setMonth(dateTimeObject.month - 1);
date.setDate(dateTimeObject.day);
date.setHours(dateTimeObject.hours);
date.setMinu
getStringKey: function (key, parameter) {
stringKey = (parameter.params.type == "DateTime")
? this.dateTimeObjectToString(key, parameter.params.dateTimeType)
: key;
return stringKey;
}
getCountObjects: function (objectArray) {
count = 0;
if (objectArray)
for (var singleObject in objectArray) { count++ };
return count;
}
getNowDateTimeObject: function () {
date = new Date();
dateTimeObject = {};
dateTimeObject.year = date.getFullYear();
dateTimeObject.month = date.getMonth() + 1;
dateTimeObject.day = date.getDate();
dateTimeObject.hours = date.getHours();
date
getNowTimeSpanObject: function () {
date = new Date();
timeSpanObject = {};
timeSpanObject.hours = date.getHours();
timeSpanObject.minutes = date.getMinutes();
timeSpanObject.seconds = date.getSeconds();
return timeSpanObject;
}
copyObject: function (o) {
if (!o || "object" !== typeof o) {
return o;
}
var c = "function" === typeof o.pop ? [] : {};
var p, v;
for (p in o) {
if (o.hasOwnProperty(p)) {
v = o[p];
if (v && "object
hideAllMenus: function () {
if (this.options.fingerIsMoved) return;
if (this.options.currentMenu && !this.options.buttonWasPressed) this.options.currentMenu.hide();
if (!this.options.parametersPanel.dropDownButtonWasClicked)
if (this.options.para
CreateHTMLTable: function (rowsCount, cellsCount) {
var table = document.createElement("table");
table.cellPadding = 0;
table.cellSpacing = 0;
table.tr = [];
table.tr[0] = document.createElement("tr");
table.appendChild(table.tr[0]);
ta
ShowHelpWindow: function (url) {
window.open("http://www.stimulsoft.com/" + this.options.helpLanguage + "/documentation/online/" + url);
}
InitializeReportPanel: function (reportPanel) {
reportPanel.jsObject = this;
this.options.reportPanel = reportPanel;
reportPanel.addPage = function (pageContent, pageIndex) {
pageBase = document.createElement("DIV");
pageBase.style.zIndex = "1"
InitializeToolBar: function (toolbar) {
toolbar.jsObject = this;
toolbar.mainTable = document.getElementById(toolbar.id + "Table");
toolbar.innerCell = document.getElementById(toolbar.id + "InnerCell");
toolbar.innerTable = document.getElementById(toolbar
InitializeProcessImage: function (processImage) {
processImage.jsObject = this;
this.options.processImage = processImage;
processImage.show = function () {
this.style.display = "";
this.style.left = (this.jsObject.options.mvcViewer.offsetWidth /
InitializeBookmarksPanel: function (bookmarksPanel) {
bookmarksPanel.jsObject = this;
this.options.bookmarks = bookmarksPanel;
bookmarksPanel.container = document.getElementById(bookmarksPanel.id + "Container");
bookmarksPanel.changeVisibleState = function (st
InitializeParametersPanel: function (parametersPanel) {
parametersPanel.jsObject = this;
this.options.parametersPanel = parametersPanel;
parametersPanel.container = document.getElementById(parametersPanel.id + "Container");
parametersPanel.container.style.maxHeig
InitializeExportCheckBox: function (checkBox) {
checkBox.jsObject = this;
checkBox.parentTable = document.getElementById(checkBox.id + "ParentTable");
checkBox.parentTable.rows[0].cells[1].checkBox = checkBox;
checkBox.checkBoxName = checkBox.parentTable.getAttr
InitializeExportDropDownList: function (dropDownList) {
dropDownList.jsObject = this;
dropDownList.parentTable = document.getElementById(dropDownList.id + "ParentTable");
dropDownList.dropDownListName = dropDownList.parentTable.getAttribute("dropDownListName");
dr
InitializeExportGroupBox: function (groupBox) {
groupBox.jsObject = this;
groupBox.groupBoxName = groupBox.getAttribute("groupBoxName");
groupBox.exportForm = document.getElementById(this.options.mvcViewer.id + "ExportForm");
if (!groupBox.exportForm.controls)
InitializeExportRadioButton: function (radioButton) {
radioButton.jsObject = this;
radioButton.parentTable = document.getElementById(radioButton.id + "ParentTable");
radioButton.parentTable.rows[0].cells[1].radioButton = radioButton;
radioButton.radioButtonName = r
InitializeExportTextBox: function (textBox) {
textBox.jsObject = this;
textBox.parentTable = document.getElementById(textBox.id + "ParentTable");
textBox.textBoxName = textBox.parentTable.getAttribute("textBoxName");
textBox.exportForm = document.getElementBy
InitializeForm: function (form) {
form.jsObject = this;
form.formName = form.getAttribute("formName");
this.options.forms[form.formName] = form;
form.header = document.getElementById(form.id + "Header");
form.disabledPanel = document.getElementByI
InitializeViewer: function () {
this.options.mvcViewer.jsObject = this;
this.options.mvcViewer.pressedDown = function () {
this.jsObject.hideAllMenus();
this.jsObject.options.buttonWasPressed = false;
this.jsObject.options.parametersPa
InitializeAboutPanel: function (aboutPanel) {
aboutPanel.jsObject = this;
this.options.aboutPanel = aboutPanel;
this.options.disabledPanel = document.getElementById(this.options.mvcViewer.id + "DisabledPanel");
this.options.disabledPanel.jsObject = this;
createParameter: function (params) {
parameter = document.createElement("Table");
parameter.cellPadding = 0;
parameter.cellSpacing = 0;
parameter.style.border = "0px";
tbody = document.createElement("TBODY");
parameter.appendChild(tbody);
cellBoolCheckBox: function (parameter) {
cell = document.createElement("Td");
cell.style.height = "46px";
cell.style.padding = "0px 2px 0 2px";
checkBox = this.parameterCheckBox(parameter);
parameter.controls.boolCheckBox = checkBox;
checkBox.s
cellLabelFrom: function (parameter) {
cell = document.createElement("Td");
cell.style.height = "46px";
cell.style.padding = "0px 2px 0 2px";
cell.innerHTML = "From";
return cell;
}
cellFirstTextBox: function (parameter) {
cell = document.createElement("Td");
cell.style.height = "46px";
cell.style.padding = "0px 2px 0 2px";
textBox = this.parameterTextBox(parameter);
cell.appendChild(textBox);
parameter.controls.firstTex
cellFirstDateTimeButton: function (parameter) {
cell = document.createElement("Td");
cell.style.height = "46px";
cell.style.padding = "0px 2px 0 2px";
dateTimeButton = this.parameterButton("DateTimeButton", parameter);
dateTimeButton.id = parameter.jsObj
cellFirstGuidButton: function (parameter) {
cell = document.createElement("Td");
cell.style.height = "46px";
cell.style.padding = "0px 2px 0 2px";
guidButton = this.parameterButton("GuidButton", parameter);
guidButton.id = parameter.jsObject.options.mv
cellLabelTo: function (parameter) {
cell = document.createElement("Td");
cell.style.height = "46px";
cell.style.padding = "0px 2px 0 2px";
cell.innerHTML = "To";
return cell;
}
cellSecondTextBox: function (parameter) {
cell = document.createElement("Td");
cell.style.height = "46px";
cell.style.padding = "0px 2px 0 2px";
textBox = this.parameterTextBox(parameter);
cell.appendChild(textBox);
parameter.controls.secondTe
cellSecondDateTimeButton: function (parameter) {
cell = document.createElement("Td");
cell.style.height = "46px";
cell.style.padding = "0px 2px 0 2px";
dateTimeButton = this.parameterButton("DateTimeButton", parameter);
dateTimeButton.id = parameter.jsObj
cellSecondGuidButton: function (parameter) {
cell = document.createElement("Td");
cell.style.height = "46px";
cell.style.padding = "0px 2px 0 2px";
guidButton = this.parameterButton("GuidButton", parameter);
guidButton.id = parameter.jsObject.options.mv
cellDropDownButton: function (parameter) {
cell = document.createElement("Td");
cell.style.height = "46px";
cell.style.padding = "0px 2px 0 2px";
dropDownButton = this.parameterButton("DropDownButton", parameter);
dropDownButton.id = parameter.jsObjec
cellNullableCheckBox: function (parameter) {
cell = document.createElement("Td");
cell.style.height = "46px";
cell.style.padding = "0px 2px 0 2px";
checkBox = this.parameterCheckBox(parameter);
cell.appendChild(checkBox);
checkBox.onchecked = f
cellNullableText: function (parameter) {
cell = document.createElement("Td");
cell.style.height = "46px";
cell.style.padding = "0px";
cell.innerHTML = "Null";
return cell;
}
parameterButton: function (buttonType, parameter) {
button = document.createElement("Div");
button.parameter = parameter;
button.buttonType = buttonType;
button.isDisable = false;
button.isOver = false;
button.style.height = "38px";
but
TouchEndParametersButton: function (button, flag) {
if (button.parameter.jsObject.options.fingerIsMoved || button.isDisable) return;
//debugger;
if (flag) {
button.className = "stiPressedButton";
if ('preventDefault' in event) event.preventDefault()
parameterTextBox: function (parameter) {
textBox = document.createElement("Input");
textBox.className = "stiParametersTextBoxes";
textBox.parameter = parameter;
if (parameter.params.type == "Char") textBox.maxLength = 1;
if (textBox.parameter.ba
parameterCheckBox: function (parameter) {
checkBox = document.createElement("Div");
checkBox.checked = false;
checkBox.isDisable = false;
checkBox.className = "stiParametersCheckBoxIsNotChecked";
checkBox.parameter = parameter;
checkBox.onchec
parameterMenu: function (parameter) {
menuParent = document.createElement("Div");
menuParent.className = "stiParametersMenu";
menuParent.parameter = parameter;
table = document.createElement("Table");
table.style.width = (parameter.offsetWidth
parameterMenuItem: function (parameter) {
menuItem = document.createElement("Div");
menuItem.parameter = parameter;
menuItem.isOver = false;
menuItem.className = "stiParametersMenuItem";
table = document.createElement("Table");
table.class
TouchEndMenuItem: function (menuItem, flag) {
if (menuItem.parameter.jsObject.options.fingerIsMoved) return;
if (flag) {
menuItem.className = "stiParametersMenuItemPressed";
if ('preventDefault' in event) event.preventDefault();
setTim
parameterMenuSeparator: function () {
separator = document.createElement("Div");
separator.className = "stiParametersMenuSeparator";
return separator;
}
parameterMenuForValue: function (parameter) {
menuParent = this.parameterMenu(parameter);
for (var index in parameter.params.items) {
row = document.createElement("TR");
menuParent.innerTable.appendChild(row);
cell = document.createElement(
parameterMenuForRange: function (parameter) {
menuParent = this.parameterMenu(parameter);
for (var index in parameter.params.items) {
row = document.createElement("TR");
menuParent.innerTable.appendChild(row);
cell = document.createElement(
parameterMenuForNotEditList: function (parameter) {
menuParent = this.parameterMenu(parameter);
menuParent.menuItems = {};
for (var index in parameter.params.items) {
row = document.createElement("TR");
menuParent.innerTable.appendChild(row);
parameterMenuForEditList: function (parameter) {
menuParent = this.parameterMenu(parameter);
//New Item Method
menuParent.newItem = function (item, parameter) {
menuItem = parameter.jsObject.parameterMenuItem(parameter);
cell.appendChild(menuItem)
InitializeDatePicker: function (datePicker) {
datePicker.jsObject = this;
this.options.datePicker = datePicker;
datePicker.monthesNames = datePicker.getAttribute("monthes").split(",");
datePicker.nextMonthButton = document.getElementById(datePicker.id + "Nex
InitializeToolTip: function () {
var toolTip = document.createElement("div");
toolTip.id = this.options.mvcViewer.id + "ToolTip";
toolTip.jsObject = this;
this.options.toolTip = toolTip;
this.options.mainPanel.appendChild(toolTip);
toolTip.class