Jump to content

UniGridExcelExporter export 1 page


Dmitriy

Recommended Posts

Hi, sorry if my question looks like noob) but i setup my dbgrid on export (see fotos)  and i have 7 pages in my grid, after export i see that exported only 1 page.

I dont want to change grid option on not paged. How can i solve this case? )

 

 

1.jpg

Link to comment
Share on other sites

in unit uniBasicGrid;
TUniGridExporter.ExportGrid 
to correct the line in

  JSConfig('filename', [FFileName + '.' + Self.FExporter.FileExtention], ExpCfgObj);

  JSConfig('fileName', [FFileName + '.' + Self.FExporter.FileExtention], ExpCfgObj);

n -> N

please .Farshad Mohajeri ... for me you can also add this code

TUniGridExporter = class(TPersistent)
  private
    function FileNameIsStored: Boolean;
    function TitleIsStored: Boolean;
    ...
  published
    ...
    property FileName: string read FFileName write SetFileName stored FileNameIsStored;
    property Title: string read FTitle write SetTitle stored TitleIsStored;
  end;

function TUniGridExporter.FileNameIsStored: Boolean;
begin
  Result := FFileName <> 'Export';
end;

function TUniGridExporter.TitleIsStored: Boolean;
begin
  Result := FTitle <> 'Exported Grid';
end;

so as not to store the two values in dfm
thank you

 

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...

Hi,

I found a solution for print the whole grid, but it is not a best practice.

I created an invisible UniPanel with a UniDbGrid inside that has Paged property False.

When I export the Grid I do as follow.

 

UniPanel3.Visible := True;	//Panel that contains the UniDBGrid to Export
UniDbGrid1.Visible := False; //Hide the grid with WebOptions.Paged = True
UniDBGrid2.Exporter.Exporter := UniGridExcelExporter1; 
UniDBGrid2.Exporter.ExportGrid; // Export the grid with WebOptions.Paged = False;
UniPanel3.Visible := False; //Hide the panel that contains the grid with WebOptions.Paged =False;
UniDbGrid1.Visible := True; //Show the real Grid

Pros : You can print the whole grid using UniGui native components,

Cons : You have a clone of your UniDBGrid just for export.

 

Hope it helps.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...