Page 1 of 1
Check if a report variable is used in the report
Posted: Tue Jan 29, 2013 7:42 am
by Fabio Pagano
Good morning.
I need to programmatically check (eg. From Visual Basic or C#) if a report variable present in the dictionary is effectively used (designed)in the report.
Is there a way to do this?
Thank you.
Re: Check if a report variable is used in the report
Posted: Wed Jan 30, 2013 7:44 am
by HighAley
Hello.
Fabio Pagano wrote:I need to programmatically check (eg. From Visual Basic or C#) if a report variable present in the dictionary is effectively used (designed)in the report.
Is there a way to do this?
Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?
Thank you.
Re: Check if a report variable is used in the report
Posted: Wed Jan 30, 2013 2:11 pm
by Fabio Pagano
In the dictionary of our reports we have report variables, that the user may or may not use in the report.
I need to programmatically know if a report variable is used in the report: in this case, when i pass data to the report, I will not assign values to these report variables because some of them are images and may be very large, so my intention is to pass the values to the report variables only if needed, that is only if they are effectively designed in the report.
Thank you.
Re: Check if a report variable is used in the report
Posted: Thu Jan 31, 2013 10:10 am
by HighAley
Hello.
Fabio Pagano wrote:In the dictionary of our reports we have report variables, that the user may or may not use in the report.
I need to programmatically know if a report variable is used in the report: in this case, when i pass data to the report, I will not assign values to these report variables because some of them are images and may be very large, so my intention is to pass the values to the report variables only if needed, that is only if they are effectively designed in the report.
Unfortunately, there is no build-in methods. But you could run throw all components of the report and check if there any variable is used.
Thank you.
Re: Check if a report variable is used in the report
Posted: Thu Jan 31, 2013 10:24 am
by Fabio Pagano
Good morning.
But you could run throw all components of the report and check if there any variable is used.
Do you kindly have a sample code?
Thank you.
Re: Check if a report variable is used in the report
Posted: Fri Feb 01, 2013 2:14 pm
by HighAley
Hello.
Next code sample will help you:
Code: Select all
foreach (StiComponent comp in rep.GetComponents())
{
IStiFont fnt = comp as IStiFont;
if (fnt != null)
{
fnt.Font = StiFontUtils.ChangeFontName(fnt.Font, "Courier New");
}
}
Thank you.