全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:21019
推到 Plurk!
推到 Facebook!

Crystal Report Sorting Problem...

尚未結案
GDMichael
一般會員


發表:27
回覆:36
積分:12
註冊:2004-10-13

發送簡訊給我
#1 引用回覆 回覆 發表時間:2004-11-05 11:50:32 IP:203.185.xxx.xxx 未訂閱
strSQL := 'Select Participant.Participant_ID, '; strSQL := strSQL 'Chinese_Name, Surname, First_Name, Delivery_Address, Participant_No, '; strSQL := strSQL 'Max(Participant_Activity.Input_DateTime) '; strSQL := strSQL 'From Participant Left Join Participant_Activity '; strSQL := strSQL 'On (Participant.Participant_ID = Participant_Activity.Participant_ID) '; strSQL := strSQL 'Where Participant.Status = 1 '; strSQL := strSQL 'Group By Participant.Participant_ID '; strSQL := strSQL 'Order By UCase(Surname) Asc, UCase(First_Name) Asc'; With qqyOperatePrint Do Begin Close; SQL.Clear; SQL.Text := strSQL; Open; First; intTotalRecCounter := 0; intTempCounter := 0; frmMain.crp.Clear; frmMain.crp.ReportName := strBasePath strReportDir 'labelex4.rpt'; frmMain.crp.Refresh; While Not (Eof) Do Begin Inc(intTotalRecCounter); Inc(intTempCounter); frmMain.crp.ParamByName('Participant ID', '').CurrentValues.Add(FieldByName('participant_id').AsString); Next; If (intTempCounter = 800) Then Begin frmMain.crp.Execute; If Not (Eof) Then Begin frmMain.crp.Clear; frmMain.crp.ReportName := strBasePath strReportDir 'labelex4.rpt'; frmMain.crp.Refresh; End; intTempCounter := 0; End; End; 這是我的code,由於以我所知,crystal report 最多只要show 800條record,所以code就要以800做一個break 我個問題係,當我顯示全部的report後,發覺第一份report會由A..Z,而第2份又會由A..Z,那不是有問題嗎?因為我想順序去排列,應該第一份report會係全部A..到最後那一份report會是Z 請問為何呢?
bennykyp
一般會員


發表:11
回覆:31
積分:8
註冊:2004-10-21

發送簡訊給我
#2 引用回覆 回覆 發表時間:2004-11-09 17:40:20 IP:218.208.xxx.xxx 未訂閱
procedure TMain.btnOKClick(Sender: TObject); var cnt: integer; begin with Crpe1 do begin SortFields.Retrieve; for cnt := 0 to (SortFields.Count - 1) do begin SortFields[cnt].DeleteSF := True; end; SortFields.Add(SortFields.Count); SortFields.Field := '{Report.Surname}'; //報表的 Field SortFields.Direction := sdDescending; Output := toWindow; Execute; end; end; 不知能不能幫到你
系統時間:2024-05-19 2:18:31
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!