The savedialog isn't showing anymore

<< Click to Display Table of Contents >>

Navigation:  Forum >

The savedialog isn't showing anymore

Forum link

 


 

09-29-2022, 02:35 AM:

 

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?

 


 

10-17-2022, 07:59 AM:

 

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?

 


 

10-20-2022, 01:40 PM:

 

(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 &nbsp;&nbsp;:= 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;