Page 1 of 1
export with headings vs. sortable columns
Posted: Fri Apr 11, 2014 11:40 am
by Larelyn
Hi, when I try to use both the "sortable columns" property along with "export with headings" on a grid, it seems the export property turns off the ability to click on the column header to sort. The user must use the right-click-and-sort feature of the export property to sort at all. Is this intentional? Shouldn't the column header click work regardless of the state of the export property? (this isn't urgent by any means by the way)
Thanks!
Re: export with headings vs. sortable columns
Posted: Fri Apr 11, 2014 1:10 pm
by Larelyn
apologies - not the "export with headings" but rather the "export option". That is the property that doesn't play nicely with sortable columns.
Re: export with headings vs. sortable columns
Posted: Fri Apr 11, 2014 1:52 pm
by Scott Klement
I'm trying to reproduce this problem, but it seems to be working for me... I can sort by clicking the column header or by using the right-click option. Both work perfectly in my tests. I have the following:
- SortExport.png (8.74 KiB) Viewed 757 times
Can you tell me how to reproduce the problem you're seeing?
Re: export with headings vs. sortable columns
Posted: Thu Apr 17, 2014 3:54 pm
by bluttman
I'm having a similar problem. Simple grid with the following properties:
When you right click the column you get only the Export option. And the column is not sortable. It is resizeable and moveable.
Also, I am getting a csv file with ONLY headings but no data.
I am filling the grid with a custom sql statement in javascript.
Sometime in the last 2 months the export feature stopped working.
Re: export with headings vs. sortable columns
Posted: Thu Apr 17, 2014 4:11 pm
by bluttman
Update to export issue.
Apparently sometime in the last few months something has changed that now requires me to "cast" some fields into ccsid 37 when using export with a custom sql built grid.
Re: export with headings vs. sortable columns
Posted: Thu Apr 17, 2014 4:13 pm
by Scott Klement
Do all of the problems (given in this discussion thread) only occur with database-driven grids? That could be why I couldn't reproduce it.
Re: export with headings vs. sortable columns
Posted: Thu Apr 17, 2014 4:17 pm
by bluttman
Actually I recall now that sortable columns won't work with a custom sql driven screen. Had to do something with not being able to update the "Order by" clause.
The need to cast the fields in order change the ccsid is new to me.
Re: export with headings vs. sortable columns
Posted: Thu Apr 17, 2014 4:19 pm
by Scott Klement
Can you post the SQL settings that you are using (including the CAST, etc)? thanks!
Re: export with headings vs. sortable columns
Posted: Thu Apr 17, 2014 4:35 pm
by bluttman
select
cast(rpicut||' '||rpicu as char(10) ccsid 37) as Batch,
cast(rpdct||' '||rpdoc as char(25) ccsid 37) as Invoice,
cast(rpsdct||' '||rpsdoc as char(20) ccsid 37) as Order,
rpalph as DESC,
char(xdatej(rpdgj),USA) as GLDATE,
rpag*.01 as AMOUNT
FROM f0311
WHERE RPICUT = 'R' and rppn = 4 and rpfy = 14
order by rpicu, rpdoc
Original:
select
rpicut||' '||rpicu as Batch,
rpdct||' '||rpdoc as Invoice,
rpsdct||' '||rpsdoc as Order,
rpalph as DESC,
char(xdatej(rpdgj),USA) as GLDATE,
rpag*.01 as AMOUNT
FROM f0311
WHERE RPICUT = 'R' and rppn = 4 and rpfy = 14
order by rpicu, rpdoc
Some fields in this JDEdwards database are ccsid = 65535
Re: export with headings vs. sortable columns
Posted: Thu Apr 17, 2014 5:15 pm
by Scott Klement
There was a change made to CSV export in Profound UI 4.6.3 where we ask the database (IBM DB2 for i) to return our SQL query in UTF-8 format. Prior to that, it returned the SQL data in EBCDIC, and we subsequently converted it to UTF-8. The problem with getting it in EBCDIC is that if the customer had any Unicode fields in the database, they'd lose any characters that didn't exist in their job's EBCDIC, causing big problems.
I can only guess that this change broke compatibilty with non-text fields. (CCSID 65535 means "this is not text, it is raw hex data"). I don't know WHY it would... (I can't see why it's easier to translate CCSID 65535 to EBCDIC than it would be to translate it to UTF-8... but, nevertheless, I'm guessing that IBM decided to translate one but not the other.)
The CAST solution seems like it should work. Is that a good enough solution? Or do you have too many programs to change?
The "sortable columns" problem... I'm only guessing here, but I think it's perhaps because your column is defined as a whole expression (like rpicut||' '||rpicu) When you click on the column to sort it, it tells DB2 to order by on the column named "rpicut||' '||rpicu", which obviously won't work.
You could fix the order by problem by loading the subfile manually in your RPG program. If you run the SQL statement there, you won't have to worry about the CCSID problem, and if you do a "load all" subfile, the sorting will be handled in the browser, so there won't be a need to have SQL use order by. Will that work for you?