Hi,
I would like to place a form onto my report which would list the Barcode types available in the report, upon selecting a barcode type from a Lookup Box on a Form, the barcode type would be altered on the report.
How can I generate the list of Barcode types and what would i need to cast the result into to correctly assign the type to the Barcode on my final report?
Many Thanks
Simon
Returning List of Barcode Types
Re: Returning List of Barcode Types
Hello, Simon.
Thank you.
You can get list of all Bar Code services with next code:SWhitty wrote:I would like to place a form onto my report which would list the Barcode types available in the report, upon selecting a barcode type from a Lookup Box on a Form, the barcode type would be altered on the report.
How can I generate the list of Barcode types and what would i need to cast the result into to correctly assign the type to the Barcode on my final report?
Code: Select all
StiServiceContainer services = StiConfig.Services.GetServices(typeof(StiBarCodeTypeService));
Re: Returning List of Barcode Types
Thats fantastic, thank you very much.
For anyone reading this in the future:
For anyone reading this in the future:
Code: Select all
using Stimulsoft.Report.BarCodes;
using Stimulsoft.Base.Services;
namespace Reports
{
public class Report : Stimulsoft.Report.StiReport
{
StiServiceContainer services = StiConfig.Services.GetServices(typeof(StiBarCodeTypeService));
private void showBarcodeTypes()
{
foreach (object o in services)
{
rtnstr += rtnstr == "" ? o.ToString() : System.Environment.NewLine + o.ToString();
}
MessageBox.Show(rtnstr);
}
private void setBarcodeType()
{
string selected = "Code11";
foreach (StiBarCodeTypeService s in services)
{
if (s.ToString() == selected)
{
BarCode1.BarCodeType = s;
}
}
}
public Report()
{
this.InitializeComponent();
}
#region StiReport Designer generated code - do not modify
#endregion StiReport Designer generated code - do not modify
}
}
Re: Returning List of Barcode Types
Hello.
Thank you for your code.
It will be useful for newcomers.
Do not hesitate to ask other questions.
Thank you.
Thank you for your code.
It will be useful for newcomers.
Do not hesitate to ask other questions.
Thank you.