• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

[HELPED] vvOut_SQLtoCSV

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [HELPED] vvOut_SQLtoCSV

    I get an error stating "missing ) in parenthetical" with all my titles and data there, it just does not open the csv file in firefox. This is the spec for the vvOut data structure:

    Code:
             vvOut.download = 'Y';
             vvOut.file     = 'flockSchedule.csv';
             vvOut.longSqlNames = 'Y';
             vvOut_execSqlToCSV(vvOut:stmt);
    It appears the SQL statement is working fine, it just isn't completing the csv file process. All the data is showing up in debug in the response.

  • #2
    I was using an AJAX call to perform this function and was looking for a response. The response was where the error was occuring. I corrected this and only look for some response, but still do not get the option to open the Excel sheet. I'm still missing something, probably obvious.

    Comment


    • #3
      Hey Ken,

      I'm looking into that now. it might be nice to do a gotomeeting so I can see the details on that.

      Scott



      Originally posted by ktoole View Post
      I get an error stating "missing ) in parenthetical" with all my titles and data there, it just does not open the csv file in firefox. This is the spec for the vvOut data structure:

      Code:
               vvOut.download = 'Y';
               vvOut.file     = 'flockSchedule.csv';
               vvOut.longSqlNames = 'Y';
               vvOut_execSqlToCSV(vvOut:stmt);
      It appears the SQL statement is working fine, it just isn't completing the csv file process. All the data is showing up in debug in the response.

      Comment


      • #4
        From the example I don't do an AJAX call, I use
        Code:
        	var exportToCSV = function() {
        		Ext.DomHelper.append(document.body, {
        			tag: 'iframe',
        			frameBorder: 0,
        			width: 0,
        			height: 0,
        			css: 'display:none;visibility:hidden;height:1px;',
        			src: 'vvcall.pgm?sid='+sid+'&app='+app+'&pgm=excsvdload&action=getCustRecsCSV'
        		});
        	};
        Is there an eaiser way to specify the params for the 'src'? I have several parameters I need to pass to the program. Is there a way to do this in the format that the AJAX call uses?

        Comment


        • #5
          Yes, you can use Valence.util.download instead.

          Code:
          Valence.util.download({
              pgm : 'excsvdload',
              action : 'getCustRecsCSV',
              anotherParm : 'xxxx',
              anotherOne : 123
          });
          Note: no need to specify sid and app as Valence.util.download automatically adds this.
          Last edited by sean.lanktree; 05-01-2012, 09:33 AM. Reason: wrap code tags

          Comment


          • #6
            Sean,

            I put the above code in and now I get a message that Ext.core is undefined. I'm using Valence 3.0.20120201.0 and not the latest version. This code is also written in ExtJS 3 not 4 and I can't convert it yet. Is there a way to do what you suggest with this version?

            Comment


            • #7
              This sounds like a bug. I assume you are pulling in the "valence.js" file and not the "valence-extjs4.js" file, correct? If so, can you open up the valence.js file and change "Ext.core.DomHelper" to "Ext.DomHelper" and let us know if that fixes it for you?

              Comment


              • #8
                <script type="text/javascript" src="/extjs/adapter/ext/ext-base.js"></script>
                <script type="text/javascript" src="/extjs/ext-all-debug.js"></script>
                <script type="text/javascript" src="/vvresources/valence.js"></script>

                Is what I have in the header. I made the change from Ext.core.DomHelper to Ext.DomHelper and it works now. Thanks. I assume I should leave this change in there and it won't negatively effect anything else.

                One more follow up question, I was looking at the 3.1 version API's to see what was different from the version we are running and if your API was listed there, and saw the vvOut_execSQLtoSS API. Would you be able to email me an example of a ssTemplate with a styleID that is not the default one. I would like to compare the two to figure out how this works and what options I can control in the output.

                Comment


                • #9
                  Sorry, one more question, any way to trap for errors like the AJAX call does with success for the Valence.util.download routine? If something goes wrong on the conversion or download, I'd like to tell the user there is a problem.

                  Comment


                  • #10
                    vvOut_execSQLtoSS example

                    For the vvOut_execSQLtoSS there is an App called 'Spreadsheet Download' and an example RPG program exSS01 that uses it. EXSS01 uses custom column headings, hides columns, and uses columns in a different order from the SQL statment - all optional. The default settings of Valence 3.1 will use the spreadsheet Template in vvResources called vvSSTemplate.xls The template is an XML file of the required elements for a XML Spreadsheet which include styles. You can open the file with a text editor to view the included styles. You can copy and edit the file to make your own template with your own styles. Here is an example of a style included in the vvSSTemplate.xls:
                    Code:
                    <Style ss:ID="num2"> <Alignment ss:Horizontal="Right" ss:Vertical="Top" ss:WrapText="1"/>
                     <NumberFormat ss:Format="#,##0.00;[Red]#,##0.00"/> 
                    </Style>
                    The format is dictated by Excel for numbers and is a bit cryptic. I found that opening a spreadsheet generated, then customizing a cell to the format you want then opening up the file with a text editor to cut/paste the customized cell is a good way to get the style properly formatted. Excel itself will also reformat numbers based on the international settings in Excel, so decimal points and thousands separators may be different than how they appear in the style.

                    Comment


                    • #11
                      BRandle,

                      Thanks for the info on the example. I'll use that for the next spreadsheet, once we start using 3.2.

                      Comment


                      • #12
                        Is what I have in the header. I made the change from Ext.core.DomHelper to Ext.DomHelper and it works now. Thanks. I assume I should leave this change in there and it won't negatively effect anything else.
                        Yes, you can just leave this. It has also been updated in our base source.

                        Sorry, one more question, any way to trap for errors like the AJAX call does with success for the Valence.util.download routine? If something goes wrong on the conversion or download, I'd like to tell the user there is a problem.
                        Unfortunately not.

                        Comment

                        Working...
                        X