Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The savedialog isn't showing anymore
#1
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?


Attached Files Thumbnail(s)
   
Reply
#2
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?
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)