⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jvinterpreter_quickrpt.pas

📁 East make Tray Icon in delphi
💻 PAS
📖 第 1 页 / 共 5 页
字号:
{-----------------------------------------------------------------------------
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/MPL-1.1.html

Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the License for
the specific language governing rights and limitations under the License.

The Original Code is: JvInterpreter_Quickrpt.PAS, released on 2002-07-04.

The Initial Developers of the Original Code are: Andrei Prygounkov <a dott prygounkov att gmx dott de>
Copyright (c) 1999, 2002 Andrei Prygounkov
All Rights Reserved.

Contributor(s):

You may retrieve the latest version of this file at the Project JEDI's JVCL home page,
located at http://jvcl.sourceforge.net

Description:
  adapter unit - converts JvInterpreter calls to delphi calls

Known Issues:
-----------------------------------------------------------------------------}
// $Id: JvInterpreter_Quickrpt.pas,v 1.20 2005/02/17 10:20:40 marquardt Exp $

unit JvInterpreter_Quickrpt;

{$I jvcl.inc}

interface

uses
  {$IFDEF UNITVERSIONING}
  JclUnitVersioning,
  {$ENDIF UNITVERSIONING}
  JvInterpreter;

procedure RegisterJvInterpreterAdapter(JvInterpreterAdapter: TJvInterpreterAdapter);

{$IFDEF UNITVERSIONING}
const
  UnitVersioning: TUnitVersionInfo = (
    RCSfile: '$RCSfile: JvInterpreter_Quickrpt.pas,v $';
    Revision: '$Revision: 1.20 $';
    Date: '$Date: 2005/02/17 10:20:40 $';
    LogPath: 'JVCL\run'
  );
{$ENDIF UNITVERSIONING}

implementation

uses
  SysUtils, Classes, Controls, Forms, Graphics, Db,
  {$IFDEF JVCL_UseQuickReport}
  QrPrntr, Quickrpt, QrCtrls,
  {$ENDIF JVCL_UseQuickReport}
  JvInterpreterFm, JvResources, JvTypes;

const
  cQuickRep1 = 'QuickRep1';

procedure JvInterpreterRunReportPreview(const FileName: string);
var
  Form: TForm;
  QuickRep1: TQuickRep;
  I: Integer;
begin
  Form := JvInterpreterMakeForm(FileName);
  try
    QuickRep1 := Form.FindComponent(cQuickRep1) as TQuickRep;
    if QuickRep1 = nil then
      for I := 0 to Form.ComponentCount - 1 do
        if Form.Components[I] is TQuickRep then
        begin
          QuickRep1 := Form.Components[I] as TQuickRep;
          Break;
        end;
    if QuickRep1 = nil then
      raise EJVCLException.CreateRes(@RsENoQuickReportFound);
    QuickRep1.Preview;
  finally
    Form.Free;
  end;
end;

procedure JvInterpreterRunReportPreview2(const FileName: string; JvInterpreterProgram: TJvInterpreterFm);
var
  Form: TForm;
  QuickRep1: TQuickRep;
  I: Integer;
begin
  Form := JvInterpreterProgram.MakeForm(FileName);
  try
    QuickRep1 := Form.FindComponent(cQuickRep1) as TQuickRep;
    if QuickRep1 = nil then
      for I := 0 to Form.ComponentCount - 1 do
        if Form.Components[I] is TQuickRep then
        begin
          QuickRep1 := Form.Components[I] as TQuickRep;
          Break;
        end;
    if QuickRep1 = nil then
      raise EJVCLException.CreateRes(@RsENoQuickReportFound);
    QuickRep1.Preview;
  finally
    Form.Free;
  end;
end;

{ TQRController }

{ constructor Create(AOwner: TComponent) }

