Skip to main content
Inspiring
May 31, 2018
Resuelto

Login screen appears when downloading report to EXCEL

  • May 31, 2018
  • 2 respuestas
  • 1507 visualizaciones

Hi,

Upgrading to 64 bit ColdFusion 2016 and 64 bit 2016 servers.

The current application (on 32 bit Cold Fusion 11, 2008 servers) allows the user to get a report and then download the report into Excel.

When executing the report on 2016 and then requesting the report be downloaded into EXCEL, a login screen appears (does not appear in 32 bit version).

Is there something in Cold Fusion 2016 administrator or on the server to not have the login screen appear?

Thanks,

Mike

    Este tema ha sido cerrado para respuestas.
    Mejor respuesta de BKBK

    I have pasted the four lines of code that pertains to Excel. In pasting of the code, the forum removed the <CFSET, <CFHeader and <CFContent.

    <CFSET TabChar = Chr(9)>

    <CFSET  NewLine = Chr(13) & Chr(10)>

    <Cfheader name="Content-Disposition" value="filename=reports.xls">

    <CFContent TYPE="application/vnd.ms-excel" RESET="Yes">

    The rest is the SQL statement and the code to return the results.

    I do not know if CF creates temp file for Excel.

    What is POI?

    Thanks,

    Mike


    UserCold9 wrote:

    <CFSET TabChar = Chr(9)>

    <CFSET  NewLine = Chr(13) & Chr(10)>

    <Cfheader name="Content-Disposition" value="filename=reports.xls">

    <CFContent TYPE="application/vnd.ms-excel" RESET="Yes">

    These are just instructions to the browser. It is likely that, somewhere else, your code is sending the user to the login page. Perhaps via the Application file.

    In any case you have to say whether this is:

    inline: <Cfheader name="Content-Disposition" value="inline; filename=reports.xls">

    or

    attachment: <Cfheader name="Content-Disposition" value="attachment; filename=reports.xls">

    2 respuestas

    WolfShade
    Legend
    May 31, 2018

    So you're upgrading both the CF and the server it runs on.

    This sounds more like a permissions issue.  If a pop-up dialog appears, requesting a username and password, and it looks like a Windows Server prompt, then (most likely) CF is attempting to access something in a folder to which it doesn't have permission to access.  Like a temp folder, or something like that which is used to generate the report.

    HTH,

    ^ _ ^

    Inspiring
    May 31, 2018

    The code is not accessing any folder.

    After the code below, is SQL and the code to put the Excel.

    TabChar = Chr(9)>

    NewLine = Chr(13) & Chr(10)>

    name="Content-Disposition" value="filename=reports.xls">

    TYPE="application/vnd.ms-excel" RESET="Yes">

    Thanks,

    Mike

    WolfShade
    Legend
    May 31, 2018

    Something that you're copying is interfering with display, we're not seeing all of what you're pasting.  And I don't think you're including all of the relevant code.

    Preran​, I am not familiar with the internal workings of generating an Excel file via CF.  Does CF create a temp file when working with an Excel object?  Is CF still using POI?

    V/r,

    ^ _ ^

    Inspiring
    May 31, 2018

    Lots of questions that might help someone troubleshoot this with you. What login screen are you referring to?  If it is your own login screen, have you tried dumping out SESSION or looking at your cookies to see if your session is being disrupted?  How are you logging in/out the user?  What are your application settings for session and cookies?  Is the request being made on the same domain using the same method (http/https)?

    Thanks,

    Nic

    Inspiring
    May 31, 2018

    The login screen that appears is the login to the server.

    Thanks,

    Mike

    Inspiring
    May 31, 2018

    I assume you meant he CFAdmin login.  What URL is the code taking you to that it is requesting a login?  Can you provide any information or code that would be helpful as to how the file is being made available to the user?