我承认我很菜,可是有时候调程序出问题就像见鬼一样。
  做了个报表,dataset是空的,放了若干个QRlabel,QRRichText,QRMemo控件, 在程序里改变这些控件的内容。运行预览显示正常。
  可是后来我在放报表的form上放了个Table,连接到某个库的某个表,然后运行预览,结果除了PageHeader 的Band上的控件内容显示出来,其他控件的内容都显示不出来。设计时预览也一样。
  然后我删掉这个Table,重新编译。结果还是一样,运行设计时预览都显示不出来。

解决方案 »

  1.   

    把QuickRep Delete了重来吧!
      

  2.   

    aaaa兄,上次那个帖子你也指点过偶的。偶因为没时间一直没管那个程序,今天是把程序
    大部分都重新写过的,所以一开始也没出问题。可最后还是冒出了老问题。unit rpt;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      Qrctrls, quickrpt, ExtCtrls, StdCtrls,
      h_Diary, Db, DBTables;type
      TForm1 = class(TForm)
        QuickRep1: TQuickRep;
        btnPreview: TButton;
        QRBand1: TQRBand;
        QRSysData1: TQRSysData;
        SPageNO: TQRSysData;
        QRShape1: TQRShape;
        TitleL1: TQRLabel;
        QRRichText1 : TQRRichText;
        QRMemo2 : TQRMemo;   
       procedure btnPreviewClick(Sender: TObject);
        Procedure test;
        procedure QuickRep1BeforePrint(Sender: TQuickRep;
          var PrintReport: Boolean);
        procedure QRBand2BeforePrint(Sender: TQRCustomBand;
          var PrintBand: Boolean);
      private
        { Private declarations }
          // For Save&Print
    //    Title : TStringList;
         Title : String;
         Memos : TStringList;
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation
     Uses MainGui;
    procedure TForm1.btnPreviewClick(Sender: TObject);
    begin  QuickRep1.Preview;
    end;procedure TForm1.QuickRep1BeforePrint(Sender: TQuickRep;
      var PrintReport: Boolean);
    Var i : Integer;
    begin
       Memos := TStringList.Create;
       QRMemo2.Lines.Clear;
       QRMemo2.Lines.Add(' ');
      
      With FormDynData Do Begin
        Title := PageControl1.ActivePage.Caption;
        Title := Title + '/' + PageControl2.ActivePage.Caption;
        Title := Title + '/' + PageControl13.ActivePage.Caption;
     
        QRRichText1.ParentRichEdit := FormDynData.RichEdit1; //QRRichText1放在Detail  
                                                                band 上
        Memos.Add (Label12.Caption + ': ' + ModuleNo.EditText + ' '
                   + Label13.Caption + ': ' + UnitNo.EditText + ' '
                   + Label14.Caption + ': ' + SunitNo.EditText + ' '
                   + Label15.Caption + ': ' + IndexNo.EditText + ' '
                   + Label11.Caption + ': ' + TelephoneNO.EditText);
       End;{with}   TitleL1.Caption := Title; // TitleL1放在Title Band上
       For i:= 0 To Memos.Count - 1 Do
          QRMemo2.Lines.Add(Memos.Strings[i]); //QRMemo2放在一个Child Band 上   Memos.Free;
    end;
      

  3.   

    但我不需要将dataset连接到某个table或query上啊。
    我报表上的内容全是静态控件完成的。
      

  4.   

    问题解决了。原来是报表属性中一个属性的问题。把PrintIfEmpty设为true就好了。