What I want to do is:
1 - Open the designer with a default template.
2 - User would click on a button my "add barcode"
3 - Add a previously configured barcode field on the screen. (That part is the problem)
If I create the field before the designer is rendered I can see the component there. But the same code has no effect if the design is already loaded.
Code I used for testing:
Code: Select all
var designer = new Stimulsoft.Designer.StiDesigner(options, "StiDesigner", false);
// Create a new report instance
var report = new Stimulsoft.Report.StiReport();
// Load report from url
report.loadFile("./template.mrt");
// Edit report template in the designer
designer.report = report;
designer.renderHtml('design-container');
const page = report.pages.getByIndex(0);
var myText = new Stimulsoft.Report.Components.StiText(new Stimulsoft.System.Drawing.Rectangle(-0.5, page.height, 0.5, 15));
myText.text = "My sample text";
myText.font = new Stimulsoft.System.Drawing.Font("Arial", 8, "Point", 2);
myText.textOptions = new Stimulsoft.Base.Drawing.StiTextOptions();
myText.textOptions.angle = 90;
page.components.add(myText);
// If you change that line to here it works. But it's not what I need.
// designer.renderHtml('design-container');