• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 220
  • Last Modified:

jquery ui dialog

I am building a coldfsuion report. Where one of the options is to show ther report in xls.

So I am displaying the report in jquery ui dialog. for html format it shows fine , but when I do XLs it still shows the html.

on the calling file

 I do this
<cfheader name="Content-Disposition" value="attachment; filename=acmesalesQ1.xls">
      <cfcontent type="application/vnd.msexcel">
      <cfheader name="Pragma" value="">


#saveContent#

savecontent is the variable name of the <cfsabecontent what I am I doing wrong
0
erikTsomik
Asked:
erikTsomik
  • 5
  • 3
  • 2
1 Solution
 
Ahmed HusseinCommented:
Browsers doesn't support XSL display in browser, you can parse the XSL data and show it inside a custom HTML table.
0
 
erikTsomikSystem Architect, CF programmer Author Commented:
I mean xls excel format
0
 
Ahmed HusseinCommented:
Yeeep sorry too, xls. You have to parse it on the server and show it in custom html table, since browsers doesn't support showing XLS data.

~AG
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
erikTsomikSystem Architect, CF programmer Author Commented:
but I am overwriting the header with coldfusion

<cfheader name="Content-Disposition" value="attachment; filename=acmesalesQ1.xls">
      <cfcontent type="application/vnd.msexcel">
      <cfheader name="Pragma" value="">
0
 
erikTsomikSystem Architect, CF programmer Author Commented:
and really I just want to show the popup which will ask the user to show the data in xls format not show the excel in the browser
0
 
Ahmed HusseinCommented:
can you please attache the jQuery code here..
0
 
erikTsomikSystem Architect, CF programmer Author Commented:
$('#frm').submit(function(e) {
                        if($(this).valid()) {

                              
                        var link = 'index.cfm';
                              
                              



                              $("#dialog").html("<h3>Please Wait ... </h3>");
                              $("#dialog").dialog({
                                    dialogClass: 'no-close',
                                    resizable: true,
                                    draggable: false,
                                    modal: true,
                               width: 1200,
                                    height: 400,
                                    open: function (event, ui) {
                                  $(this).load(link + '&' + $("#frm").serialize());
                              },
                                    buttons: {
                                          "CLOSE": function(){
                                                $(this).dialog("close");
                                                $(this).html("");
                                          }
                                    }
                              })

                              return false;
                        }
                  });
0
 
Gurpreet Singh RandhawaWeb DeveloperCommented:
umm,

Not sure what to say:

1. Are you trying to show excel data in browser
2. Are you focing the Browser to show the data as XLS way in Browser like Formatting and all.

If 1, You can always do <cfoutput> the cfsavecontent text and it will show data.

id 2, that is not possible for browser to render it just like the way excel does.

for 2, you can either use Datatables to show the Records and have sorting and searching and pagination features or use cfgrid or use some custom Tag
0
 
erikTsomikSystem Architect, CF programmer Author Commented:
no I am not trying to show excel in the browser. As I said I want <cfheader will force the page to open a file in the xls format
0
 
Gurpreet Singh RandhawaWeb DeveloperCommented:
what is currently happening, are you forcing the browser to open the excel file rather than downloading
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

  • 5
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now