Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The savedialog isn't showing anymore
#3
(10-17-2022, 07:59 AM)Alexandre Machado Wrote: Have you tried other browser?

Seems to me that the browser is attempting to open the xlsx file internally, instead of downloading it. Do you download it using SendFile() on the server side?

Hi.

We use Report Builder.

This is the code that we been using for years:
Code:
procedure FileCopy(sS,sD:string);
  begin
     CopyFile(PChar(sS),PChar(sD),False);
  end;

procedure TfraEncabezado.ImprimirExcel(ReporteSalida: TppReport);
var
  lDevice: TppXLSReportDevice;
  CacheFileName, OriginalFileName: string;
  lDir: string;
begin
  lDevice    :=  TppXLSReportDevice.Create(nil);
  OriginalFileName := gServerController.CacheDir + WebApplication.AppID + MilliSecondOfTheMinute(Now).ToString + '.xls';
  try
    lDevice.XLSSettings := ReporteSalida.XLSSettings;
    lDevice.XLSSettings.IgnorePageHeight := True;
    lDevice.XLSSettings.IncludeSingleFooter := True;
    lDevice.XLSSettings.IncludeSingleHeader := True;
    lDevice.XLSSettings.MergeAdjacentCells := False;
    lDevice.FileName    := OriginalFileName;        // assign output stream
    lDevice.Publisher   := ReporteSalida.Publisher;
    // generate the report

    ReporteSalida.PrintToDevices;

    CacheFileName := TIWAppCache.NewTempFileName('.xls');
    FileCopy(OriginalFileName, CacheFileName);

    lDir := TIWAppCache.AddFileToCache(GGetWebApplicationThreadVar(), CacheFileName, TIWMimeTypes.GetAsString('.xls'), ctOneTime);

    WebApplication.NewWindow(lDir,
      'blockerhackpopup' + DateTimeToStr(Now), 800, 800, [woResizable, woFullScreen]);

  finally
    lDevice.Free;
  end;
end;
Reply


Messages In This Thread
RE: The savedialog isn't showing anymore - by Rolphy Reyes - 10-20-2022, 01:40 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)