How do you define multiple style values for REPORTVIEW Control in Dialogs?
I want to define each style value and combine them together using | but i just get Bad or missing Style attribute in definition variable.
MyDialog004=`011,011,450,200,REPORTVIEW,"ReportView_1",arrArray,DEFAULT,DEFAULT,30,1048576|8388608,DEFAULT,DEFAULT,"192|192|192"`
I have gone through all the example code using REPORTVIEW and everyone has manually added the style values together and included the result?
MyDialog004=`011,011,450,200,REPORTVIEW,"ReportView_1",arrArray,DEFAULT,DEFAULT,30,9437184,DEFAULT,DEFAULT,"192|192|192"`
I have also tried assigning the Style total to a variable but again I keep getting the same error?
I know I am doing something wrong but I can't see what?
Thanks
Quote from: IJRobson on November 19, 2014, 10:10:52 AM
How do you define multiple style values for REPORTVIEW Control in Dialogs?
I want to define each style value and combine them together using | but i just get Bad or missing Style attribute in definition variable.
MyDialog004=`011,011,450,200,REPORTVIEW,"ReportView_1",arrArray,DEFAULT,DEFAULT,30,1048576|8388608,DEFAULT,DEFAULT,"192|192|192"`
The Dialog template control definition is just a coma delimited string. The template parser expects the style item to be a number consisting of digits 0-9. Obviously a vertical bar (|) is not a digit so the parser can't convert it to a style.
Quote
I have gone through all the example code using REPORTVIEW and everyone has manually added the style values together and included the result?
MyDialog004=`011,011,450,200,REPORTVIEW,"ReportView_1",arrArray,DEFAULT,DEFAULT,30,9437184,DEFAULT,DEFAULT,"192|192|192"`
That is the way to go.
Quote
I have also tried assigning the Style total to a variable but again I keep getting the same error?
Variable names are not a string of digits so the parser can't convert them to styles.
Quote
I know I am doing something wrong but I can't see what?
You have two choices. You can add the styles as a single number to the control definition string. Note that the Dialog Editor does this for you. Or you can Bitwise-OR the desired values together and assign them to a variable. You then would need to use variable substitution in the control definition string. Something like
nStyle = 1048576|8388608
MyDialog004=`011,011,450,200,REPORTVIEW,"ReportView_1",arrArray,DEFAULT,DEFAULT,30,%nStyle%,DEFAULT,DEFAULT,"192|192|192"`
The second choice is not recommended because the substitution will be removed by Dialog Editor, if you try to edit the dialog template at a later date and because it may not be completely compatible with future versions of the dialog template.
I understand.
Thanks