Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Evaluate.. Let... Variables... Lost!

Featured Replies

Friends,

 

I have had it for today... can't seem to get it right...

 

I'm writing an Excel sheet using the MBS plugin.

The plugin let's me set FORMATS so I can underline or center cells etc.

For every FORMAT I declare a variabel i.e. that gets a value from the plugin

$$Format1 = 89

$$Format2 = 90

 

I pull data from FMPro and 'filling' up an Excel Template with field values.

Some of these field's need formatting.

Since all data is dynamic, my script needs to handle this accordingly.

 

I 'build' the excel sheet row-by-row, therefore pulling data from FMPro, row-by-row.

A VARIABLE is handeling the data in the LOOP...The variable content looks like:

 

"7" & "|" & "FM08_SAMPLE::ID_NUMERIC" & "|" & "FORMAT1" & "¶" & 
"8" & "|" & "FM08_SAMPLE::FM08_Sample_date" & "|" & "FORMAT2" & "¶" & 
"9" & "|" & "FM08_CUSTOMER::COMPANY_NAME" & "|" & "FORMAT1"

 

In the script the data is pulled apart, set to the right CELL and a FORMAT needs to be applied.

 

Now, here's my question, I need to have this function filled:  

 

MBS( "XL.Sheet.CellWriteText"; $$MBS; 0; ROW ;COLUMN; VALUE; FORMAT) 

 

Where format of course should not be "FORMAT1" but "89"...

 

I tried things like:

 

Let ( [ 
 
STRING = GetValue ( $$D ; $$Tel );
COLUMN = Middle ( STRING ; 1 ;Position ( STRING ; "|" ; 1 ; 1 )-1) ;
WLENGTE = Position ( STRING ; "|" ; 1 ; 2 )- Position ( STRING ; "|" ; 1 ; 1 ) - 1;
WAARDE = GetField (Middle ( STRING ; Position ( STRING ; "|" ; 1 ; 1 )+1 ; WLENGTE));
FORMAT = Middle ( STRING ; Position ( STRING ; "|" ; 1 ; 2 )+1 ; 10);
VAR = "Let ( $$" & FORMAT & "; ")"
]
MBS( "XL.Sheet.CellWriteText"; $$MBS; 0; $$R ;COLUMN; WAARDE; Evalueren(VAR) ) )
 
But It does not work... where do I go wrong??
 
Thanks, Jeroen

 

  • Author

Ok... this how it works... you try to find a solution for 5 long hours...

Finally decide to post tot fmforums...

And than within 20 min. you fix your own problem... 

crazy!!

 

It's way easier than I thought....

 

Let ( [ 
 
STRING = GetValue ( $$D ; $$Tel );
COLUMN = Middle ( STRING ; 1 ;Position ( STRING ; "|" ; 1 ; 1 )-1) ;
WLENGTE = Position ( STRING ; "|" ; 1 ; 2 )- Position ( STRING ; "|" ; 1 ; 1 ) - 1;
WAARDE = GetField (Middle ( STRING ; Position ( STRING ; "|" ; 1 ; 1 )+1 ; WLENGTE));
FORMAT = Middle ( STRING ; Position ( STRING ; "|" ; 1 ; 2 )+1 ; 10)
]
MBS( "XL.Sheet.CellWriteText"; $$MBS; 0; $$R ;COLUMN; WAARDE; Evalueren(FORMAT) ) )
 
Works like a charm...
Filling template excel sheet with the MBS plugin is great!!
Ok.. a little support for Christian here ;-)
 
Jeroen

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.