CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 [SOLVED] Using Forms I think.

Print topic Send  topic

Author Message
Rocket

Posts: 45
Posted: 09/17/2010, 10:24 AM

I'm not sure which forum to post this question in, so I thought I'd do so here.

I have three tables, TableA, TableB, TableC. TableA contains account details (used by Login FOrm), TableB are profiles for TableA (could be multiple). TableC has order details for TableB (could be many).

After logging in (TableA Acct), I need to place on the screen, basic account information from TableA, then load certain data from TableB and show this on screen, then the detailed records from TableC (for TableB).

To be fair and honest, I've gone over all the tutorials (both included and online) and dan't seem to find the information I'm looking for with regard to this scenario. I can create Master/Detail, listing pages etc, but nothing like what I am asking.

I know this 'bad boy' can do it, it just has so much power and perhaps too much for a newbie like myself. One day Alice, One day...

I'm still new at this product and I hope that I am not wasting anyones time and this makes sense.I cna provide a sceen snapshot of an existing system if that would help.

I would appreciate any guidance.

Thanks.
View profile  Send private message
CodeChargeMVP

Posts: 473
Posted: 09/23/2010, 6:58 AM

Mostly All is possible on CCS.
_________________
Best Regards
Entrepeneur | NT Consultant
View profile  Send private message
Rocket

Posts: 45
Posted: 09/23/2010, 12:51 PM

Quote CodeChargeMVP:
Mostly All is possible on CCS.

Thank you fo rthe reply sir (or ma'am). I guppose I should be a little more correct when posting, I was wondering how one would do this. I've created a form and am getting the first set of data, but I also need to have on the same page a second form that would get the second set of data. This is where I am all foo-bard. I created a second form, but can't see how to tell CCS4 that the data in the second form is to be retrieved based the index (or key value) of the second table on the second form on the same page.

Have I sufficiently confused everyone???

:) Thanks
View profile  Send private message
datadoit
Posted: 09/23/2010, 2:14 PM

Each of your tables 'should' have a relationship. You then connect
those tables visually via some form of trigger, be that a URL parameter,
a session variable, a query, whatever.

Sounds like TableA gets it's trigger from a session variable (the UserID
of the logged in user?). Sounds like TableB gets it's trigger also from
the UserID (?).

So what is the trigger for TableC?

Also, you mention 'forms'. Are those record forms (CRUD)? or just
display grids?

CodeCharge Studio is just an application for displaying and editing your
data. It doesn't eliminate the need to design, plan and coordinate your
data and processes beforehand.

Do you have a data structure already? If so, post it here and let's see
if we can determine what the relationships are.
Rocket

Posts: 45
Posted: 09/23/2010, 7:28 PM

Quote datadoit:
Each of your tables 'should' have a relationship. You then connect
those tables visually via some form of trigger, be that a URL parameter,
a session variable, a query, whatever.

Sounds like TableA gets it's trigger from a session variable (the UserID
of the logged in user?). Sounds like TableB gets it's trigger also from
the UserID (?).

So what is the trigger for TableC?

Also, you mention 'forms'. Are those record forms (CRUD)? or just
display grids?

CodeCharge Studio is just an application for displaying and editing your
data. It doesn't eliminate the need to design, plan and coordinate your
data and processes beforehand.

Do you have a data structure already? If so, post it here and let's see
if we can determine what the relationships are.

I've been tryng to reply to this message and when I click submit, the form redisplays, but nothing gets posted.

Am I limited to the number of posts?//
View profile  Send private message
CodeChargeMVP

Posts: 473
Posted: 09/24/2010, 4:32 AM

I Experienced the same last days, but when changing the computer,

I was able to reply, of course youŽre not limited on the number of posts,

you can ask as much as you like, this way weŽll go further faster.

Quote Rocket:
Quote datadoit:
Each of your tables 'should' have a relationship. You then connect
those tables visually via some form of trigger, be that a URL parameter,
a session variable, a query, whatever.

Sounds like TableA gets it's trigger from a session variable (the UserID
of the logged in user?). Sounds like TableB gets it's trigger also from
the UserID (?).

So what is the trigger for TableC?

Also, you mention 'forms'. Are those record forms (CRUD)? or just
display grids?

CodeCharge Studio is just an application for displaying and editing your
data. It doesn't eliminate the need to design, plan and coordinate your
data and processes beforehand.

Do you have a data structure already? If so, post it here and let's see
if we can determine what the relationships are.

I've been tryng to reply to this message and when I click submit, the form redisplays, but nothing gets posted.

Am I limited to the number of posts?//

_________________
Best Regards
Entrepeneur | NT Consultant
View profile  Send private message
Rocket

Posts: 45
Posted: 09/24/2010, 5:00 AM

Ok, so I got two forms in the GUI and they are formatted the way I want and list the data that I need in the format required.

How do I tell CCS4 to list only the records for the currently logged in user or all if the user is an Admin.

I'm trying to use the USER_ID and GROUP_ID session vars, but not sure where to specify the query code to do this. I seemed to recall that in a Demo or the Docs it mentioned this, but can't re-locate it.

Thanks all...
View profile  Send private message
GeorgeS

Posts: 206
Posted: 09/24/2010, 11:25 AM

Quote :
I'm trying to use the USER_ID and GROUP_ID session vars, but not sure where to specify the query code to do this
On the Project Explorer panel on the left look for Common.php file under Common Files group.
Inside Common.php at the very bottom of it you'll find the names of your sessions vars:
function CCLogoutUser()
{
CCSetSession("UserID", "");
CCSetSession("UserLogin", "");
CCSetSession("GroupID", "");
}

*Study Common.php to see what kind of functions does it have

