Bar code types

Stimulsoft Reports.WPF discussion
Post Reply
kro
Posts: 27
Joined: Fri Oct 19, 2012 11:25 am

Bar code types

Post 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?
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Bar code types

Post 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.
kro
Posts: 27
Joined: Fri Oct 19, 2012 11:25 am

Re: Bar code types

Post by kro »

It seems that this is what I will have to do.

Thank you for your reply.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Bar code types

Post by HighAley »

Hello.

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

Thank you.
Post Reply