Home Server
New Blog Posts: Merging Reports - Part 1 and Part 2

How to get filename of excel file to be generated

edited April 2008 in Server
Hello

How do I get the filename for the Excel file that is to be generated by the
report server when the user puts a report to Excel through the webtier?

I want to get access to this file so that I can write directly to it

Cheers

Paul

Comments

  • edited April 2008

    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
  • edited May 2008
    Thanks NArd

    Could I then pass this filename into the report server as a parameter?

  • edited May 2008
    We need to get this filename into the report server

    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?

  • edited May 2008

    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
  • edited May 2008
    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

    Does that sound ok?

This discussion has been closed.