How can I change (in design) conditionally the text of a header?
How can I change (in design) conditionally the text of a header?
For example:
need to conditionally change the header of a report.
A code sample would be
IF Parameter.Value =0 THEN
Header.text='ALL'
Else
Header.text={FuenteDeDatos1.DescripcionFamilia}
END
Header.text is the value we want to show in report header
Parameter.Value is a parameter of report.
{FuenteDeDatos1.DescripcionFamilia} is a field of dataset of report (is the same throughout the report, it does no change)
Thanks for the help
need to conditionally change the header of a report.
A code sample would be
IF Parameter.Value =0 THEN
Header.text='ALL'
Else
Header.text={FuenteDeDatos1.DescripcionFamilia}
END
Header.text is the value we want to show in report header
Parameter.Value is a parameter of report.
{FuenteDeDatos1.DescripcionFamilia} is a field of dataset of report (is the same throughout the report, it does no change)
Thanks for the help
How can I change (in design) conditionally the text of a header?
Hello,
You can use following expression:
Thank you.
You can use following expression:
Code: Select all
{IIF(Parameter.Value = 0, "ALL", FuenteDeDatos1.DescripcionFamilia}
How can I change (in design) conditionally the text of a header?
Thank's but...
If i use a textbox and write this expression:
{IIF(FuenteDeDatos1.Parameters["@vIdFamilia"].ParameterValue= 0, "ALL", FuenteDeDatos1.DescripcionFamilia)}
I get the following errors messages:
c:\users\preguera\AppDAta\Local\Temp\bspildwl.0.cs(95,40): error CS1502: La mejor coincidencia de método sobrecargado para 'Stimulsoft.Report.StiReport.IIF(bool, object,object)' tiene algunos argumentos no válidos
c:\users\preguera\AppDAta\Local\Temp\bspildwl.0.cs(95,44): error CS1503: Argumento '1': nos epuede convertir de 'object' a 'bool'
Notes:
FuenteDeDatos1.Parameters["@vIdFamilia"].ParameterValue is defined as 'int'
FuenteDeDatos1.DescripcionFamilia is defined as 'sring'
If i use a textbox and write this expression:
{IIF(FuenteDeDatos1.Parameters["@vIdFamilia"].ParameterValue= 0, "ALL", FuenteDeDatos1.DescripcionFamilia)}
I get the following errors messages:
c:\users\preguera\AppDAta\Local\Temp\bspildwl.0.cs(95,40): error CS1502: La mejor coincidencia de método sobrecargado para 'Stimulsoft.Report.StiReport.IIF(bool, object,object)' tiene algunos argumentos no válidos
c:\users\preguera\AppDAta\Local\Temp\bspildwl.0.cs(95,44): error CS1503: Argumento '1': nos epuede convertir de 'object' a 'bool'
Notes:
FuenteDeDatos1.Parameters["@vIdFamilia"].ParameterValue is defined as 'int'
FuenteDeDatos1.DescripcionFamilia is defined as 'sring'
How can I change (in design) conditionally the text of a header?
Hello,
You need use following expression if your script language is C#:
Thank you.
You need use following expression if your script language is C#:
Code: Select all
{IIF(FuenteDeDatos1.Parameters["@vIdFamilia"].ParameterValue== 0, "ALL", FuenteDeDatos1.DescripcionFamilia)}
How can I change (in design) conditionally the text of a header?
The error persist.
Now the error is:
"c:\Users\preguera\AppData\Local\Temp\56ht_zhw.0.cs(95,44): error CS0019: El operador '==' no se puede aplicar a operandos del tipo 'object' y 'int'
The language I use is VB.net. However the sample code I provide is valid for simple assignments, but can be implemented as code more complex way?
"
dim a as integer
IF FuenteDeDatos1.Parameters["@vIdFamilia"].ParameterValue= 0 THEN
varA=FuenteDeDatos1.Price * FuenteDeDatos.Rate1
END IF
IF FuenteDeDatos1.Parameters["@vIdFamilia"].ParameterValue= 1 THEN
varA=FuenteDeDatos1.Price * FuenteDeDatos.Rate1 - FuenteDeDatos1.Price * FuenteDeDatos.Discount1 /100
END IF
IF FuenteDeDatos1.Parameters["@vIdFamilia"].ParameterValue= 2 THEN
varA=FuenteDeDatos1.Price2 * FuenteDeDatos.Rate1 - FuenteDeDatos1.Price2 * FuenteDeDatos.Discount2 /100
END IF
IF FuenteDeDatos1.Parameters["@vIdFamilia"].ParameterValue= 1 OR FuenteDeDatos1.Parameters["@vIdFamilia"].ParameterValue= 2 THEN
varA=varA + FuenteDeDatos1.Supplement
END IF
Texto.text= varA
"
How to implement all the code?
How I attach the result of this variable (in this example "varA") to the text of the report?
Thanks again and best regards
Now the error is:
"c:\Users\preguera\AppData\Local\Temp\56ht_zhw.0.cs(95,44): error CS0019: El operador '==' no se puede aplicar a operandos del tipo 'object' y 'int'
The language I use is VB.net. However the sample code I provide is valid for simple assignments, but can be implemented as code more complex way?
"
dim a as integer
IF FuenteDeDatos1.Parameters["@vIdFamilia"].ParameterValue= 0 THEN
varA=FuenteDeDatos1.Price * FuenteDeDatos.Rate1
END IF
IF FuenteDeDatos1.Parameters["@vIdFamilia"].ParameterValue= 1 THEN
varA=FuenteDeDatos1.Price * FuenteDeDatos.Rate1 - FuenteDeDatos1.Price * FuenteDeDatos.Discount1 /100
END IF
IF FuenteDeDatos1.Parameters["@vIdFamilia"].ParameterValue= 2 THEN
varA=FuenteDeDatos1.Price2 * FuenteDeDatos.Rate1 - FuenteDeDatos1.Price2 * FuenteDeDatos.Discount2 /100
END IF
IF FuenteDeDatos1.Parameters["@vIdFamilia"].ParameterValue= 1 OR FuenteDeDatos1.Parameters["@vIdFamilia"].ParameterValue= 2 THEN
varA=varA + FuenteDeDatos1.Supplement
END IF
Texto.text= varA
"
How to implement all the code?
How I attach the result of this variable (in this example "varA") to the text of the report?
Thanks again and best regards
How can I change (in design) conditionally the text of a header?
Hello,
Thank you.
You need convert ParameterValue to int type. For example:The error persist.
Now the error is:
"c:\Users\preguera\AppData\Local\Temp\56ht_zhw.0.cs(95,44): error CS0019: El operador '==' no se puede aplicar a operandos del tipo 'object' y 'int'
Code: Select all
{IIF((int)FuenteDeDatos1.Parameters["@vIdFamilia"].ParameterValue)= 0, "ALL", FuenteDeDatos1.DescripcionFamilia)}
You can use GetValue event of component. For example:The language I use is VB.net. However the sample code I provide is valid for simple assignments, but can be implemented as code more complex way?
"
dim a as integer
IF FuenteDeDatos1.Parameters["@vIdFamilia"].ParameterValue= 0 THEN
varA=FuenteDeDatos1.Price * FuenteDeDatos.Rate1
END IF
IF FuenteDeDatos1.Parameters["@vIdFamilia"].ParameterValue= 1 THEN
varA=FuenteDeDatos1.Price * FuenteDeDatos.Rate1 - FuenteDeDatos1.Price * FuenteDeDatos.Discount1 /100
END IF
IF FuenteDeDatos1.Parameters["@vIdFamilia"].ParameterValue= 2 THEN
varA=FuenteDeDatos1.Price2 * FuenteDeDatos.Rate1 - FuenteDeDatos1.Price2 * FuenteDeDatos.Discount2 /100
END IF
IF FuenteDeDatos1.Parameters["@vIdFamilia"].ParameterValue= 1 OR FuenteDeDatos1.Parameters["@vIdFamilia"].ParameterValue= 2 THEN
varA=varA + FuenteDeDatos1.Supplement
END IF
Texto.text= varA
"
How to implement all the code?
How I attach the result of this variable (in this example "varA") to the text of the report?
Code: Select all
IF Condition THEN e.Value = "STR1"
END IF
Thank you.
- Attachments
-
- 214.Sample.png (88.41 KiB) Viewed 4683 times