To set where condition for your forms do this:
-select the form
- in the properties panel click on the Data Source row and you'll see "..." 3 dotted button
- click on it and set WHERE condition by clicking on [+] button
- select TYPE of the parameter as Session
- the name of the session above should look like this: UserID
(NOT "UserID" or USER_ID or CCGetSession("UserID"))



_________________
GeorgeS
View profile  Send private message
Rocket

Posts: 45
Posted: 09/24/2010, 1:19 PM

Quote GeorgeS:
Quote :
I'm trying to use the USER_ID and GROUP_ID session vars, but not sure where to specify the query code to do this
On the Project Explorer panel on the left look for Common.php file under Common Files group.
Inside Common.php at the very bottom of it you'll find the names of your sessions vars:
function CCLogoutUser()
{
CCSetSession("UserID", "");
CCSetSession("UserLogin", "");
CCSetSession("GroupID", "");
}

*Study Common.php to see what kind of functions does it have

To set where condition for your forms do this:
-select the form
- in the properties panel click on the Data Source row and you'll see "..." 3 dotted button
- click on it and set WHERE condition by clicking on [+] button
- select TYPE of the parameter as Session
- the name of the session above should look like this: UserID
(NOT "UserID" or USER_ID or CCGetSession("UserID"))




Thanks George, I did exactly as you said (except I'm using ASP - but the same thing). Anyway, I added the where clause and all of the records for TableB are being displayed. I used debugging (response.write) and the session variable USER_ID is correct as is the index field that I am using in the where clause, yet all the records for tableb are displayed.

Here is the where clause: where campaign.user_id = {user_id} (Gui displayed).

One interesting thing is that I periodically get this error when building the grid (paraphrasing):

"Loading fields list: HY000:[Microsoft]... Connection is busy..."

i read in other posts that this is caused by pirated version. I can assure everyone that this is a version downloaded 6 days agor from the site (and I just downloaded it again 2 horus ago), so piracy is out of the question.

So I'm wondering if perhaps the retrieval of the records are a result of that error or if perhaps there is something on my Vista Ultimate that I need installed or configed. I am using MSQL SQL Native Connection (tried standard SQl and building a connection string), same sporadic error.
The only thing that is consistent is the fact that all records are displayed regardless of the wherre clause (I even tried an expression that would not display any records at all) and they are still being displayed.

Hmmm....

btw: thanks for the guidance and the pointer above, it was "Way too obviuous".
View profile  Send private message
GeorgeS

Posts: 206
Posted: 09/24/2010, 3:58 PM

Quote :
perhaps there is something on my Vista Ultimate that I need installed or configed

I have not tried asp with SQL server on my Win7 64 bit but I remember having some troubles with finding the right version of MySql driver.
If you have an old XP machine try it there - should be stable and easy.

_________________
GeorgeS
View profile  Send private message
Rocket

Posts: 45
Posted: 09/24/2010, 4:50 PM

Quote GeorgeS:
Quote :
perhaps there is something on my Vista Ultimate that I need installed or configed

I have not tried asp with SQL server on my Win7 64 bit but I remember having some troubles with finding the right version of MySql driver.
If you have an old XP machine try it there - should be stable and easy.


Thanks George, I think the problem was that I had my DB opened in my SQL Admin tool, it appears that if he is not running there no apparent problems.

Now with regard to the Where clause, it sitll displays all the child records as apposed to the ones that belong to the logged in user (I examined the session("USER_ID") with repsonse.write and it is corrent as is the link index field of the child). Any ideas here?

If I don't hear from you todya, have a good weekend and thanks again for the assistance.
View profile  Send private message
GeorgeS

Posts: 206
Posted: 09/25/2010, 1:06 PM

Try this:
select the form
on the properties panel go to the Events tab and right-click on BeforeShow event
choose Add Code and
type the debug line in the white Custom Code area for BeforeShow event on "YourPage_events.asp" page to see your Where clause:

response.write (YourFormName.DataSource.Where)

if your session value is empty there
try this:
Build a login page using CCS auth. builder and all sessions will be set for you by CCS:
CCSetSession("UserID", "");
CCSetSession("UserLogin", "");
CCSetSession("GroupID", "");


Try and see if it will work with the session named UserID.





_________________
GeorgeS
View profile  Send private message
Rocket

Posts: 45
Posted: 09/25/2010, 1:42 PM

Quote GeorgeS:
Try this:
select the form
on the properties panel go to the Events tab and right-click on BeforeShow event
choose Add Code and
type the debug line in the white Custom Code area for BeforeShow event on "YourPage_events.asp" page to see your Where clause:

response.write (YourFormName.DataSource.Where)

if your session value is empty there
try this:
Build a login page using CCS auth. builder and all sessions will be set for you by CCS:
CCSetSession("UserID", "");
CCSetSession("UserLogin", "");
CCSetSession("GroupID", "");


Try and see if it will work with the session named UserID.






Thanks George, I actually just got it moments before your reply. I used CCSetSession("UserID", "") first and it worked. Then I tried using just the session variable and it was empty. So, after much revisiting of the tuts and help file, I found "MY" error. From past RAD systems I used the session var User_ID and that's what I put into the project properties and of course USER_ID is not the same as USERID.

If not for your posts, I would probably still be fighting with this. Old habits eh...

Thanks again, your help is very much appreciated.
View profile  Send private message
GeorgeS

Posts: 206
Posted: 09/25/2010, 2:27 PM

Congrats!
I am still learning CCS even after many years of using it since v. 2

Please, don't forget to mark your original post as SOLVED and, perhaps change the header to explain the problem with non-CCS session...
:)
_________________
GeorgeS
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.