上一篇主題 :: 下一篇主題 |
發表人 |
內容 |
Wayne-007
註冊時間: 2004-01-22 文章: 23
第 1 樓
|
發表於: 星期二 九月 21, 2004 5:23 pm 文章主題: 請教各位前輩 報表問題 |
|
|
我在Form裡面的Grid有很多筆資料
我想將某一筆的資料傳到報表,然後列印出來
如果是用...已存在的報表格式(非虛擬報表)
那程式該如何寫呢?
找過很多相關文章,但仍然沒找到我要的需求之文章
希望各位前輩幫不吝嗇我解答問題 *^^*
先謝謝各位前輩囉 *^^* |
|
回頂端 |
|
 |
LKH
註冊時間: 2004-09-17 文章: 31 來自: 香港
第 2 樓
|
發表於: 星期二 九月 21, 2004 9:28 pm 文章主題: |
|
|
1. click grid 的某一行選取想列印的資料
2. 將該資料暫存在一個 work file (例如 一個 free table)
3. 設定 報表的 data environment 為該 free table, 報表便會印出該筆資料 _________________ 謝謝賜教 |
|
回頂端 |
|
 |
Wayne-007
註冊時間: 2004-01-22 文章: 23
第 3 樓
|
發表於: 星期二 九月 21, 2004 9:43 pm 文章主題: |
|
|
LKH前輩...
可不可以請你寫一個範例
因為我是初學者啊
LKH前輩...麻煩你囉 *^^* |
|
回頂端 |
|
 |
cityhe4520
註冊時間: 2004-09-15 文章: 28
第 4 樓
|
發表於: 星期二 九月 21, 2004 11:28 pm 文章主題: |
|
|
你可以先開一個暫存檔, 再將那筆資料寫到暫存檔中才列印
例如 :
原本的 grid 的 table 是 table1, 暫存檔是 table2
首先你要知你是第幾筆資料, 如那筆資料是第三筆
nRec = 3
Sele table1
go nRec
Scatter memvar
Scatter memvar memo && 如有 memo field 位才要有這句
Sele table2
appe blank
Gather memvar
Gather memvar memo && 如有 memo field 位才要有這句
report form xxxxxxx.fpt preview
...
...
*註 : 假設你兩個table 都是相同欄位*
希望可以幫到你 |
|
回頂端 |
|
 |
BIN

註冊時間: 2004-07-22 文章: 94 來自: Tainan, Taiwan
第 5 樓
|
發表於: 星期三 九月 22, 2004 11:40 am 文章主題: |
|
|
這是另一種方式,
可以用SQL指令直接產生只有該筆資料的暫存表格,
給報表用即可... |
|
回頂端 |
|
 |
215001
註冊時間: 2003-06-11 文章: 393
第 6 樓
|
發表於: 星期三 九月 22, 2004 1:43 pm 文章主題: |
|
|
可試看看:
Report form test next 1 to printer preview
NEXT 1 表示只印目前這一筆 |
|
回頂端 |
|
 |
Wayne-007
註冊時間: 2004-01-22 文章: 23
第 7 樓
|
發表於: 星期三 九月 22, 2004 5:44 pm 文章主題: |
|
|
我將Report form test next 1 to printer preview 改為如下
Report form test next 3 to printer preview
卻會印出第1筆到第3筆的資料,怎麼會這樣呢?
如果我在Grid中...想印游標擺放地方的那一筆,那程式該如何修改呢?
215001前輩...我還是個初學者,這個問題就麻然你囉 *^^*
在此先謝謝各位前輩幫我解答 |
|
回頂端 |
|
 |
syntech
註冊時間: 2003-05-16 文章: 4249 來自: Taipei,Taiwan
第 8 樓
|
發表於: 星期三 九月 22, 2004 6:18 pm 文章主題: |
|
|
初學者?
我看下一次可能就沒人理了
---------------------------
取自VFP HELP
Scope Clauses
See Also
If a Visual FoxPro command has a Scope clause, you can specify a record range for the command to act on by replacing Scope with one of the clauses in the following table.
Scope clause Effect
ALL Command affects all records in the table.
NEXT nExpr Command affects a range of records beginning at the current record and continuing for the specified number of records.
For instance, the following example acts on the current record and the two following records:
REPLACE status WITH "open" NEXT 3
RECORD nNumber Command affects only the specified record number.
The following example acts on record five.
REPLACE status WITH "open" RECORD 5
REST Command affects a range of records beginning with the current record and ending with the last record in the table.
The following example stores a null value in the remaining records.
REPLACE status WITH .NULL. REST _________________ 如果公司有下列困擾:
1. 找不到便宜,快速,簡易的 生產排程軟體
2. 不知道如何快速排定 採購計劃
3. 成本抓不準,自己算比軟體算有用
4. 想學習系統規劃,想找系統架構的顧問
請聯絡我們,也許我們幫得上忙 |
|
回頂端 |
|
 |
215001
註冊時間: 2003-06-11 文章: 393
第 9 樓
|
發表於: 星期四 九月 23, 2004 9:02 am 文章主題: |
|
|
還是這句話:
Report form test next 1 to printer preview |
|
回頂端 |
|
 |
|