Download List & Lab el 1 5
Transcript
Object Model for Projects - DOM*
Your
benefit
You
offerth
con
eusers
venienc
ewitha luxurious
beingm
djus
adealm
ostauto tments
maticall
y
Manage Designer properties via code
Experience boundless opportunities,withthedynamiccrea-
How about a project assistant thatadaptstheprojecttem-
tionofprojects,withyourownprojectwizardoraslimmed-down
Designer.With.NETandVCLitisexceptionallysmooth,anditworks
justaswellwithotherprogramminglanguages.Alternatively the
other way round!Properties,individualobjectsandevencompleteprojectscanbesimplygeneratedasDOMcodefor.NET.
platestotheenduser'srequirementsevenbeforetheDesigner
opens?Thatmeans,forexample,thatanenduseronlyselectscertainfieldsfromyourdatabaseforaninvoice,andbyopeningthe
Designer,theinvoiceprojectispracticallyreadywithaddressfield
anditemlistalreadyfilledout.
“Createanewprojectincludingareportcontainerand
table,calledProducts,andfields”,hereinC#:
Inthismanner,allsumvariablescanbeoutput,hereinDelphi:
Proj.Open(@"c:\Reports\product.lst", LlDomFileMode.Create,
LlDomAccessMode.ReadWrite, true);
domPrjList.Open('article.lst',
DomObjectReportContainer container=new
DomObjectReportContainer (Proj.Objects);
container.Position.Left = "0";
container.Position.Top = "0";
container.Position.Width = "150000";
container.Position.Height = "200000";
DomSubItemTable table = new DomSubItemTable
(container.SubItems);
table.TableID = "Products";
DomTableLineData dataLineNew = new
DomTableLineData(table.Lines.Data);
dataLineNew.Name = "Created dynamically" ;
DomTableFieldText textCol = new
DomTableFieldText (dataLineNew.Fields);
textCol.Contents = "Product.No" ;
DomTableFieldBarcode barcodeCol = new
DomTableFieldBarcode (dataLineNew.Fields);
barcodeCol.Contents = "Barcode(Product.No, 'PDF417')";
Proj.Save();
Proj.Close();
fmOpenOrCreate);
for i := 0 to domPrjList.SumVariableList.Count - 1 do
ShowMessage(domPrjList.SumVariableList[i].Name + '=' +
domPrjList.SumVariableList[i].Content);
domPrjList.Close;
Thisishoweachfirstparagraphofatextobjectisoutput:
domPrjList.Open('article.lst', fmOpenOrCreate);
for i := 0 to domPrjList.ObjectList.Count - 1 do
begin
if domPrjList.ObjectList[i] is TLlDOMObjectText then
ShowMessage((domPrjList.ObjectList[i] as
TLlDOMObjectText).Paragraphs[0].Contents);
end;
domPrjList.Close;
*intheProfessionalandEnterpriseEdition
15
15