Jump to content

UniDBGrid Export


mikromundo

Recommended Posts

Hi...

I hope everyone is okay.

 

I am creating runtime uniDbGrid for Export data and I receive this:

image.png.9fc93eb5aaf8f3394c26a9e4036d6a97.png

 

Thanks any help !!!

 

procedure tdm_rc.rc_GridExport(pGrid: TUniDBGRID; pType: TRCExportType);
var
   pGridTemp : TUniDBGrid;
begin

   try
      //pGrid.ShowMask( '' );

      pGridTemp := TUniDBGrid.Create( TComponent( pGrid.Owner ) );

      pGridTemp.Parent :=  TUniControl( pGrid.GetParentComponent ) ;
      pGridTemp.Exporter.Enabled := True;
      pGridTemp.DataSource       := pGrid.DataSource;
      pGridTemp.WebOptions.Paged := false;
      pGridTemp.DataSource.DataSet.close;
      pGridTemp.DataSource.DataSet.Open;
      pGridTemp.Exporter.Title          := APP_NAME + ' Dataexport';
      pGridTemp.Exporter.FileName       := 'DataExport-' + FormatDateTime('yyyymmdd_hhmmss', Now() );

      case pType of

        etExcel : pGridTemp.Exporter.Exporter := dm_rc.UniGridExcelExporter1;
        etHTML  : pGridTemp.Exporter.Exporter := dm_rc.UniGridHTMLExporter1;
        etXML   : pGridTemp.Exporter.Exporter := dm_rc.UniGridXMLExporter1;
        etCSV   : pGridTemp.Exporter.Exporter := dm_rc.UniGridCSVExporter1;

      end;

      pGridTemp.Exporter.IncludeGroups  := true;
      pGridTemp.Exporter.IncludeSummary := true;
      pGridTemp.Exporter.ExportGrid;

   finally

     pGridTemp.DataSource.DataSet.close;
     pGridTemp.Free;
     //pGrid.HideMask;

   end;

end;

 

Link to comment
Share on other sites

3 hours ago, mikromundo said:

Hi...

I hope everyone is okay.

 

I am creating runtime uniDbGrid for Export data and I receive this:

image.png.9fc93eb5aaf8f3394c26a9e4036d6a97.png

 

Thanks any help !!!

 

procedure tdm_rc.rc_GridExport(pGrid: TUniDBGRID; pType: TRCExportType);
var
   pGridTemp : TUniDBGrid;
begin

   try
      //pGrid.ShowMask( '' );

      pGridTemp := TUniDBGrid.Create( TComponent( pGrid.Owner ) );

      pGridTemp.Parent :=  TUniControl( pGrid.GetParentComponent ) ;
      pGridTemp.Exporter.Enabled := True;
      pGridTemp.DataSource       := pGrid.DataSource;
      pGridTemp.WebOptions.Paged := false;
      pGridTemp.DataSource.DataSet.close;
      pGridTemp.DataSource.DataSet.Open;
      pGridTemp.Exporter.Title          := APP_NAME + ' Dataexport';
      pGridTemp.Exporter.FileName       := 'DataExport-' + FormatDateTime('yyyymmdd_hhmmss', Now() );

      case pType of

        etExcel : pGridTemp.Exporter.Exporter := dm_rc.UniGridExcelExporter1;
        etHTML  : pGridTemp.Exporter.Exporter := dm_rc.UniGridHTMLExporter1;
        etXML   : pGridTemp.Exporter.Exporter := dm_rc.UniGridXMLExporter1;
        etCSV   : pGridTemp.Exporter.Exporter := dm_rc.UniGridCSVExporter1;

      end;

      pGridTemp.Exporter.IncludeGroups  := true;
      pGridTemp.Exporter.IncludeSummary := true;
      pGridTemp.Exporter.ExportGrid;

   finally

     pGridTemp.DataSource.DataSet.close;
     pGridTemp.Free;
     //pGrid.HideMask;

   end;

end;

 

Hello

Why are you using uniDBGrid to export? Fastreport will be suitable for this.

Link to comment
Share on other sites

  • Administrators
3 hours ago, mikromundo said:

This will not work because our exporter is a client side utility and it requires a visible Grid with data loaded. In your case grid is created and destroyed before any data is loaded. Why don't you use the original grid to export data?

Link to comment
Share on other sites

Sorted out.

I left an instance of the grid "hidden" with the same datasource but with Paged = false and used it as a reference to export the data.

Note:

In HTML export with large amount (13k records) some information was lost and the same export to Excel worked 100%.

 

Thanks @Hayri ASLAN@Pep and @Farshad Mohajeri

 

  • Upvote 1
Link to comment
Share on other sites

  • 2 years later...
On 6/11/2021 at 1:36 PM, Farshad Mohajeri said:

This will not work because our exporter is a client side utility and it requires a visible Grid with data loaded. In your case grid is created and destroyed before any data is loaded. Why don't you use the original grid to export data?

Accessing the application by a mobile phone, and exporting the grid (CSV for example) is opened a second screen and is not exported.

Could this be resolved?

https://prime.fmsoft.net/demo/desktop/mdemo.dll

Link to comment
Share on other sites

I would like to use this feature with standard components and not using hybrid mobile.

I think that, just as it is possible to download PDF files (unipdfframe), it would also be possible to download the grid export files.

It's possible?

Link to comment
Share on other sites

Sorry Sherzod, I can't clarify more than what was said in the original post (I don't know if it's being translated wrong).

I just need (and other users) that the data export through UniDBGrid works on a cell phone.

Link to comment
Share on other sites

2 minutes ago, mikromundo said:

I can't clarify more than what was said in the original post (I don't know if it's being translated wrong).

I just need (and other users) that the data export through UniDBGrid works on a cell phone.

Sorry, (above post) I thought you were asking about something else.

 

Well, don’t know, need to check because the desktop application may not work fully on the mobile one.

Link to comment
Share on other sites

There's no need to apologize... after all, you're here to help and you're always kind to everyone.

I apologize... I need Google translate to write in English and sometimes I think there may be an error in the translation.

 

Link to comment
Share on other sites

  • 3 weeks later...
Em 21/02/2024 às 08:39, Sherzod disse:

Desculpe, (post acima) eu pensei que você estava perguntando sobre outra coisa.

 

Bem, não sei, precisa verificar porque o aplicativo de desktop pode não funcionar totalmente no móvel.

Consegui analisar uma possível solução?

Link to comment
Share on other sites

  • 1 month later...
Em 21/02/2024 às 08:39, Sherzod disse:

Desculpe, (post acima) eu pensei que você estava perguntando sobre outra coisa.

 

Bem, não sei, precisa verificar porque o aplicativo de desktop pode não funcionar totalmente no móvel.

Há previsão para ajustar o problema?

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...