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 -> PHP

 Display Comments

Print topic Send  topic

Author Message
Damian Hupfeld
Posted: 07/23/2005, 6:46 AM

I have a NEWS section on a website and people can post COMMENTS

NEWS page looks like this:

NEWS Article | List of News
some text | news item 3
some text | news item 2
some text | news item 1

COMMENTS
Comment1
Alt_Comment2

NEWS grid and COMMENTS grid both have parameters
WHERE NEWS_ID=NEWS_ID (URL)

This works fine when someone clicks on an item in the List of News because
the parameter ?news_id=X is passed.

When someone opens the NEWS page without parameters (eg from the MENU) the
NEWS grid displays the latest NEWS article. How do I tell the COMMENTS grid
what the latest NEWS_ID is?


regards
Damian Hupfeld


Nicole

Posts: 586
Posted: 07/23/2005, 7:43 AM

Damian,
Try to store NEWS_ID in Before Show Row event of NEWS form into custom session variable (if page is loaded without NEWS_ID parameters). Then use it to filter COMMENTS table on this value. I think that in this case you need to modify WHERE in Before Build select event.

_________________
Regards,
Nicole
View profile  Send private message
Damian Hupfeld
Posted: 07/23/2005, 11:49 PM

Thanks Nicole,

Just to clarify in case anyone else was interested this is how it went...

NEWS Article | List of News
some text | news item 3
some text | news item 2
some text | news item 1

COMMENTS
Comment1
Alt_Comment2

In NEWS grid I added the following
Before Show Row
-> Add Action
-> Save Control Value
Control Name: newsid
Destination Type: Session
Destination Name: newsvar

In the COMMENTS grid I added the following
Data Source
-> comments.news_id={newsvar} OR (this is Type SESSION)

And I removed the original Data Source parameters
-> comments.news_id={news} (this is type URL)


Worked a treat.
Now I need to try it on a page that looks like this:

PHOTOS
photo_name photo_author
photo_photo
photo_desc

comment_comment
comment_author

comment_comment
comment_author

photo_name photo_author
photo_photo
photo_desc

comment_comment
comment_author


etc, etc, etc....

The difference with this one is that there are multiple PHOTOS on the same
page, each which may or may not have comments.

regards
Damian Hupfeld
http://ww.nexthost.com.au/services.php







"Nicole" <Nicole@forum.codecharge> wrote in message
news:542e257a3d30e0@news.codecharge.com...
> Damian,
> Try to store NEWS_ID in Before Show Row event of NEWS form into custom
> session
> variable (if page is loaded without NEWS_ID parameters). Then use it to
> filter
> COMMENTS table on this value. I think that in this case you need to modify
> WHERE in Before Build select event.
>
> _________________
> Regards,
> Nicole
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

Nicole

Posts: 586
Posted: 07/25/2005, 5:01 AM

Damian,
What you described looks like Simple Report with Simple Grouping or Simple Report with Groups from CCS Help samples.

_________________
Regards,
Nicole
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.