Barcode value during runtime

Stimulsoft Reports.NET discussion
Post Reply
bergloman02
Posts: 2
Joined: Tue Oct 11, 2011 4:57 am

Barcode value during runtime

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

Barcode value during runtime

Post 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.
bergloman02
Posts: 2
Joined: Tue Oct 11, 2011 4:57 am

Barcode value during runtime

Post by bergloman02 »

excellent!
it works as desired.

thank you very much
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Barcode value during runtime

Post by Andrew »

Hello,

Perfect!

Have a nice day!
Thank you.
Post Reply