procedure TQRController_Create(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := O2V(TQRController.Create(V2O(Args.Values[0]) as TComponent));
end;

{ procedure AddNotifyClient(Value: TQRPrintable); }

procedure TQRController_AddNotifyClient(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TQRController(Args.Obj).AddNotifyClient(V2O(Args.Values[0]) as TQRPrintable);
end;

{ property Read DataSet: TDataSet }

procedure TQRController_Read_DataSet(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := O2V(TQRController(Args.Obj).DataSet);
end;

{ property Write DataSet(Value: TDataSet) }

procedure TQRController_Write_DataSet(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TQRController(Args.Obj).DataSet := V2O(Value) as TDataSet;
end;

{ property Read DetailNumber: Integer }

procedure TQRController_Read_DetailNumber(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TQRController(Args.Obj).DetailNumber;
end;

{ property Read Detail: TQRCustomBand }

procedure TQRController_Read_Detail(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := O2V(TQRController(Args.Obj).Detail);
end;

{ property Write Detail(Value: TQRCustomBand) }

procedure TQRController_Write_Detail(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TQRController(Args.Obj).Detail := V2O(Value) as TQRCustomBand;
end;

{ property Read Footer: TQRCustomBand }

procedure TQRController_Read_Footer(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := O2V(TQRController(Args.Obj).Footer);
end;

{ property Write Footer(Value: TQRCustomBand) }

procedure TQRController_Write_Footer(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TQRController(Args.Obj).Footer := V2O(Value) as TQRCustomBand;
end;

{ property Read Header: TQRCustomBand }

procedure TQRController_Read_Header(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := O2V(TQRController(Args.Obj).Header);
end;

{ property Write Header(Value: TQRCustomBand) }

procedure TQRController_Write_Header(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TQRController(Args.Obj).Header := V2O(Value) as TQRCustomBand;
end;

{ property Read Master: TComponent }

procedure TQRController_Read_Master(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := O2V(TQRController(Args.Obj).Master);
end;

{ property Write Master(Value: TComponent) }

procedure TQRController_Write_Master(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TQRController(Args.Obj).Master := V2O(Value) as TComponent;
end;

{ property Read ParentReport: TQuickRep }

procedure TQRController_Read_ParentReport(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := O2V(TQRController(Args.Obj).ParentReport);
end;

{ property Write ParentReport(Value: TQuickRep) }

procedure TQRController_Write_ParentReport(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TQRController(Args.Obj).ParentReport := V2O(Value) as TQuickRep;
end;

{ property Read PrintBefore: Boolean }

procedure TQRController_Read_PrintBefore(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TQRController(Args.Obj).PrintBefore;
end;

{ property Write PrintBefore(Value: Boolean) }

procedure TQRController_Write_PrintBefore(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TQRController(Args.Obj).PrintBefore := Value;
end;

{ property Read PrintIfEmpty: Boolean }

procedure TQRController_Read_PrintIfEmpty(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TQRController(Args.Obj).PrintIfEmpty;
end;

{ property Write PrintIfEmpty(Value: Boolean) }

procedure TQRController_Write_PrintIfEmpty(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TQRController(Args.Obj).PrintIfEmpty := Value;
end;

{ property Read SelfCheck: TComponent }

procedure TQRController_Read_SelfCheck(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := O2V(TQRController(Args.Obj).SelfCheck);
end;

{ property Write SelfCheck(Value: TComponent) }

procedure TQRController_Write_SelfCheck(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TQRController(Args.Obj).SelfCheck := V2O(Value) as TComponent;
end;

{ TQRFrame }

{ constructor Create }

procedure TQRFrame_Create(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := O2V(TQRFrame.Create);
end;

{ function AnyFrame: Boolean; }

procedure TQRFrame_AnyFrame(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TQRFrame(Args.Obj).AnyFrame;
end;

{ property Read Parent: TControl }

procedure TQRFrame_Read_Parent(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := O2V(TQRFrame(Args.Obj).Parent);
end;

{ property Write Parent(Value: TControl) }

procedure TQRFrame_Write_Parent(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TQRFrame(Args.Obj).Parent := V2O(Value) as TControl;
end;

{ property Read Color: TColor }

procedure TQRFrame_Read_Color(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TQRFrame(Args.Obj).Color;
end;

{ property Write Color(Value: TColor) }

procedure TQRFrame_Write_Color(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TQRFrame(Args.Obj).Color := Value;
end;

{ property Read DrawTop: Boolean }

procedure TQRFrame_Read_DrawTop(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TQRFrame(Args.Obj).DrawTop;
end;

{ property Write DrawTop(Value: Boolean) }

procedure TQRFrame_Write_DrawTop(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TQRFrame(Args.Obj).DrawTop := Value;
end;

{ property Read DrawBottom: Boolean }

procedure TQRFrame_Read_DrawBottom(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TQRFrame(Args.Obj).DrawBottom;
end;

{ property Write DrawBottom(Value: Boolean) }

procedure TQRFrame_Write_DrawBottom(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TQRFrame(Args.Obj).DrawBottom := Value;
end;

{ property Read DrawLeft: Boolean }

procedure TQRFrame_Read_DrawLeft(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TQRFrame(Args.Obj).DrawLeft;
end;

{ property Write DrawLeft(Value: Boolean) }

procedure TQRFrame_Write_DrawLeft(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TQRFrame(Args.Obj).DrawLeft := Value;
end;

{ property Read DrawRight: Boolean }

procedure TQRFrame_Read_DrawRight(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TQRFrame(Args.Obj).DrawRight;
end;

{ property Write DrawRight(Value: Boolean) }

procedure TQRFrame_Write_DrawRight(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TQRFrame(Args.Obj).DrawRight := Value;
end;

{ property Read Style: TPenStyle }

procedure TQRFrame_Read_Style(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TQRFrame(Args.Obj).Style;
end;

{ property Write Style(Value: TPenStyle) }

procedure TQRFrame_Write_Style(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TQRFrame(Args.Obj).Style := Value;
end;

{ property Read Width: Integer }

procedure TQRFrame_Read_Width(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TQRFrame(Args.Obj).Width;
end;

{ property Write Width(Value: Integer) }

procedure TQRFrame_Write_Width(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TQRFrame(Args.Obj).Width := Value;
end;

{ TQRUnitBase }

{ constructor Create }

procedure TQRUnitBase_Create(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := O2V(TQRUnitBase.Create);
end;

{ property Read ParentReport: TQuickRep }

procedure TQRUnitBase_Read_ParentReport(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := O2V(TQRUnitBase(Args.Obj).ParentReport);
end;

{ property Write ParentReport(Value: TQuickRep) }

procedure TQRUnitBase_Write_ParentReport(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TQRUnitBase(Args.Obj).ParentReport := V2O(Value) as TQuickRep;
end;

{ property Read ParentUpdating: Boolean }

procedure TQRUnitBase_Read_ParentUpdating(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TQRUnitBase(Args.Obj).ParentUpdating;
end;

{ property Write ParentUpdating(Value: Boolean) }

procedure TQRUnitBase_Write_ParentUpdating(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TQRUnitBase(Args.Obj).ParentUpdating := Value;
end;

{ property Read Resolution: Integer }

procedure TQRUnitBase_Read_Resolution(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TQRUnitBase(Args.Obj).Resolution;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -