CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Function help - resolved

Print topic Send  topic

Author Message
blasalle

Posts: 69
Posted: 08/24/2008, 1:06 PM

I've created a report that has a Search Builder to allow users to select a row based on last name (list box). I'm using the Call Function as an After Select event to assign a session variable:

CCSetSession(TempClinicId, clinic_track_id_w);

The session variable is being created and set but I'm getting the string name of the variable and not the actual value being displayed. Is this a syntax issue or is this wrong approach to capturing this value as a session variable?

thanks for any advice.

bernie


_________________
Bernie
University of Utah
Salt Lake City, UT USA
View profile  Send private message
wkempees


Posts: 1679
Posted: 08/24/2008, 2:17 PM

Your programming language?
CCSversion?
Assuming you do PhP and CCS4.
Quote :
using the Call Function as an After Select event
interpreted as: Added Action:Call Function to AfterSelect event of the report.
Function Name:CCSetSession
Parameter1:"TempClinicId"
Parameter2:

What is 'clinic_track_id_w' is it a report column?
You will have Parameter2 to be something like
$Component->something->GetValue()
or CCGetParam("clinic_track_id_w")
just the literal clinic_track_id_w will indeed give a literal text.
BTW for debugging I do: AddAction: Print Text: CCGetSession("TempClinicId")

Walter





_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
blasalle

Posts: 69
Posted: 08/24/2008, 2:24 PM

Hello Walter -

yes I'm using php (5.2) and CCS 4 and clinic_track_id_w is a report column.

bernie
_________________
Bernie
University of Utah
Salt Lake City, UT USA
View profile  Send private message
wkempees


Posts: 1679
Posted: 08/24/2008, 2:27 PM

And it is a report (after Search) with just one row?

_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
blasalle

Posts: 69
Posted: 08/24/2008, 2:33 PM

Yes - it's just one row.

I did just try using CCGetParam("clinic_track_id_w") as the second parameter but I'm still getting the literal string in the php session file.
_________________
Bernie
University of Utah
Salt Lake City, UT USA
View profile  Send private message
blasalle

Posts: 69
Posted: 08/24/2008, 2:41 PM

ps - the Add Action hint works and saves me the trouble of looking at the session file.

I'm stuck on this project without the session variable and would be more than happy to reimburse your help via PayPal.
_________________
Bernie
University of Utah
Salt Lake City, UT USA
View profile  Send private message
wkempees


Posts: 1679
Posted: 08/24/2008, 2:49 PM

Well you got me stumped!
I know you need to use GetValue() somehow, but I cannot trace the object.
Besides, AfterExecuteSelect would fire twice, once when page is opened, second time when you select a value from the dropdownlist to filter the report.

I looks like the only way I can get the value of a field in a report, is in ReportDetail, item BeforeShow.
AddAction Print: $Component->GetValue()

Sorry, we will have to wait for Guru's

Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
blasalle

Posts: 69
Posted: 08/24/2008, 2:56 PM

Well thanks for taking the time respond. I'm not much of a programmer anymore and I'm probably making it harder than it is. Hopefully someone will respond and save me from my incompetence. Maybe a report is not the best approach to getting the results of a search/select but it seemed the most straight forward way within the confines of CCS.

regards,


_________________
Bernie
University of Utah
Salt Lake City, UT USA
View profile  Send private message
wkempees


Posts: 1679
Posted: 08/24/2008, 3:08 PM

AfterExecuteSelect, does the $db->query(SQL), but does not yet do the next_record().
So no data, except for the num_rows() is available yet.
Quote :
I looks like the only way I can get the value of a field in a report, is in ReportDetail, item BeforeShow.
AddAction Print: $Component->GetValue()
Works ok even in combi with your functioncall.
Just set the initial Where clause of the report to default : -1.
It will then not display any rows upon initial entry, but will when search is executed.
The beforeShow of the item in the detail will set your session variable.
But it might reset it as well.

Maybe another approach is needed.
Will think on, what do you want to do after the sessionvar is set?

Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
wkempees


Posts: 1679
Posted: 08/24/2008, 3:11 PM

Oh ok, just read your extra post.
Not that the reimbursment stimulates, but if you tell me what you want to with the sessionvar, I think I have a nice way around the problem.
Imagine this:
Search, with dropdown.
Report, with initialy no rows, one row showing when search is done.
And the session var set.
But what then?
Because if you issue a new search session var will be reset.
Redirect?

Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
blasalle

