CFContent - excel problem

Hi all
I'm new to Coldfusion. I'm trying to use the tag CFcontent to try to create an excel worksheet when a users clicks on a link. However, when I use the cfoutput tag, the excel window arrives to save or open, but the file name suffix is .cfm instead of .xls. If I remove the cfoutput tags, file suffix is .xls, but instead to list the values, I get the domain name in all cells - ex. #hhkey #-it does not replace the name of the field with the value. Could someone help me? The code is attached:

Sunmoonstars, what you get when you use , but leave out the cfheader and cfcontent tags? This is the table that you expect?

Tags: ColdFusion

Similar Questions

  • Tecra A9 - display Excel problem

    I have a user with a Tecra A9 causing of the problems with the display in Excel.

    When she jumps on a worksheet to another sorta screen flashes as Excel updates.
    While most of the cells white out with a bit of a click on sometimes they can come back.
    This happens on the laptop and the external display screen.

    So far
    Updated graphics drivers
    Put it on another version of office
    Off acceleration for the graphics card
    Patched up to date
    He spoke in a firm voice

    Did someone come acros something like this before?

    Try to update the driver to display on the Toshiba site.

    If it's not good, google for clues: http://www.google.com/search?hl=en&q=excel+flickering&btnG=Google+Search & meta = & aq = f & oq =

  • Query the Excel problem

    Hello

    I have create a cfm to export the data of my query, qOrds (coming from my cfc).

    In fact, I have a button in flex that when I click, needs to export data to Excel for my request.
    My flex button calls the following function:

    My function in Flex

    public void RetrieveExcel (): void
    {
    var urll:URLRequest = new URLRequest (" http://bang:8500/dcsnew/Export2xls.cfm"); ")

    navigateToURL (url, "_blank");

    }




    TextHERE's my Exportt2xls.cfm

    < cfinvoke component = "mycfc.cfc" method = "getOrds" returnvariable = "qOrds" > "
    < name cfinvokeargument = "mydate" value = "#url.mydate #" >
    < / cfinvoke >

    < CFCONTENT TYPE = "application / vnd.ms - excel" >
    < name cfheader = "Content-Disposition" value = "filename = report.xls" >

    < cfquery name = "exportdata" dbtype = "query" >
    SELECT *.
    OF qOrds
    < / cfquery >

    < table >

    < cfoutput >
    < b >
    < cfloop list = "" #exportdata.columnlist # "index ="TDFIELD">"
    < td > #TDFIELD # < table >
    < / cfloop >
    < /tr >
    < / cfoutput >

    < cfoutput query = "exportdata" >
    < b >
    < cfloop list = "" #exportdata.columnlist # "index ="COLUMNNAME">"
    #exportdata [COLUMNNAME] [exportdata.currentrow] # < td > < table >
    < / cfloop >
    < /tr >
    < / cfoutput >

    < cfreturn > #exportdata #.




    I have an argument to date I want to spend at the MTC.
    But when running the function, it gives me the following error:

    "Mydate element is undefined in URL."

    Where I have to pass the variable "mydate" in my flex code.

    Any help would be much appreciated.



    "var urlString:String = http://bang:8500/dcsnew/Export2xls.cfm?myDate= ' + myDataVar;
    var url: URLRequest = new URLRequest (urlString);

  • Export Excel problem when using exportListener

    Hello

    I have a table and trying to export the table data in excel file (.xls)

    Everything works well except a number with more than 15 characters. .

    Like excel cant display more than 15 characters such as number, currently, is to show the number as

    1.79E + 18

    How to display the number in the correct format. .

    After watching Microsoft blog came to know that there is a bug in excel and if we can convert the column as a text, then it will display in the correct format...

    But I am unable to do so. .
    All entries from you guys...

    Thank you

    Sharath

    I changed my article of below a
    Now its works well

    filterable = "true" sortable = "true".

    headerText = "#{bindings." SpecificService1.hints.MemberId.label}.

    ID = "c16" width = "120" >

    inlineStyle = "" display: none "/ >"

    model = ' #{bindings. " SpecificService1.hints.MemberId.format}"/ >

    inlineStyle = "" display: none "/ >"

  • Excel problem

    Someone knows how to change the decimal point in a comma and the separator of 1000 in a point in Excel?

    Or vice versa?

    I've been struggling with it for a while with no results so far.

    Change the language settings does not seem to do something, or maybe I'm not good things.

    (This has to do with the placement of columns Excel in InDesign, but I had no luck on the forum ID; then maybe there's some Excel wizards among us Illie people.)

    2008, mac I see... Let me see if I can find where it is on the machine of a colleague. It is not a number format, is the setting of the system... I'll get back to you.

    Update:

    It seems that it is not an easy task on a mac / excel

    check this page

    http://www.macfreek.nl/MindMaster/Decimal_Seperator_in_Mac_OS_X

    Post edited by: CarlosCanto

  • CS4: can I ask a logic based on the fusion of data?

    Hi all

    I create a document using CS4 InDesign that has variable text in it.  Some of the variable text is 'static', it is inserted directly a data merge.  In other cases, however, I want to display a block of text (specify) If an element in the data merge has a value and another block of text, if the data merge element has a different value.  I can do it with a script?  Here's an example: in the data merge file, I have something "WorkingHours.  It can have a value of "5-8" or "24 x 7".  If the value is '8-5' I want to display ' 08:00 - 17:00 Monday - Friday ' and if the value is "24 x 7"I want to show '24 hours, 7 days a week'.  I want the text to display in a cell in a table in my document.

    If I can do this, I just create the script, save it, and then select it via the data merge Panel to insert it into the cell where I want to output data to display?

    Thank you very much

    Ed

    As Peter has already pointed out, you could do a simple IF formula in Excel, problem solved...  Well, that's if you are in a unique fusion of data.  If you are uncomfortable in Excel (first program I've ever used, I love it) you could get around that also.  Merging InDesign and data are not the ideal workflow for this sort of thing, the XM Pie to Indesign plugin is however, works costs a lot, lot$.

  • DW CS4 live view does not

    I have migrated in the week purchase DW CS3: DW CS4 and have spent the last 24 hours, or so I'm watching the excellent videos on lynda.com for CS4.

    Then, I decided to take the plunge and begin to produce my own content. The first thing I wanted to see was how to drag and drop an Excel file in an HTML page.

    First of all, DW seems to generate a link of file only without presenting me with a dialog box to let me choose what I wanted to do.
    Secondly when I tried then to switch to Live mode, I was confronted with the message that

    Live View mode needs Netscape/Firefox Flash Plugin

    I searched help and the Adobe site for this plug, but have had no... can someone please make me win a load of time and grief and tell me what I need to do?

    I thought that there could be an Excel problem so I tried to do the same with a Word file and faced the same problem.

    Thanks for your attention!

    Duncan

    Thank you for your contributions. I have more this message odd and irritating.

    I must say that after I posted my cry for help, I tried the Live View with a little more patience and noticed that despite the error, he was always showing live view. I must say, however, that the live view is not perfect. For example, I've created a Spry vertical menu and in live mode view, one of the bars/icons makes it bad, but on the website, it seems that all the rest.

    Thanks for the help, much appreciated.

    Duncan

  • HTML to excel with cfcontent problem

    I want to allow a user to save the contents of a table created with a cfquery in an Excel spreadsheet. Using < cfcontent > I am able to create the worksheet very well, but the formatting isn't fair. Some of it is and some isn't. The "BOLD" on the header row doesn't happen, I can live with, but the landscape orientation does not work and it is a more serious problem. I discovered fine in Excel 2003, but when I have print preview or print it is portrait. I converted this code to ASP. It has the XML inside, so I kept it...

    We are still on CF5. Not sure if there is a way to solve this problem.

    Thanks for any help on this.

    Jeff

    < cfsetting enablecfoutputonly = "Yes" >

    < cfset filename = ' Facets_Fix_Report_ #fileDate # .xls ">".

    < cfcontent type = "application / vnd.ms - excel" >

    < name cfheader = "Content-Disposition" value = "attachment; filename = #Trim (fileName) #">"

    < cfoutput >
    < HTML xmlns: x = "urn: schemas-microsoft-com: excel" >
    < HEAD >
    < style >
    <!--
    TD
    {
    border-width: thin;
    border-top-style: solid;
    border-bottom-style: solid;
    border-left-style: solid;
    border-right-style: solid;
    }
    @page
    {
    MSO-header-data: "& C & \0022Arial\,Bold\0022 & 12 #trim (strHeader) #"; "
    MSO-footer-data: "& \00A9 L #DateFormat (now (), 'YYYY')" #\, TriZetto & CPage & P Group on & N & RExported dans\: & D & T ";"
    MSO-page-orientation: landscape;
    margin: 1 .5in .6in .5in;
    }
    BR
    {
    MSO-data-placement: same cells;
    MSO-width-source: auto;
    }
    newClass
    {
    MSO-width-source: auto;
    }
    ->
    < / style >
    <!-[if gte mso 9] > < xml >
    < x: ExcelWorkbook >
    < x: ExcelWorksheets >
    < x: ExcelWorksheet >
    Change packages < x: Name > < / x: Name >
    < x: WorksheetOptions >
    < x: print >
    < x: ValidPrinterInfo / >
    < x: > 600 VerticalResolution < / x: VerticalResolution >
    < / x: print >
    < x: selected / >
    < x: components >
    < x: component >
    < number: x > 3 < / x: Number >
    < x: ActiveCol > 5 < / x: ActiveCol >
    < x: RangeSelection > $A$ 1: $F$ 2 < / x: RangeSelection >
    < / x: component >
    < / x: components >
    False < x: ProtectContents > < / x: ProtectContents >
    False < x: ProtectObjects > < / x: ProtectObjects >
    False < x: ProtectScenarios > < / x: ProtectScenarios >
    < / x: WorksheetOptions >
    < / x: ExcelWorksheet >
    < / x: ExcelWorksheets >
    < x: WindowHeight > 10005 < / x: WindowHeight >
    < x: WindowWidth > 10005 < / x: WindowWidth >
    < x: WindowTopX > 120 < / x: WindowTopX >
    < x: WindowTopY > 135 < / x: WindowTopY >
    False < x: ProtectStructure > < / x: ProtectStructure >
    False < x: ProtectWindows > < / x: ProtectWindows >
    < / x: ExcelWorkbook >
    < x: ExcelName >
    Print_Titles < x: Name > < / x: Name >
    < x: SheetIndex > 1 < / x: SheetIndex >
    < formula: x > = Recovered_Sheet1! $1: $2 < / formula: x >
    < / x: ExcelName >
    < / xml > <! [endif]-->
    < / HEAD >

    Well, I do not know XML, but when I replaced the change packages with #filename #, using the variable instead of the static text string, he worked and worked the "BOLD" orientation and the landscape.

    Thank you

    Jeff

  • Problem with cfspreadsheet and excel files

    Hello

    I have a request from a client to generate a worksheet excel from a query. I have the query expel the fields and I can generate the Excel without a hitch. The problem comes when the customer takes excel file and then tries to handle it. The majority of the distress comes from fields that must be marked as currency or dates. I am, with a few combat capable of generating a 'real' date field Before this Excel was not correctly sort dates.

    I was able to call an excel formula using this:

    < cfset SpreadsheetSetCellFormula (, "DATEVALUE (#Chr (34) #Replacement_ETD ##Chr (34) #)", therow, 9) >

    Date value Force Excel to recognize him as a real date field. However, this fails when this file is manipulated by excel. The next problem is the currency field. I can't get excel to recognize it as a currency. It's always personal. When it is set, the SUM function will not work in excel. You can add the fields individually as A1 + B1 + C1 = TOTAL. This will not help when there are 200 lines.

    I was able to get a suggestion from an other CF developer who has had a similar situation. He generated the first with the appropriate items excel file and set the columns to their fields such as date and currency, etc.

    The next step would be to fill the rank by rank, and they must be properly formatted.

    Code:

    ("< cfset expandPath("./reports/arrivals.xlsx = filename ") >

    < cfspreadsheet action = "read" src = "#filename #" name = "s" >

    < cfset therow = 0 >

    < cfoutput query = "myExcel" StartRowOptional = "1" >

    < cfset therow = myExcel.currentrow + 1 >

    < cfset SpreadsheetSetCellValue (holders, s, therow, 1) >

    < cfset SpreadsheetSetCellValue (s, Section, therow, 2) >

    < cfset SpreadsheetSetCellValue (s, Position_Number, therow, 3) >

    < cfset SpreadsheetSetCellValue (s, Position_Title, therow, 4) >

    < cfset SpreadsheetSetCellValue (s, Incumbent_Emplyment_Type, therow, 5) >

    < cfset SpreadsheetSetCellValue (s, Incumbent_ETD, therow, 6) >

    < cfset SpreadsheetSetCellValue (s, Tour_Comments, therow, 7) >

    < cfset SpreadsheetSetCellValue (s, replacement, therow, 8) >

    < cfset SpreadsheetSetCellValue (s, Replacement_ETA, therow, 9) >

    < / cfoutput >

    < name cfheader = "content-disposition" value = "attachment; filename = Departures_ (#DateFormat (now (), 'MMDDYY') #) .xls ">"

    < cfcontent type = "application/msexcel" variable = "#spreadsheetReadBinary (s)" # "reset ="true">"

    The data in the cells has already been formatted properly. When this file is generated and sent to the user columns are not formatted as expected.

    Does anyone know if this method will work or have a better suggestion on CF getting to generate a suitable date and currency field to Excel for acknowledge?

    Adobe ColdFusion running on RHEL 5 v10

    Thank you

    For some reason, you need to format it twice - once before the data is inserted and one after.

    This is especially true if you have data values that are integers.  These, even if you format cell advance to be 'Text', always align to the right, as do the integers.  However, if you reapply the formatting after inserting the data, then it must be formatted correctly.

    HTH,

    ^_^

    PS. Thank YOU for taking the time to code for spreadsheetsetcellvalue (CF)!  Too many people become lazy and chuck just a query to an object tag cfspreadsheet.

  • Problem CFCONTENT

    Hello
    I have a button on my site when users click on it they supposed to get a MS excel file.
    It's look like this:
    < CFCONTENT TYPE = "application/MSExcel" QUEUE = "C:\excel\#exportFileName #." XLS">

    My problem is they get the file but the computer want to save it in a file .cfm, and they need to change it to .xls.
    Someone knows how to solve?
    I use the CF 4.5.1 Server

    Thank you
    Yotam

    LiveDocs shows the correct way to do it.

    http://livedocs.Macromedia.com/ColdFusion/7/htmldocs/00000232.htm

    Good luck!

  • CFContent / exit number Excel

    I'm doing a simple query to output to the browser in Excel format, but I still run into the same problem... which is similar to those I've seen in other posts here. I have gone through the forums for a while trying every suggestion I can find to solve my problem, but so far nothing works.

    The process is triggered by the user to choose an "Excel" option button on a form, and then by clicking a "submit" button. Action form and then deals with the selection criteria of the user through a series of queries and then tries to open the exit in the form of Excel data. Like others here, Excel attempts to open the URL of CFM, I called instead the name of XLS file, I added to the CFHeader tag. The REALLY strange thing is that if I click on CANCEL and then send the form a second time, the file opens as it should... without fault.

    If I comment the CFContent tags and CFHeader the browser displays the data in the report, as expected without error.

    I think Excel is tripping over something, but I just can't understand that. I have a similar process in another part of my site that uses a link to trigger the report instead of a form submission and that works very well. Am I missing something here, the difference between a link and a form submission?

    Here's where things seem to be failing. Commented lines are just to show you what I tried. I am currently using variables.strExcel_Out for the output variable. It was created using CFSaveContent and the dspSemaReportOutput2.cfm of report running code. I also tried that works directly without the variable. I get the same results, no matter what I change so I'm missing something.

    Any ideas or suggestions would be appreciated.

    Success!
    I have to eat my words a little in fuses box was PART of the problem. Or rather my inability to see how FB has been including the code that I was ignorant. This can border the off-topic, but I want to post the answer for anyone of another evil I have for 2 days with this.

    In the fuse box, you can include a "global" prefusaction which has the effect of adding the exact even at the top of EACH page. In our case, we have one who includes a model that attracts the same page header. This page header has the line...

    ... which is the root of all the problems. No matter what I tried I inadvertently reset the cache-control value in the http header.

    So actually the problem wasn't Fusebox itself... but my failure to recognize that everything I tried again included a $# @* @! line of code. It is such a piece long standing and an integral part of our site that it was easy to forget.

    See this post from MS for more details:
    http://support.Microsoft.com/default.aspx?scid=kb;en-us;316431

    I hope this helps someone else.

  • Fix ios 9.3.1 battery drain problem before I was on 8.4.1 and battery life was excellent but after updating to ios 9.3.1 autonomy got worse on my iphone 6. Apple company released please update to fix

    Fix ios 9.3.1 battery drain problem before I was on 8.4.1 and battery life was excellent but after updating to ios 9.3.1 autonomy got worse on my iphone 6. Apple company released please update to fix

    Please you not to Apple here. This is a user forum.

    Try som battery tips to save:

    Battery Saving Tips for your beloved iPhone

  • Virtual Excel file import NI Switch Executive device problem

    When I try to import OR switch Executive configuration to a file .xlxs error

    "An error occurred trying to read the file. Invalid device name «THIRD _PARTY_MATRIX» IVI "An error occurred while trying to access primary device _PARTY_MATRIX error THIRD: (Hex 0xBFFA4001) unknown status code.

    is displayed. I have no problem importing OR switch configuration Executive in .xml format! Can someone tell me why? Please, I beg you!

    I use a switch

    Executive 3.0

    Measurement and Automation Explorer worm 4.5.0f0

    LabVIEW 8.6.1

    Thank you very much

    Hi Mehran,

    Thanks for providing the attached files.  I have determined that the cause of the problem may be due to a setting of simulation of IVI.

    Currently, your IVI Driver Max sessions are configured so that simulate attribute is set to False.  This means that real hardware must be connected when opening a session IVI instrument.  If you do not have the hardware attached, then the call to initialize IVI fails (and potentially bad, depending on how the IVI specific driver manages an init call without hardware).

    Import the NI Switch Executive configuration in .xml format does not cause a problem because simulate is always set to true in the call to initialize of IVI.

    We will consider changing the import Excel in the future to also have always simulate the True value.  Time, you can a) check the hardware is connected when you import Excel, or b) set the value "Simulate with" Max to 'Specific Driver' applicable IVI pilot sessions.

    Example of setting "with"to simulate 'Specfic Driver' of MAX:

    Let me know if you have any other questions!

    Chad Erickson

    Switch Product Support Engineer

    NOR - USA

  • problem with save in excel

    Hello

    I am get problem when I'm put two value in excel

    When I put the writing as filt.vi loop these unnecessary time data also came into it.

    and while I am putting filt.vi of measure outside the loop this time, only the last data record

    I want to save two data in the column two

    Yes help pleaze


  • Problem with comparing (related excel)

    Problem: Essentially the vi does that retrieve values from excel and compare it with a predetermined value and if the return value is equal to or superior to the vi stops and returns the cell that gave him a thar value. I think that it can think I tell excel to compare a value of string to a decimal value, but I tried and it seems to stop instantly with a value which is cleary.

    I have attached the vi and examples file excel which he searches through

    Don't see a problem. Start A4 and it will stop on the first iteration, as it should be (because the cell is empty it converts a 0 which is greater than-30). A5-again he steps up to the A368, just as it should.

    Mike...

Maybe you are looking for

  • UN-install Firefox

    Can someone help please, I'm trying to uninstall Firefox. I tried to do the normal procedure if and functions and of the program, it just do not respond to my command to uninstall. I am tearing my hair, I'm totally powered upward with all accidents a

  • cleaning rMBP

    Hey,. Is this OK to clean the outer shell of a rMBP with a Microfiber cloth and a bit of water? It could damage the aluminum or anything else on the machine? Thank you

  • Equium A60: How to clean the screen

    Hi... using equium A60 for 4 years.There are fingerprints and marks on my screen for a long time, I tried to wipe with a cloth dampened in water, to my surprise, that would leave more big brands then before. Brands are not visible when the system is

  • I want to change my ifeel grab that some one after my account

    I want to change my password, if eel someone following my account thank you 2. u.

  • HP Photo smart 7520: how to switch color after setting the black HP7520 only

    How to switch color after setting printer black HP7520 only