Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Custom Table Filters View modes: 
User avatar
Member
Member
Armysniper89 - 6/23/2011 7:13:01 PM
   
Custom Table Filters
I have a custom table that contains job postings. In the custom table are a number of indexed values such as State or Job Type that are index values of lookup tables in SQL. I have this all working well but now I want to display a list of job postings using the Custom Table Repeater web part.

I have a stored proc that I created that can setup the display of the repeater with properly named values from the lookup tables but I cannot figure out how to setup the web part. I created a custom query for the custom table and set it to a stored proc with the name of my query. But I cannot figure out how to tell the web part to use that query. I tried using the "Filter name" property but that does not seem to work. How can I do this?

User avatar
Member
Member
kentico_michal - 6/24/2011 3:16:23 AM
   
RE:Custom Table Filters
Hello,

By default the Custom table repeater uses the query in the following format
<classname> + ".selectall"
where the <classname> is the classname of a custom table specified in the Custom table property of the Custom table repeater web part.

This default behavior can be changed in the SetupControl() method (~\CMSWebParts\CustomTables\customtablerepeater.ascx.cs):

// Query
repItems.QueryName = dci.ClassName + ".selectall";


Please keep i mind that it is recommended to clone the web part before you decide to modify it Modifying code of standard web parts.


Best regards,
Michal Legen

User avatar
Member
Member
Armysniper89 - 6/24/2011 9:35:59 AM
   
RE:Custom Table Filters
OK Thanks. Might be just easier for me to write my own web part then since I may want to use the "selectall" for actually selecting ALL. ;). I am going to open a request for a "queryname" property to be used.

The question I have remaining is...how do you configure a new Custom Table query to a stored proc. The documentation is not helpful at all since you can select "Stored Procedure" for the query type but its not clear after that how you point the query to the stored proc. Spent 2 hours trying to find it in the forums and the documentation and found nothing.

User avatar
Member
Member
kentico_michal - 6/25/2011 11:48:55 PM
   
RE:Custom Table Filters
Hello,

You can create a new query in the CMS Site Manager and set “Query type:” to “Stored procedure”. “Query text” should contain only stored procedure name, nothing else. If you do not need to use parameters in the stored procedure you can simply use query repeater and specify the query name which executes the stored procedure without parameters.

The stored procedure should be located in your database: <your_database>/Programmability/Stored Procedures.

Best regards,
Michal Legen

User avatar
Member
Member
Armysniper89 - 6/26/2011 12:48:06 AM
   
RE:Custom Table Filters
Is there a quick way to test that the query is connected properly in Kentico to the stored proc in SQL?

User avatar
Member
Member
kentico_michal - 6/26/2011 2:17:57 AM
   
RE:Custom Table Filters
Hello,

I think the easiest way how to test it is to try to use it for example in the Query repeater web part and see if it returns any results. If not, there is the Event log (Site manager -> Administration -> Event log), where you should be able to see some related exception or log.

Best regards,
Michal Legen

User avatar
Member
Member
qqayumi-qq - 7/4/2011 2:19:17 AM
   
RE:Custom Table Filters
Hello,

Is it possible to executes the stored procedure with parameters?

And how to pass these parameters from query repeater to stored procedure?

Thank.