一
一叶风铃
Unregistered / Unconfirmed
GUEST, unregistred user!
请教各位一个问题.<br>很急的问题.<br>我想在FASTREPORT报表中写好有参数的SQL语句.<br>打印报表的时候.我只要传入参数?<br>这个想法可不可以实现<br>如果可以实现<br>怎么去实现他.<br><br>我现在碰到的总是<br>报表中两个QUERY<br>QUERY1.SQL := SELECT SS_ID, COMP_ID, DEST_COMP_ID, SS_DOC_NO, SS_WAYBILLNO,<br> PORT_CODE, PORT_NAME, CAR_HK_PLATE, CAR_CS_PLATE, CAR_CUSTOMSNUM,<br> CAR_DRIVER, CAR_MAXVOL, CAR_W_MAX, DCL_DATE, SS_KJ1, SS_KJ2, SS_KJ3,<br> SS_D_TYPE, SS_PCS_TOTAL, SS_W_TOTAL, SS_VALUE_TOTAL, SS_BARGAIN_CU,<br> SS_SPY_CU, SS_ORIGIN, SS_DEST, PRINT_COUNT, IS_CHECK_OVER, SS_LOCK,<br> SS_CANCELED, IS_CHECKING, CHECKER_CODE, CHECKER, CHCK_OVER_TIME,<br> IS_CALC_OTHER_FEE, REMARK, CREATER, CREATETIME, EDITOR, EDITTIME,<br> BAK_FIELD1, SS_LOADING, SS_UNLOADING, IS_V_CUST,<br> DEST_COMP_NAME = (SELECT TOP 1 COMP_NAME FROM TB_COMPANY_INFO WHERE COMP_ID = S.DEST_COMP_ID)<br>FROM TB_SHIPMENTS S<br>WHERE COMP_ID = 105 AND SS_DOC_NO = '200801100002'<br> AND IS_CHECK_OVER = 0<br><br>QUERY2.SQL := SELECT SWB_ID, SOURCE_COMP_ID , COMP_ID , SS_ID , SS_DOC_NO , SS_WAYBILLNO ,<br> MASTER_BILL_ID , MAIN_BILL, HB_SS_ID, HB_SS_HBNO, SWB_DCL_CODE ,<br> SWB_DCL_GDS_NAME ,SWB_DCL_GDS_CODE , HS_CODE , BRAND , STYLE,<br> SPECIFICATIONS , DCL_CALC_TYPE , DCL_CALC_TYPE_DESCR , SWB_CTNS ,<br> SWB_PCS , SWB_UNIT , SWB_GW , SWB_NW , RATE_CODE , RATE_EX_IM ,<br> SWB_U_PRICE , SWB_AMOUNT , SWB_DCL_TYPE , SWB_DCL_STATE , SWB_V_SHIP ,<br> SWB_V_SHIP_ADDR, SWB_V_CNEE, SWB_V_CNEE_ADDR , SWB_DCL_DATE ,<br> REMARK , CREATER , CREATETIME , EDITOR , EDITTIME, BAK_FIELD1<br> FROM DBO.TB_SUB_WAYBILL A<br>WHERE COMP_ID = :COMP_ID(来于QUERY1)<br>AND SS_DOC_NO = :SS_DOC_NO(来于QUERY1)<br><br><br>报表的OnActivate事件<br>begin<br> STR := 'SELECT SS_ID, COMP_ID, DEST_COMP_ID, SS_DOC_NO, SS_WAYBILLNO,'+<br> 'PORT_CODE, PORT_NAME, CAR_HK_PLATE, CAR_CS_PLATE, CAR_CUSTOMSNUM,'+<br> 'CAR_DRIVER, CAR_MAXVOL, CAR_W_MAX, DCL_DATE, SS_KJ1, SS_KJ2, SS_KJ3,'+<br> 'SS_D_TYPE, SS_PCS_TOTAL, SS_W_TOTAL, SS_VALUE_TOTAL, SS_BARGAIN_CU,'+<br> 'SS_SPY_CU, SS_ORIGIN, SS_DEST, PRINT_COUNT, IS_CHECK_OVER, SS_LOCK,'+<br> 'SS_CANCELED, IS_CHECKING, CHECKER_CODE, CHECKER, CHCK_OVER_TIME,'+<br> 'IS_CALC_OTHER_FEE, REMARK, CREATER, CREATETIME, EDITOR, EDITTIME,'+<br> 'BAK_FIELD1, SS_LOADING, SS_UNLOADING, IS_V_CUST,'+<br> 'DEST_COMP_NAME = (SELECT TOP 1 COMP_NAME FROM TB_COMPANY_INFO WHERE COMP_ID = S.DEST_COMP_ID)'+<br>'FROM TB_SHIPMENTS S WHERE COMP_ID = '+[STR([dxMemData1."comp_id"])]"](外面传进来的)+<br>' AND SS_DOC_NO = '''+[dxMemData1."SS_DOC_NO"](外面传进来的)+<br>''' AND IS_CHECK_OVER = 0';<br> Q_SHIPMENT.SQL := STR;<br><br> ModalResult := mrok;<br>end<br><br><br>报表打印时我的参数传不进来..<br><br>QQ154162809