In an rpg program, I want to build a database file in qtemp, and have that file bound to a grid when the screen is displayed.
For some reason, when I run the program, the data is not showing in the grid. I can see in the joblog that the records are copied into the "qtemp/filename" (which is what is used in the database file property of the grid).
RPG - calls a cl that creates the file in qtemp (crtdupobj from existing file), then a simple cpyf is used to populate the data into the QTEMP file.
the RPG then executes the format to display the grid. The grid shows no data, but the "rows" when I scroll down indicate 92 items are in the grid.
Should this work?
access to qtemp file for grid
-
- Profound User
- Posts: 83
- Joined: Sun Oct 03, 2010 8:45 am
- First Name: Mike
- Last Name: Geldert
- Company Name: Stonriver
- Country: Angola
- Contact:
-
- Profound User
- Posts: 83
- Joined: Sun Oct 03, 2010 8:45 am
- First Name: Mike
- Last Name: Geldert
- Company Name: Stonriver
- Country: Angola
- Contact:
Re: access to qtemp file for grid
ALSO, I just tried to use the named file in standard (non-qtemp) library, but use a member of the file to segregate the data. In this test, I used a wrapper -CL to ovrdbf to a specific member, then call the RPG which displays the grid bound to the PF (overriden to proper data I had hoped). This doesn't seem to display data either.
- Brian
- Profound Logic Staff Member
- Posts: 286
- Joined: Thu Apr 14, 2011 10:23 am
- First Name: Brian
- Last Name: May
- Company Name: Profound Logic Software
- Contact:
Re: access to qtemp file for grid
When using the grid properties to automatically fill a grid from a file, the page makes an AJAX request to retrieve the data from the file after the screen is loaded. This will always go to another webserver job, so things like QTEMP and OVRDBF won't apply since you are in a different job.
If you need to limit the data for the grid, the "Selection Criteria" property can help you do so. It is basically the "WHERE" clause of the SQL statement used to retrieve the data. If you need something more complex than a simple where clause, the "Custom SQL" property will allow you to write your own SQL statement to retrieve the data for the grid.
If you need to limit the data for the grid, the "Selection Criteria" property can help you do so. It is basically the "WHERE" clause of the SQL statement used to retrieve the data. If you need something more complex than a simple where clause, the "Custom SQL" property will allow you to write your own SQL statement to retrieve the data for the grid.
-
- Profound User
- Posts: 83
- Joined: Sun Oct 03, 2010 8:45 am
- First Name: Mike
- Last Name: Geldert
- Company Name: Stonriver
- Country: Angola
- Contact:
Re: access to qtemp file for grid
Thanks Brian, we're trying to build some things like links and urls into the grids that are program created, and thought the qtemp way might help us along with helping to implement filtering and such when building the grid data. I'm not sure I can use SQL to build the data elements I"m trying to build (at least not with my sql expertise). I'll look further to see if there's anyway SQL could do what I need.
Also, if the Grid is using Ajax requests from the front end, is it possible for Profound Logic to implement a way to do column filtering (where the user can input a filter on a column, and have the data refreshed with the filter applied)?
Also, if the Grid is using Ajax requests from the front end, is it possible for Profound Logic to implement a way to do column filtering (where the user can input a filter on a column, and have the data refreshed with the filter applied)?
- Brian
- Profound Logic Staff Member
- Posts: 286
- Joined: Thu Apr 14, 2011 10:23 am
- First Name: Brian
- Last Name: May
- Company Name: Profound Logic Software
- Contact:
Re: access to qtemp file for grid
I can certainly bring it up during our next staff meeting. Could be a cool feature.
Of course, you could accomplish this yourself if you put a text box over the columns to be filtered. You could then use some javascript to dynamically build your where clause in the grids properties.
Of course, you could accomplish this yourself if you put a text box over the columns to be filtered. You could then use some javascript to dynamically build your where clause in the grids properties.
-
- Profound User
- Posts: 83
- Joined: Sun Oct 03, 2010 8:45 am
- First Name: Mike
- Last Name: Geldert
- Company Name: Stonriver
- Country: Angola
- Contact:
Re: access to qtemp file for grid
I'll have to try that again I thought once the grid was displayed(screen was displayed) I'd have to make another round trip to the iseries to apply the where clause (or custom SQL). I was wanting to see if the properties (selection) could be applied in the front end without returning to the server(with my program) since the grid is using an Ajax request.
-
- Profound User
- Posts: 83
- Joined: Sun Oct 03, 2010 8:45 am
- First Name: Mike
- Last Name: Geldert
- Company Name: Stonriver
- Country: Angola
- Contact:
Re: access to qtemp file for grid
also, if I'm adding to the wish list on the grid, since we cant use an ovrdbf (do to the Ajax rqst being processed in a separate job), is there a way to specify a file member (of a multi-member database file) in the properties of the grid?
- Brian
- Profound Logic Staff Member
- Posts: 286
- Joined: Thu Apr 14, 2011 10:23 am
- First Name: Brian
- Last Name: May
- Company Name: Profound Logic Software
- Contact:
Re: access to qtemp file for grid
Well, the grid uses SQL to access the data. SQL doesn't do members. What you would have to do is create an SQL alias. This can point to a specific member. So for example:
CREATE ALIAS LIBRARY.NAME FOR LIBRARY.FILE (MEMBER)
Then you would use the new alias (NAME in the above example) instead of the file name. The alias will only show data for the member it points to. This is a one time thing, so you don't need to do it in your program. Once you run the CREATE ALIAS statement it will create an object (which is actually a DDM file) in your library with the name you specified.
CREATE ALIAS LIBRARY.NAME FOR LIBRARY.FILE (MEMBER)
Then you would use the new alias (NAME in the above example) instead of the file name. The alias will only show data for the member it points to. This is a one time thing, so you don't need to do it in your program. Once you run the CREATE ALIAS statement it will create an object (which is actually a DDM file) in your library with the name you specified.
-
- Profound User
- Posts: 83
- Joined: Sun Oct 03, 2010 8:45 am
- First Name: Mike
- Last Name: Geldert
- Company Name: Stonriver
- Country: Angola
- Contact:
Re: access to qtemp file for grid
Great Tip Brian. That will help in a few instances where we have multi-member files.
THANKS
THANKS
Who is online
Users browsing this forum: Bing [Bot] and 9 guests