Page 1 of 1

Barcode value during runtime

Posted: Tue Oct 11, 2011 5:02 am
by bergloman02
hello

I need to intercept the value of the rendered barcode control - the first one if there are more than one.
I tried to access the component after the report has been rendered, but the value I get is always the default designer value "1234567890123"

my code looks like this:

Code: Select all

var rep = new StiReport();
rep.Load(...);
Rep.Render();


var collection = rep.GetComponents();
foreach (var c in collection) {
	if (c is Stimulsoft.Report.BarCodes.StiBarCode) {
		var bc = (c as Stimulsoft.Report.BarCodes.StiBarCode);
		return bc.Code.Value; 
		// return bc.GetBarCodeString();
	}
}
How can I get the value of the rendered barcode?
any help appreciated

Barcode value during runtime

Posted: Wed Oct 12, 2011 3:21 am
by HighAley
Hello.

You get default designer value because you get components from the report template.
To get rendered barcode, please, try to use this code:

Code: Select all

rep.RenderedPages.GetComponentByName("BarCode1");
Thank you.

Barcode value during runtime

Posted: Thu Oct 13, 2011 2:13 am
by bergloman02
excellent!
it works as desired.

thank you very much

Barcode value during runtime

Posted: Thu Oct 13, 2011 10:31 pm
by Andrew
Hello,

Perfect!

Have a nice day!
Thank you.