Question
“How do I launch the label wizard directly in code without having to go through the designer?”
Solution
Do this by manually creating a TppLabelTemplateWizard object and executing it. Then it is up to you to manually create the report in code based on the user selections.
Download: LaunchLabelWizardInCode.zip
Sample Delphi code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
uses ppLabWiz; procedure TForm1.btnLaunchWizardClick(Sender: TObject); var lWizard: TppLabelTemplateWizard; begin //See the attached example for sample implementations of the routines below. lWizard := TppLabelTemplateWizard.Create(Self); lWizard.OnCreateReport := CreateReportEvent; FReport := nil; if (lWizard.Execute) then begin {add code here to create the layout} AddComponentsToDetail(FReport); FReport.Print; end; lWizard.Free; FReport.Free; end; |