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

 Adding extra Row depending on a value.

Print topic Send  topic

Author Message
pathans

Posts: 46
Posted: 02/11/2013, 3:32 PM

Looks like somehow this post was delete.

I am creating a grid for datacenter rack so lets say i have a server which is 4U.
I would like to add 3 more rows after the record.

in grid i have a column which shows number of U ( rack_unit)

I was thinking somehow i can add something before show for that field.

can someone please help...
View profile  Send private message
Lucius

Posts: 220
Posted: 02/11/2013, 4:52 PM

I think you need to use Before Show Row here.

I don't know exactly what you need, but the simplest working example would be to put a single Label control in the place where optional, extra data/rows are needed.

Set this label property "Content" to HTML and then use Before Show Row to fill this label with HTML code you wish to append in this place.
View profile  Send private message
pathans

Posts: 46
Posted: 02/11/2013, 7:57 PM

let me try that but can i put a label between </tr><tr> tag???

I would love to repeat that row... any idea?

so for example if rack_unit =4 repeat same record 4 times.
is it possible in anyway?
View profile  Send private message
Lucius

Posts: 220
Posted: 02/12/2013, 4:01 AM

Hi,

You can put labels inside any element of HTML, for example you can have:

<tr class={Label1}> </tr>

You cannot put a label inside other CCS control, for example you cannot place label inside listbox control.

But what I had in mind that the label would not be between the TR tags, it would contain the TR tags, so the new row would only be displayed when needed.

Think of Label as a container for HTML you need.

$Label1->SetValue('<tr><td>my cell</td><td>my second cell</td></tr>');
View profile  Send private message
pathans

Posts: 46
Posted: 02/20/2013, 5:57 PM

thank for your help Lucius
it solved that problem but now there is another issue.

so now each rack where a server is 4U its showing empty space for it.
now we want to see if there is any gap between the servers it shows an empty row.

any idea how can we add some kind of loop which would compare last record and next record and if # is more then 4 add an extra row in example here for there should be an empty row above 26

http://pathans.com/Capture.PNG

greatly appreciate your help.
View profile  Send private message
Lucius

Posts: 220
Posted: 02/21/2013, 9:07 AM

Use global variables. Store count of racks in a global variable:

global myVar;
myVar = X;

Then on each iteration of Before Show Row increase it (or reset) and then compare the amounts, you can use more than one global variables. It's just the algorithm you need to work out to your needs.

Consider the Before Show Row as a single loop, pass the info as globals and it should be easy.
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.