|
|
|

MapX应用教程(5)—输出

五、输出 1、属性的输出 输出到EXCEL表: For I=1 to Flds.Count Lyr.KeyFields=Flds.Item(i).Name Excel(1,I).Cell=Ftr.KeyValue Next 2、复制、粘贴 Global CopyFtrs AS MapXlib.Features Set lyr=mainmap.Layers.item(LayerName) Set Ftrs=Lyr.Sele...

作者:未知来源:网络|2006年12月25日
五、输出 xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
 
1、属性的输出   输出到EXCEL表: 
For I=1 to Flds.Count 
Lyr.KeyFields=Flds.Item(i).Name 
Excel(1,I).Cell=Ftr.KeyValue 
Next 
2、复制、粘贴 
Global CopyFtrs AS MapXlib.Features 
 
Set lyr=mainmap.Layers.item(LayerName) 
Set Ftrs=Lyr.Selection.Clone      ‘复制选中集合 
‘复制 
For I=1 to Ftrs.Count 
CopyFtrs.add Ftrs.Item(I) 
Next 
 
‘粘贴(必威现金回扣形) 
Set lyr_1=mainmap.Layers.item(LayerName_1) 
Mainmap.AutoRedraw=False 
Lyr_1.Editabled=True 
For J=1 to CopyFtrs.Count 
   Lyr_1.AddFeature CopyFtrs.Item(J) 
Next 
Lyr_1.Refresh 
Mainmap.AutoRedraw=True 
Lyr_1.Editabled=False 
 
3、地必威现金回扣的打印 
  Dim iScaleMode As Integer 
 
  iScaleMode = MainMap.Container.ScaleMode 
  MainMap.Container.ScaleMode = 6 
 
  On Error GoTo PrinterError 
   
  Printer.Print " " 
  Printer.CurrentX = 0 
  Printer.CurrentY = 0 
  MainMap.PrintMap Printer.hDC, 0, 0, MainMap.Width * 100, MainMap.Height * 10
0 
  Printer.NewPage 
  Printer.EndDoc 
  MainMap.Container.ScaleMode = iScaleMode 
  Exit Sub 
   
PrinterError: 
  If Err.Number = 482 Then 
     On Error Resume Next 
     CommonDialog1.Flags = &H40 
     CommonDialog1.ShowPrinter 
  Else 
     MsgBox "    打印机存在错误,请更正后重试。错误号:" + (Str(Err.Number)), 
, "失败" 
  End If 
 
4、另存为必威现金回扣片文件 
MainMap.ExportMap(App.Path+Images, miFormatJPEG)   ‘输出当前地必威现金回扣窗口 
参数设置:MainMap.ExportSelection=True   ‘将选中部分以不同于其他未选中地必威现金回扣部分

形式输出

上一篇:MapX应用教程(4)—对象编辑

下一篇:MapX应用教程(6)—专题必威现金回扣