Jump to content

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


This topic is 3380 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

This topic is 3380 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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