我们使用的IntraWeb为我们的Web应用程序,并一直在使用的ReportBuilder为我们内部的Windows应用程序的报告。我们也有我们使用,使我们能够拯救我们的报表创建报告,Excel文件ExtraDevices。

现在,我要生产我们的web应用程序为PDF文件的报告。我对如何是与ExtraDevices做了一个例子。然而,如何在下面的例子中得到与IntraWeb的变化?

procedure TWebModule1.WebModule1WebActionItem1Action(Sender: TObject; Request:
  TWebRequest; Response: TWebResponse; var Handled: Boolean);
var
  HD: TPDFDevice;
  MS: TMemoryStream;
begin
  MS := TMemoryStream.Create;
  HD := TPDFDevice.Create(Self);
  HD.PrintToStream := True;
  HD.ReportStream := MS;
  HD.Publisher := Rpt.Publisher;
  Rpt.PrintToDevices;
  Response.ContentType := HD.ContentType;
  Response.ContentStream := MS;
  Response.SendResponse;
  HD.Free;
end;
有帮助吗?

解决方案

我想我找到了答案,我的问题。我只需要使用TIWApplication.SendStream。

的代码将被修改这样:

procedure TfrmSomeIWForm.SomeBtnClick(Sender: TObject);
var
  HD: TPDFDevice;
  MS: TMemoryStream;
begin
  MS := TMemoryStream.Create;
  HD := TPDFDevice.Create(Self);
  HD.PrintToStream := True;
  HD.ReportStream := MS;
  HD.Publisher := Rpt.Publisher;
  Rpt.PrintToDevices;
  WebApplication.SendStream(MS,false,HD.ContentType);
  HD.Free;
end;

其他提示

你见过RaveDemo附带IntraWeb的?我相信它,你在找什么,但与狂欢的报告。我用它来建立一个IntraWeb的报表制作PDF版本而回。

我不知道,如果它流的报告虽然。它已经有一段时间,因为我看着它,但我认为它可能保存到磁盘,而不是发送从喜欢你的例子内存的响应。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top