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

 Hiding a row

Print topic Send  topic

Author Message
Mika
Posted: 10/27/2005, 2:38 AM

Hi there,

is there a way to NOT displaying a row when there is no data? Better not to write the "<td>" at all when there is no data.

Regards,
Mika
Edd


Posts: 547
Posted: 10/27/2005, 5:40 AM

Mika,
There are several links where you can hide components if they are blank, but you should be aware that you could screw up the rowcount. Example, you retrieve 20 rows on a page and 12 of them are empty, you hide them and your page looks wierd.

If you don't want a row to appear do it as an SQL test.

If you want to hide a component look at CCS Frequently asked questions

http://support.yessoftware.com/kb_article.asp?s_prod=2&...=&article_id=56

Edd
_________________
Accepting and instigating change are life's challenges.

http://www.syntech.com.au
View profile  Send private message
Mika
Posted: 10/27/2005, 7:26 AM

Hi Edd,

Currently I am using this code:
Dim DepName  
Function departments_BeforeShowRow()  
  
  If DepName = departments.department_name.Value Then  
     departments.department_name.Visible = False  
  Else  
     departments.department_name.Visible = True  
     DepName = departments.department_name.Value  
   End  If   
  
End Function  

In the HTML i have:
  <!-- BEGIN Label department_name -->  
  <tr>  
    <td bgcolor="#336699" colspan="3"><font color="White">{department_name}</font></td>  
  </tr>  
  <!-- END Label department_name -->  
  

is there a way I prevent the page to write the HTML if there is no data?

Thanks.
Walter Kempees
Posted: 10/27/2005, 3:05 PM

Without any guarantee:
Are you trying to surpress department name for all rows after the first and
display again when department changes ?
If so check out the help files example on simple reporting.
I think it's in there

Walter
"Mika" <Mika@forum.codecharge> schreef in bericht
news:64360e379cf37a@news.codecharge.com...
> Hi Edd,
>
> Currently I am using this code:
>
Dim DepName  
> Function departments_BeforeShowRow()  
>  
>  If DepName = departments.department_name.Value Then  
>     departments.department_name.Visible = False  
>  Else  
>     departments.department_name.Visible = True  
>     DepName = departments.department_name.Value  
>   End  If  
>  
> End Function  
> 
>
> In the HTML i have:
  <!-- BEGIN Label department_name -->  
>  <tr>  
>    <td bgcolor="#336699" colspan="3"><font  
> color="White">{department_name}</font></td>  
>  </tr>  
>  <!-- END Label department_name -->  
>  
> 
>
> is there a way I prevent the page to write the HTML if there is no data?
>
> Thanks.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

Walter Kempees
Posted: 10/27/2005, 3:10 PM

Am sorry, I checked the example for you and that's one-on-one what you are
doing.
Probably I don't get the question.
Edd is right in stating that unwanted rows could/should be filtered out at
SQL level, saves time and effort.

Bye

"Walter Kempees" <kempe819@planet.nl> schreef in bericht
news:djriue$s6f$1@news.codecharge.com...
> Without any guarantee:
> Are you trying to surpress department name for all rows after the first
> and display again when department changes ?
> If so check out the help files example on simple reporting.
> I think it's in there
>
> Walter
> "Mika" <Mika@forum.codecharge> schreef in bericht
>news:64360e379cf37a@news.codecharge.com...
>> Hi Edd,
>>
>> Currently I am using this code:
>>
Dim DepName  
>> Function departments_BeforeShowRow()  
>>  
>>  If DepName = departments.department_name.Value Then  
>>     departments.department_name.Visible = False  
>>  Else  
>>     departments.department_name.Visible = True  
>>     DepName = departments.department_name.Value  
>>   End  If  
>>  
>> End Function  
>> 
>>
>> In the HTML i have:
  <!-- BEGIN Label department_name -->  
>>  <tr>  
>>    <td bgcolor="#336699" colspan="3"><font  
>> color="White">{department_name}</font></td>  
>>  </tr>  
>>  <!-- END Label department_name -->  
>>  
>> 
>>
>> is there a way I prevent the page to write the HTML if there is no data?
>>
>> Thanks.
>> ---------------------------------------
>> Sent from YesSoftware forum
>> http://forums.codecharge.com/
>>
>
>

Edd


Posts: 547
Posted: 10/27/2005, 3:56 PM

Mika

You are going down the right track but you need to make some changes.

The First thing is that you need to remove the Label code and replace it with a new Block

in HTML all of the below must be between the begin and end ROW blocks.
  
<!-- BEGIN My_department_name -->    
  <tr>    
    <td bgcolor="#336699" colspan="3"><font color="White">{department_name}</font></td>    
  </tr>    
  <!-- END My_department_name -->   
 

Then

Change your code should be changed to
  
  
Dim DepName    
  
Function departments_BeforeShowRow()    
   Dim GrpBlock   
   Dim localDepName   
   Set GrpBlock = departments.TemplateBlock.Block("Row").Block("My_department_name")  
   GrpBlock.Clear  
    
   localDepName = departments.DataStore.RecordSet.Fields("department_name")  
   If DepName <> localDepName Then    
        GrpBlock.Variable("department_name") =  localDepName   
        GrpBlock.Parse ccsParseAccumulate  
   End  If     
  
   DebName = localDepName    
    
End Function    
  


I think that should work
Edd
_________________
Accepting and instigating change are life's challenges.

http://www.syntech.com.au
View profile  Send private message
Mika
Posted: 10/28/2005, 12:21 AM

Thanks Edd.
I will give it a go...
Mika
Posted: 11/01/2005, 4:52 AM

Hey Edd,

The following errors accure:
Soort fout:  
Runtimefout Microsoft VBScript (0x800A01B6)  
Deze eigenschap of methode wordt niet ondersteund door dit object: 'departments.DataStore'   
and
Soort fout:  
Runtimefout Microsoft VBScript (0x800A01A8)  
Object vereist: 'GrpBlock'  

Hope you canh elp me here?

Thanks

Mika
Posted: 11/01/2005, 5:46 AM

:-D
Got it!!

Thanks for your help!!!
Walter Kempees
Posted: 11/01/2005, 4:35 PM

Goed gedaan dan.
Sorry for the double dutch
"Mika" <Mika@forum.codecharge> schreef in bericht
news:6436771a54b5f5@news.codecharge.com...
> :-D
> Got it!!
>
> Thanks for your help!!!
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>


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.