ReoGrid icon indicating copy to clipboard operation
ReoGrid copied to clipboard

Unable to Get Simple Script to Work

Open abstractspoon opened this issue 2 years ago • 2 comments

Hi Unvell

I've spent a couple of evenings trying to make progress with scripting but without luck.

I'm running the Winforms Editor Project with EX_SCRIPT defined. image

and have entered the following script (from the documentation) into the Script Editor:

// get current worksheet
var worksheet = workbook.currentWorksheet;

var dataRange = new worksheet.Ranges["B3:F5"];
var serialNamesRange = worksheet.Ranges["A3:A6"];
var categoryNamesRange = worksheet.Ranges["B2:F2"];

worksheet.AddHighlightRange(categoryNamesRange);
worksheet.AddHighlightRange(serialNamesRange);
worksheet.AddHighlightRange(dataRange);

but when I attempt to 'run' the script I just get:

error: Attempt to access undefined array or object

image

Is the documentation out of date or am I doing something wrong?

abstractspoon avatar May 14 '22 07:05 abstractspoon

You can't run C# code from the Script Editor, which can only run the ReoScript code. See https://reogrid.net/document/script-execution/

jingwood avatar May 14 '22 11:05 jingwood

Many thanks for the redirection.

abstractspoon avatar May 15 '22 07:05 abstractspoon

T

---Original--- From: @.> Date: Thu, Jan 12, 2023 12:59 PM To: @.>; Cc: @.***>; Subject: Re: [unvell/ReoGrid] Unable to Get Simple Script to Work (Issue #465)

Closed #465 as completed.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

qq8344310 avatar Jan 12 '23 05:01 qq8344310