Posts: 69
Posted: 08/24/2008, 3:15 PM

Once the session variable is set I want to use it on a number of different forms that need the same ID value. This would work because whenever the user needs to add forms for a different ID they will have to go back and execute a new search session.



_________________
Bernie
University of Utah
Salt Lake City, UT USA
View profile  Send private message
wkempees


Posts: 1679
Posted: 08/24/2008, 3:22 PM

Well I just proven the AfterExecuteSelect statement I made above.
If you add custom code to the AfterExecuteSelect
  
$Component->DataSource->next_record();  
print $Component->DataSource->f('clinic_track_id_w');  
it will display nicely, but total mess up the report (one row in report, row pointer passsed)
So that is out of the way.

Well back to you question:
Were are those other forms, on the same page?


_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
blasalle

Posts: 69
Posted: 08/24/2008, 3:27 PM

No the other forms are on different pages, which is why I wanted a session variable so that it would be available during the session regardless of which forms (pages) were selected.


_________________
Bernie
University of Utah
Salt Lake City, UT USA
View profile  Send private message
wkempees


Posts: 1679
Posted: 08/24/2008, 3:33 PM

Ok, So you have a Search with a dropdownlist that calls a report limited to one row and some mechanism that allows users to go to other pages/forms.
How did you implement the 'going to...", do you have a redirect link somewhere on that Search/Report combi?
If so, even still using the report (which indeed might not be best choice) we could set the sessionvar as described (or to be described more clearly in detail).
The report could just as wel be a Grid, same way resulting in one row, however a Grid allows for a standard 'id' link or a more advanced "Details" link both could be passing a URL var or a session Var to the next pages.

In short, tell me your method of redirection and I can figure out what to advice.


_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
blasalle

Posts: 69
Posted: 08/24/2008, 3:41 PM

There is a menu that allows users to go to any one of 20 forms (pages) in any order they wish, but each form has a redirect to the 'next form' which follows a set order. So once they select the correct person they can simply start filling out forms and automatically be taken through the entire set. This is the most likely scenario but I wanted to give them the option of choosing any form at random in case they do not have a full set of forms to enter (which is not uncommon).


_________________
Bernie
University of Utah
Salt Lake City, UT USA
View profile  Send private message
blasalle

Posts: 69
Posted: 08/24/2008, 3:46 PM

I have not given a full test yet outside of my development model but it seems to be working so far. I can probably tweak it later to add some robustness but this seems to do the trick.



_________________
Bernie
University of Utah
Salt Lake City, UT USA
View profile  Send private message
wkempees


Posts: 1679
Posted: 08/24/2008, 3:57 PM

In fact the solution is already written here, even not knowing how you intend to redirect.
Go back to this working situ:
Search with Dropdown.
Report, displaying one row only when Search is executed.
In the Reports, Where clause set the default value to -1 to make the report initally empty.
Then in BeforeShowRow of the 'clinic_track_id_w' do this:
AddAction-> Call Function
Function: CCSetSession
Parameter1:"TempClinicId" (do not forget the double quotes
Parameter2: $Component->GetValue()

AddAction-> PrintText: CCGetSession("TempClinicId")

Now the Sessionvar is correctly set and you can jump wherever you like carrying the sessionvar.

In fact, I just realised I do almost the same in one of my apps.
Initial menu is:
Cases
- Find Case
- Add New Case

When user goes Find Case and selects one, the Menu expands to show various detail screens.
Cases
- Find Case
- Add New Case
- Case Details
- Case Users
and so on.
(This was before Tabs and Web4.0 (lol)

Walter, Go and do it.





_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
wkempees


Posts: 1679
Posted: 08/24/2008, 4:00 PM

Yep, we are done!
Our post are a bit out of sync but hey it is all there, we even write the same things.
Hope you enjoyed it, I did.
01:00 AM Monday, turning in now.

Walter

_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
blasalle

Posts: 69
Posted: 08/24/2008, 4:01 PM

Thanks again - I did pull all of the pieces out from the previous sends and I think I'm on my way.

bernie


_________________
Bernie
University of Utah
Salt Lake City, UT USA
View profile  Send private message
wkempees


Posts: 1679
Posted: 08/24/2008, 4:18 PM

Change title to [Resolved]......
Please

Walter

_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
wkempees


Posts: 1679
Posted: 08/25/2008, 9:08 AM

Check you Personal Messages please.
Thank you for donating!
[Closed]
Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
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.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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