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

 Adding a Break

Print topic Send  topic

Author Message
DonP
Posted: 11/20/2007, 1:15 AM

I am trying to put in a break <br> after every third image on a grid but
have no idea how to do it! I do have a little function at the moment that
can look at the ID field and tell whether or not it's an even number to put
the break after every two images but this works only as long as the numbers
are consecutive. They are now but won't be for long.

Here is basically what I have now:

function PositiveNumber($number) {
return(!($number & 1));
}

if (PositiveNumber($PhotoID)) {
$Classifieds->AdPhotos->SetValue("<img
src=\"/images/Reduced/".$PhotoName."_0.jpg\"><br>");
} else {
$Classifieds->AdPhotos->SetValue("<img
src=\"/images/Reduced/".$PhotoName."_0.jpg\">);
}

Any ideas?

Don (DonP)

wkempees
Posted: 11/20/2007, 11:32 AM

Assuming you are displaying images in a row of a standard grid.
In the BeforeShowRow you can have calculate the number of rows displayed
(sofar) like this:

  
function employees_BeforeShowRow()  
{  
$employees_BeforeShowRow = true;  
//End employees_BeforeShowRow  
  
//Custom Code @90-C6E784A0  
// -------------------------  
global $employees;  
global $RowCount; <-- added  
  
$RowCount+=1;     <-added  
  
// Write your own code here.  
$pageLink=$employees->email->GetLink();  
  
echo "********************************<br>";  
echo "* $RowCount <br>";  <-added  
echo "* $pageLink <br>";  
echo "********************************<br>";  
  
  
// -------------------------  
//End Custom Code  
  
//Close employees_BeforeShowRow @17-C5EDDDE1  
return $employees_BeforeShowRow;  
}  
//End Close employees_BeforeShowRow  
  
  
  
  

This piece of code will execute every third row from the previous example.
Now you just have to figure out what you want done BeforeShowRow of the
third row.
  
global $RowCount;  
  
$RowCount +=1;  
  
if($RowCount%3==0 ) {  
  
$pageLink=$employees->email->GetLink();  
  
echo "********************************<br>";  
echo "* $RowCount <br>";  
echo "* $pageLink <br>";  
echo "********************************<br>";  
}  

Walter

DonP
Posted: 11/20/2007, 11:51 AM

Thanks. Actually I am displaying the images in a label on another
single-entry grid but I found a very easy way to do it - so easy that it
didn't occur to me until this morning. I simply limited the width of the
table column containing the thumbnails so that it wraps after every third
thumbnail.

Don (DonP)

wkempees
Posted: 11/20/2007, 12:21 PM

ok
"DonP" <forum@pc-homepage.com> schreef in bericht
news:fhvdrd$1so$1@news.codecharge.com...
> Thanks. Actually I am displaying the images in a label on another
> single-entry grid but I found a very easy way to do it - so easy that it
> didn't occur to me until this morning. I simply limited the width of the
> table column containing the thumbnails so that it wraps after every third
> thumbnail.
>
> Don (DonP)
>


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.