procedure TWebModule1.WebModule1WebActionItem1Action(Sender: TObject; Request: TWebRequest; Response: TWebResponse; var Handled: Boolean); var lWebRequest: TrsWebRequest; lWebSession: TrsWebSession; lWebCacheReportFile: TrsWebCacheReportFile; begin
// create a WebRequestObject lWebRequest := rsWebTier1.CreateWebRequest(Request.QueryFields, Request.Content);
// check whether request is for a pdf if (lWebRequest.ContentType = 'pdf') and (rsWebTier1.SessionExists(lWebRequest)) then begin // get the web session lWebSession := gWebSessionManager.GetSessionForRequest(lWebRequest);
// get the cache lWebCacheReportFile := TrsWebCacheReportFile.Create(lWebSession, lWebRequest);
lWebCacheReportFile.FileExtension := 'pdf';
// the report file will be this value ShowMessage(lWebCacheReportFile.ReportFileQualifiedName);
The report server sends Page objects to the WebTier. The WebTier translated the Page objects to content such as XHTML/Javacript for the web viewer, or a PDF or Excel file.
report server --> Page --> WebTier --> Excel file
-- Nard Moseley Digital Metaphors www.digital-metaphors.com
Best regards,
Nard Moseley Digital Metaphors www.digital-metaphors.com
So I could just generate the report in the report server, place the file somewhere that the webtier can access it, then I can replace the default html returned by the webtier with code for displaying the Excel file
Comments
This example is for PDF, same would work for XLS
uses
rsWebRequest,
rsWebSessionManager,
rsWebSession,
rsWebCacheReportFile;
procedure TWebModule1.WebModule1WebActionItem1Action(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
var
lWebRequest: TrsWebRequest;
lWebSession: TrsWebSession;
lWebCacheReportFile: TrsWebCacheReportFile;
begin
// create a WebRequestObject
lWebRequest := rsWebTier1.CreateWebRequest(Request.QueryFields,
Request.Content);
// check whether request is for a pdf
if (lWebRequest.ContentType = 'pdf') and
(rsWebTier1.SessionExists(lWebRequest)) then
begin
// get the web session
lWebSession := gWebSessionManager.GetSessionForRequest(lWebRequest);
// get the cache
lWebCacheReportFile := TrsWebCacheReportFile.Create(lWebSession,
lWebRequest);
lWebCacheReportFile.FileExtension := 'pdf';
// the report file will be this value
ShowMessage(lWebCacheReportFile.ReportFileQualifiedName);
lWebCacheReportFile.Free;
end;
Response.Content := rsWebTier1.ProcessWebRequest(lWebRequest);
lWebRequest.Free;
end;
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Could I then pass this filename into the report server as a parameter?
The report server can then write to this file directly then ftp the file to
the machine with the webtier on
Does that sound right?
The report server sends Page objects to the WebTier. The WebTier translated
the Page objects to content such as XHTML/Javacript for the web viewer, or a
PDF or Excel file.
report server --> Page --> WebTier --> Excel file
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
somewhere that the webtier can access it, then I can replace the default
html returned by the webtier with code for displaying the Excel file
Does that sound ok?