Do "data display" fields have a character limit? I want to display an obsterm using LIST_OBS but I am sure if I will run into an issue.....
You can normally store 2000 characters in an OBS code. However, to display that could take the entire screen (80x25 = 2000).
Can you provide more info on what you are trying to display?
this is the MEL expression inside the DATA DISPLAY:
{
list_obs("DMARD","Signed","list","valuedate")
}
....my question is regarding character limits for a DATA DISPLAY.....
There is no 'limit' that I am aware of or experienced. However, that does not mean that there are no issues associated with using large chunks of data in a data display. Specifically, each character is a byte the system must manage and as such, the robustness of the machine's RAM allocation, CPU/Bus speed, and GPU capabilities will determine how using large blocks of data affect performance. CPS systems seem to be a bit more sensitive to larger chunks of data being present in data displays to the point of crashing to desktop.
Performance issues can be mitigated by simply breaking up the data into smaller chunks and implementing a 'More' or 'preious/next' button method. If we are realistic, displaying more than 2K characters at a time is not typically possible due to real estate/layout concerns, therefore, it would make sense not to continuously burden the system with managing more than it can display, especially when additional data can be loaded on demand.
Thanks, Lee.....Could you please describe how you would implement "More" or "Previous" button methods?...How do you specify which "last" observation to display? LastObsValueDate, obsprev, etc... always return the most recent....
On paginating data:
This can be done a few different ways, but the most efficient would probably be to store the results from your LIST_OBS expression into an array and then paginate the values out into a separate array for the purpose of displaying it on your form. You could use a previous and next button to step through the "pages" of your data. You can get your data into the first array by using this command:
arrValues = getfield(OBS_LIST("DMARD","Signed","list","valuedate"),"\r","")
You can then determine the number of pages you will need by dividing the number of values in the array above by the number of items you will want to display on each page (note: you can use the div() and mod() functions to identify the total number of pages). Something like this:
numValues = size(arrValues)
itemsPerPg = 10
if mod(numValues,itemsPerPg) <> 0 then
numPages = div(numValues,itemsPerPg) + 1
else
numPages = div(numValues,itemsPerPg)
endif
You can then store each "page" of data (10 items per page in this example) in a separate array by creating a pipe delimited list of all the items on each page. For example, let's say you called your pagination array "pageData" and the total number of values in the "arrValues" array defined above was 32, your pageData array would have 4 records (4 pages of data) as follows:
pageData(0): val1 (date1)|val2(date2)|val3 (date3)|....|val10(date10)
pageData(1): val11 (date11)|val12(date12)|val13 (date13)|....|val20(date20)
pageData(2): val21 (date21)|val22(date22)|val23 (date23)|....|val30(date30)
pageData(3): val31 (date31)|val32(date32)
You will likely need to use nested "for loops" to create your pageData array, but once that is done, you could set up <next> and <previous> buttons on your form that would display the appropriate page of data when they were clicked. I would store the current page number in a hidden variable and then increment/decrement the page number variable based on the button that was clicked (next/previous). You could then update the data display based off of the corresponding array index (i.e. current page number -1). You could have a function that converts the corresponding pageData row (pipe delimited values) into a nice formatted list in the data display.
I hope this provides some insight. I would have provided more code, but I'm slammed today. In any event, this should get you pointed in the right direction. Perhaps someone has written a pagination function for just this purpose that they will post.