You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Custom functions with more than 1 argument are never executed, or the argument delimiter is too hard to guess. I tried ",", ";", ", ", "; ", "|", "| "). (I would expect that at least the 1st 4 delimiters would work.)
E.g. if I call my custom function TryOut with =TryOut(A1), everything is fine. Do I call it with =TryOut(A1, ",") the function is never called. I also noticed that all examples of custom functions are only with one argument, but the interface is clearly made for multiple arguments as they are returned as object[].
To Reproduce
Define a class with a custom function:
#nullable enable
using unvell.ReoGrid;
namespace BugReport {
public static partial class FormulaCollection {
public static object? TryOut(Cell cell, object[] args) {
if (args is null) return "Called with null";
if (args.Length == 0) return "Called with empty";
if (args.Length == 1) return "Called with 1 arg";
return $"Called with {args.Length} args!";
}
}
}
Create a Form that has a ReoGridControl and that registers the custom function with name TryOut:
using System.Windows.Forms;
using f = BugReport.FormulaCollection;
namespace BugReport {
public partial class SpreadSheet : Form {
public SpreadSheet() {
InitializeComponent();
unvell.ReoGrid.Formula.FormulaExtension.CustomFunctions[nameof(f.TryOut)] = f.TryOut;
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
reoGridControl1 = new unvell.ReoGrid.ReoGridControl();
SuspendLayout();
//
// reoGridControl1
//
reoGridControl1.BackColor = System.Drawing.Color.White;
reoGridControl1.ColumnHeaderContextMenuStrip = null;
reoGridControl1.Dock = System.Windows.Forms.DockStyle.Fill;
reoGridControl1.LeadHeaderContextMenuStrip = null;
reoGridControl1.Location = new System.Drawing.Point(0, 0);
reoGridControl1.Name = "reoGridControl1";
reoGridControl1.RowHeaderContextMenuStrip = null;
reoGridControl1.Script = null;
reoGridControl1.SheetTabContextMenuStrip = null;
reoGridControl1.SheetTabNewButtonVisible = true;
reoGridControl1.SheetTabVisible = true;
reoGridControl1.SheetTabWidth = 60;
reoGridControl1.ShowScrollEndSpacing = true;
reoGridControl1.Size = new System.Drawing.Size(800, 450);
reoGridControl1.TabIndex = 0;
reoGridControl1.Text = "SpreadSheet";
//
// SpreadSheet
//
AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
ClientSize = new System.Drawing.Size(800, 450);
Controls.Add(reoGridControl1);
Name = "SpreadSheet";
Text = "SpreadSheetForm";
ResumeLayout(false);
}
private unvell.ReoGrid.ReoGridControl reoGridControl1;
}
}
Modify the entry point to use the form:
using System;
using System.Windows.Forms;
namespace BugReport {
static class Program {
[STAThread]
static void Main() {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new SpreadSheet());
}
}
}
Start the application and type in any cell
=TryOut() -> Works, the function is called and returns Called with empty!.
=TryOut("Foo") -> Works, the function is called and returns Called with 1 arg!.
=TryOut("Foo", "Bar") -> Does not work, the function is never called, the cell remains empty.
=TryOut("Foo"; "Bar") -> Does not work, the function is never called, the cell remains empty.
=TryOut("Foo","Bar") -> Does not work, the function is never called, the cell remains empty.
=TryOut("Foo";"Bar") -> Does not work, the function is never called, the cell remains empty.
Edition
Which edition of ReoGrid do you using?
[X] Windows Form
[ ] WPF
[ ] Android
Environment:
Windows 10 (1903, Enterprise Edition)
Language of OS: English, Regional Settings "de-CH" with user override.
Additional context
n/a
The text was updated successfully, but these errors were encountered:
Look here, the same error was described, but with IF function.
I take each comma separated by one space, i.e. =TryOut(A1[space],[space]",") ---> =TryOut(A1 , ",")
Custom functions with more than 1 argument are never executed, or the argument delimiter is too hard to guess. I tried
","
,";"
,", "
,"; "
,"|"
,"| "
). (I would expect that at least the 1st 4 delimiters would work.)E.g. if I call my custom function
TryOut
with=TryOut(A1)
, everything is fine. Do I call it with=TryOut(A1, ",")
the function is never called. I also noticed that all examples of custom functions are only with one argument, but the interface is clearly made for multiple arguments as they are returned asobject[]
.To Reproduce
TryOut
:=TryOut()
-> Works, the function is called and returnsCalled with empty!
.=TryOut("Foo")
-> Works, the function is called and returnsCalled with 1 arg!
.=TryOut("Foo", "Bar")
-> Does not work, the function is never called, the cell remains empty.=TryOut("Foo"; "Bar")
-> Does not work, the function is never called, the cell remains empty.=TryOut("Foo","Bar")
-> Does not work, the function is never called, the cell remains empty.=TryOut("Foo";"Bar")
-> Does not work, the function is never called, the cell remains empty.Edition
Which edition of ReoGrid do you using?
[X]
Windows Form[ ]
WPF[ ]
AndroidEnvironment:
Additional context
n/a
The text was updated successfully, but these errors were encountered: