DevExpress QuantumGrid

Is there anyway to use PrintGrid to print a Quantum Grid?

Thanks.

Comments

  • edited 2:21PM
    You may use DevExpress Printing System wich will print exaclty your grid.

    You can also use try the following code wich is intended
    to navigate the grid from first to last record and synchronise
    the TcxGgrid's dataset. It is also expanding groups automatically
    to get that data in it.

    ds_liste is a TfrDBDataset.

    This applies only if the TcxGridDBTableView.DataController.DataModeController.GridMode is set to False.

    (I am actually looking for something better because this code
    does not support the double pass report).

    ....
    private
    { D?©clarations priv?©es }
    CurrentRecord : Longint;
    ViewData : TcxGridViewData;
    ....

    procedure TDM_PrintListe.ds_listeFirst(Sender: TObject);
    begin
    if ViewData <> nil then
    with ViewData do
    begin
    if RecordCount >= 1 then
    begin
    if Records[CurrentRecord].Expandable then
    begin
    Records[CurrentRecord].Expand(False);
    GotoNextRecord (ViewData);
    end
    else
    Records[CurrentRecord].Focused := True;
    end
    else CurrentRecord :=-1;
    end;
    end;

    procedure TDM_PrintListe.GoToNextRecord (ViewData : TcxGridViewData);
    begin
    with ViewData do
    if CurrentRecord < RecordCount-1 then
    begin
    Inc (CurrentRecord);
    if Records[CurrentRecord].Expandable then
    begin
    Records[CurrentRecord].Expand(False);
    GotoNextRecord (ViewData);
    end
    else
    Records[CurrentRecord].Focused := True;
    end
    else Inc (CurrentRecord);
    end;

    procedure TDM_PrintListe.ds_listeNext(Sender: TObject);
    begin
    if ViewData <> nil then
    with ViewData do
    begin
    if CurrentRecord < RecordCount-1 then
    begin
    gotoNextRecord (ViewData);
    end
    else Inc (CurrentRecord);
    end;
    end;

    procedure TDM_PrintListe.ds_listeCheckEOF(Sender: TObject;
    var Eof: Boolean);
    begin
    if ViewData <> nil then
    with ViewData do
    begin
    eof := CurrentRecord >= RecordCount;
    end;
    end;
  • edited 2:21PM
    Thanks for the sample code. It compiles but how do I get the fields from the grid onto the report? I only know how to do this by selecting the fields from a tdataset. In this case it is from a tcxGrid via a tfrdbdataset and these don't show up while designing the report.

    Thanks.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.