• 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.

[SOLVED] Ampersand does not appear correctly in excel download

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

  • [SOLVED] Ampersand does not appear correctly in excel download

    I am downloading the string C&I to excel, but it appears as C&I in the spreadsheet.

    The relevant RPG code I am using is:

    Code:
    d recStructureX e ds                  extname(R0033DSX) inz 
    d recordsX      e ds                  extname(R0033DSX) qualified
    d                                     inz dim(500)               
    d col             ds                  likeds(vvSSCol)            
    d                                     dim(26) inz                
    
    clear recStructureX;
    
    SELSLSCHNLX = post_channel;
    if SELSLSCHNX = 'C&I';      
      SELSLSCHNX = 'C'+AMP+'I'; 
    endif;
    
    count += 1;
    recordsX(count) = recStructureX;                      
    
    col(25).sqlName  = 'SELSLSCHNX';            
    col(25).heading  = 'Selected Sales Channel';
    
    vvOut.object='R0033DSX';                              
    vvOut.download = 'F';                                 
    vvOut.file     = attachmentPath;                      
    vvOut_toSS(vvOut:%addr(recordsX):count:%addr(col):26);
    SELSLSCHNX is defined as follows in R0033DSX:

    Code:
    .....A..........T.Name++++++RLen++TDpB......Functions++++++++++++++++++
         A            SELSLSCHNX     3          TEXT('Selected Sales Channel')
    Would appreciate any help to fix this issue.

    TIA

  • #2
    Thanks for the heads-up. The problem appears to be a small bug in the vvOut routine that is "double-encoding" the ampersand.

    I believe the fix is as simple as removing one line of code. Would you like to try it there for us?

    In VVOUT, in the WriteSS procedure, search for this line (should be at or around line 2334, depending on which version you're on):
    Code:
    vvUtility_encode(extrValue:EXCEL);
    Comment out that line, then recompile the module and update the service program with the following commands:
    CRTSQLRPGI OBJ(VALENCE32/VVOUT) SRCFILE(VALENCE32/QRPGLESRC) OBJTYPE(*MODULE) COMPILEOPT('STGMDL(*SNGLVL)')
    UPDSRVPGM SRVPGM(VALENCE32/VVSRVPGM) MODULE(VALENCE32/VVOUT)

    Then restart the server instance and it should work after that. Assuming it does, we'll include this fix in the next update. Let us know!

    Thanks,
    Rob

    Comment


    • #3
      Ampersand does not appear correctly in excel download - FIXED

      Hi Robert Swanson,

      I am pleased to report that I applied the fix and it works. C&I appears correctly in the spreadsheet now.

      Thank you for your help.

      Comment

      Working...
      X