IntraWeb使用技巧集

name="google_ads_frame" marginwidth="0" marginheight="0" src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-3528650120430763&dt=1183890684015&lmt=1183890684&format=468x60_as&output=html&correlator=1183890684000&url=http%3A%2F%2Fgmai9999.googlepages.com%2Fhome&ad_type=text_image&ui=rc%3A0&cc=100&flash=9&u_h=768&u_w=1024&u_ah=738&u_aw=1024&u_cd=32&u_tz=480&u_java=true" frameborder="0" width="468" scrolling="no" height="60" allowtransparency="allowtransparency"> 
1。打开新窗体
 begin
     If WebApplication.FindComponent('需要打开form的名称') <> Nil Then Begin
        TIWAppForm(WebApplication.FindComponent('需要打开form的名称')).Show;
     End Else Begin
        TIWEditfm(需要打开form的名称).Create(WebApplication).Show;
     End;
     release;
 end; 

2。退出
  WebApplication.Terminate('谢谢使用,再见');

3。取得根目录路径(uses  swsystem)
   pathstr := gsAppPath ;     //根目录路径
                     GSystemPath ;//系统路径
                     gsAppName;//程序名称    

4。使用模板
  在form上添加IWLayoutMgrHTML1,双击后直接编辑出网页,保存为filename.html(与filename.pas同名)
  然后将form的Lay OutMgr指向IWLayoutMgrHTML1即可。

name="google_ads_frame" marginwidth="0" marginheight="0" src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-0494631679463850&dt=1183254053140&lmt=1183254053&prev_fmts=120x600_as&format=468x60_as&output=html&correlator=1183254053031&url=http%3A%2F%2Fpages.google.com%2Fdraft%2FBlueStar.Skyking%2Fadsensepage%3Fauthtoken%3D91b825ffd39d84145aea501a0792e0ea1658201d&ad_type=text_image&ref=http%3A%2F%2Fpages.google.com%2Fpreview%2FBlueStar.Skyking%2Fadsensepage%3Fauthtoken%3D06516fbfa328a5527eb935f1e169cb23d43c0351%26no-cache%3D7350381924487911&flash=9&u_h=768&u_w=1024&u_ah=738&u_aw=1024&u_cd=32&u_tz=480&u_java=true" frameborder="0" width="468" scrolling="no" height="60" allowtransparency="allowtransparency">  

5。浏览DbGrid后导出EXCEL
procedure TFrmMain.BtnDSXLSClick(Sender: TObject);
var
  I: Integer;
  Str: String;
  StrList: TStringList;
  title,Xlsstr:string;
begin
SWsystem.gsAppName
   Xlsstr := GsAppPath+'Files/Tempxls/Data.xls';  //Excel文件临时存储位置
 try
  begin
      StrList := TStringList.Create;
        with DBGridDS do   //Dbgrid Name
        begin
           title:='';
           for i:=0 to Columns.Count-1 do
           begin
             title:=title+Columns.Items[i].DisplayName+#9;
           end;
          StrList.Add(title);
        end;

        with TIWUserSession(WebApplication.Data).DSMDS  do  //micel DataSetAcess
        begin
          First;
          while not Eof do
          begin
            Str := '';
            for I := 0 to FieldCount-1 do
            Str := Str + Fields[I].AsString + #9;
            StrList.Add(Str);
            Next;
          end;
          StrList.SaveToFile(Xlsstr);
          WebApplication.SendFile(Xlsstr,true,'','');
        end;
  end;
 finally
    Freeandnil(StrList);
end;
end;

6.待续。。。

  name="google_ads_frame" marginwidth="0" marginheight="0" src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-3528650120430763&dt=1183890684015&lmt=1183890684&format=468x60_as&output=html&correlator=1183890684000&url=http%3A%2F%2Fgmai9999.googlepages.com%2Fhome&ad_type=text_image&ui=rc%3A0&cc=100&flash=9&u_h=768&u_w=1024&u_ah=738&u_aw=1024&u_cd=32&u_tz=480&u_java=true" frameborder="0" width="468" scrolling="no" height="60" allowtransparency="allowtransparency"> 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值