Atozed Forums
The savedialog isn't showing anymore - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html)
+--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html)
+---- Forum: English (https://www.atozed.com/forums/forum-16.html)
+----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html)
+----- Thread: The savedialog isn't showing anymore (/thread-2880.html)



The savedialog isn't showing anymore - Rolphy Reyes - 09-29-2022

Hi!

I recently update my PC.
I install Windows 10 Pro version 21H2; then old my delphi stuff:
* Delphi Berlin
* Intraweb 15.2.10
* Report Builder 17.03
and other components just like my other PC.

With the same old code without changing nothing in the code, suddenly I can't get the download dialog for the files of Excel and Word; now I get the window just like the image below.


What can I do to get the dialog for saving the file?


RE: The savedialog isn't showing anymore - Alexandre Machado - 10-17-2022

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?


RE: The savedialog isn't showing anymore - Rolphy Reyes - 10-20-2022

(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;