?
Solved

jquery ui dialog

Posted on 2013-05-28
10
Medium Priority
?
209 Views
Last Modified: 2013-08-05
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
Comment
Question by:erikTsomik
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
10 Comments
 
LVL 4

Expert Comment

by:Ahmed Hussein
ID: 39202823
Browsers doesn't support XSL display in browser, you can parse the XSL data and show it inside a custom HTML table.
0
 
LVL 19

Author Comment

by:erikTsomik
ID: 39202827
I mean xls excel format
0
 
LVL 4

Expert Comment

by:Ahmed Hussein
ID: 39202918
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
Command Line Tips and Tricks

The command line is a powerful tool at the disposal of every Linux user. Although Linux distros come with beautiful user interfaces, it's worthwhile to learn the command line because it allows you to do a number of things that you otherwise cannot do from the GUI.  

 
LVL 19

Author Comment

by:erikTsomik
ID: 39202952
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
 
LVL 19

Author Comment

by:erikTsomik
ID: 39202955
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
 
LVL 4

Expert Comment

by:Ahmed Hussein
ID: 39202973
can you please attache the jQuery code here..
0
 
LVL 19

Author Comment

by:erikTsomik
ID: 39203028
$('#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
 
LVL 16

Expert Comment

by:Gurpreet Singh Randhawa
ID: 39204275
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
 
LVL 19

Author Comment

by:erikTsomik
ID: 39204821
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
 
LVL 16

Accepted Solution

by:
Gurpreet Singh Randhawa earned 2000 total points
ID: 39205322
what is currently happening, are you forcing the browser to open the excel file rather than downloading
0

Featured Post

Video: Liquid Web Managed WordPress Comparisons

If you run run a WordPress, you understand the potential headaches you may face when updating your plugins and themes. Do you choose to update on the fly and risk taking down your site; or do you set up a staging, keep it in sync with your live site and use that to test updates?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question