2020.3.1 Symbol Problem

Stimulsoft Reports.JS discussion
Post Reply
scx0074
Posts: 17
Joined: Thu Dec 12, 2019 12:39 pm

2020.3.1 Symbol Problem

Post by scx0074 »

TIM截图20200613192428.png
TIM截图20200613192428.png (12.52 KiB) Viewed 1194 times
The new version of Symbol caused our code to go wrong.
How to solve the conflict?
scx0074
Posts: 17
Joined: Thu Dec 12, 2019 12:39 pm

Re: 2020.3.1 Symbol Problem

Post by scx0074 »

1 Error return
2 Normal return

stimulsoft.reports.js
scx0074
Posts: 17
Joined: Thu Dec 12, 2019 12:39 pm

Re: 2020.3.1 Symbol Problem

Post by scx0074 »

The problem has been solved
TIM截图20200618031814.png
TIM截图20200618031814.png (38.54 KiB) Viewed 1149 times
Judgment should be made in the environment supporting ES6,Conflict prevention

Code: Select all

Ot(l, o, d, e)    Change to     l.hasOwnProperty(o)||Ot(l, o, d, e)
scx0074
Posts: 17
Joined: Thu Dec 12, 2019 12:39 pm

Re: 2020.3.1 Symbol Problem

Post by scx0074 »

It is hoped to add the following functions to the system to support data source search without creating data relationship, so as to facilitate multi-dimensional data

Code: Select all

Stimulsoft.Report.Dictionary.StiFunctions.addFunction(
	"custom",
	"",
	"search",
	"Find field contents based on index in specified data source", "", "", "Return to specified content",
	[Object,String,String,String],
	["this", "source", "index", "field"],
	["Reference this object", "Data source name", "Specify index fields","Field information"],
	function(that, source, index, field) {
		var dataTable = {};
		for (var x = 0; x < that.dataSources.list.length; x++) {
			if (that.dataSources.list[x].name == source) {
				dataTable = that.dataSources.list[x].dataTable;
				break
			}
		}
		var columnIndex = null;
		var relationIndex = null;
		for (var y = 0; y < dataTable.columns.list.length; y++) {
			if (dataTable.columns.list[y].columnName == field) {
				columnIndex = y
			} else {
				if (dataTable.columns.list[y].columnName == "relationId") {
					relationIndex = y
				}
			}
		}
		var record = "";
		for (var z = 0; z < dataTable.rows.list.length; z++) {
			var itemArray = dataTable.rows.list[z].itemArray;
			if (itemArray[relationIndex] == index) {
				record = itemArray[columnIndex];
				break
			}
		}
		return record
	}
);
usage method {search(this,"bor_supplierData",bor.supplierData,"name")}

These are just my thoughts,Believe that developers have better solutions
Lech Kulikowski
Posts: 6198
Joined: Tue Mar 20, 2018 5:34 am

Re: 2020.3.1 Symbol Problem

Post by Lech Kulikowski »

Hello,

Sorry, maybe we did not exactly understand your question. Could you explain your issue in more detail?

Thank you.
Post Reply