Page 1 of 1

Bar code types

Posted: Thu Mar 21, 2013 7:29 am
by kro
Hello

I have a question regarding the bar code component. Is it possible to set the bar code type according to the value of some variable in the dictionary?

For example, if the value of the variable is "x", then the bar code type should be EAN13, and if the value is "y", then the code should have some other type.

I know it is possible to set the bar code type in the Begin Render event of the report, for example like this:

Code: Select all

bc.BarCodeType = new Stimulsoft.Report.BarCodes.StiEAN13BarCodeType();
My problem then could be solved by something like this:

Code: Select all

if (someVariable == "x")
{
	bc.BarCodeType = new Stimulsoft.Report.BarCodes.StiEAN13BarCodeType();
}
else 
...
With a lot of types of bar codes, there will be a lof code that is difficult to maintain. So my question is: is there any other way to do this?

Re: Bar code types

Posted: Fri Mar 22, 2013 10:34 am
by HighAley
Hello.

For example, you could try to use Switch() function or any C# code. It's possible to use your functions.

Thank you.

Re: Bar code types

Posted: Fri Mar 22, 2013 10:48 am
by kro
It seems that this is what I will have to do.

Thank you for your reply.

Re: Bar code types

Posted: Fri Mar 22, 2013 1:56 pm
by HighAley
Hello.

We are always glad to help you.
Let us know if you will need any additional help.

Thank you.