CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 [HOWTO] Report and "blank" cells

Print topic Send  topic

Author Message
Gena

Posts: 591
Posted: 06/11/2008, 12:55 PM

I have a Report like this:
  
----------------------------------------------  
Group1         |  item1  
----------------------------------------------  
               | item 2  
----------------------------------------------  
               | item 3  
----------------------------------------------  
Group2         |  item11  
----------------------------------------------  
               | item 22  
----------------------------------------------  
               | item 33  
----------------------------------------------  

as you can see there are a blank cells. This is not good. I would like to have it like this

  
----------------------------------------------  
Group1         |  item1  
               -------------------------------  
               | item 2  
               -------------------------------  
               | item 3  
----------------------------------------------  
Group2         |  item11  
               -------------------------------  
               | item 22  
               -------------------------------  
               | item 33  
----------------------------------------------  

so each group should be in one cell. It seems that I need rowspan att but have no idea how to do this....

tia
_________________
Gena
View profile  Send private message
datadoit
Posted: 06/11/2008, 12:59 PM

Gena wrote:
> I have a Report like this:
>
  
> ----------------------------------------------  
> Group1         |  item1  
> ----------------------------------------------  
>                | item 2  
> ----------------------------------------------  
>                | item 3  
> ----------------------------------------------  
> Group2         |  item11  
> ----------------------------------------------  
>                | item 22  
> ----------------------------------------------  
>                | item 33  
> ----------------------------------------------  
> 
>
> as you can see there are a blank cells. This is not good. I would like to have
> it like this
>
>
  
> ----------------------------------------------  
> Group1         |  item1  
>                -------------------------------  
>                | item 2  
>                -------------------------------  
>                | item 3  
> ----------------------------------------------  
> Group2         |  item11  
>                -------------------------------  
>                | item 22  
>                -------------------------------  
>                | item 33  
> ----------------------------------------------  
> 
>
> so each group should be in one cell. It seems that I need rowspan att but
> have no idea how to do this....
>
> tia
> ---------------------------------------

Feature would be nice...
http://forums.codecharge.com/posts.php?post_id=97699

In the meantime, you'll either have to do it manually in HTML mode (add
rowspan="3" in the <td> tag attribute), then remove the other un-needed
<td>'s, or use something like FrontPage or DreamWeaver to merge the cells.
Gena

Posts: 591
Posted: 06/11/2008, 1:30 PM

may be you don't understand my problem - my report is dinamic so I should do something dinamically to "rowspan" cells....
_________________
Gena
View profile  Send private message
wkempees


Posts: 1679
Posted: 06/11/2008, 4:15 PM

Is your Group positioned in the Detail or in its own Header?
Meaning, is it Hidden upon repeat, or in its own group header.

_________________
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
Gena

Posts: 591
Posted: 06/11/2008, 4:40 PM

Quote wkempees:
Is your Group positioned in the Detail or in its own Header?
Meaning, is it Hidden upon repeat, or in its own group header.


group is on the "Left" type, so it is in Detail, and yes, it Hidden upon repeating.
as I wrote above like:

  
Group --- item1  
      --- item2  
      --- item3  
      --- item4  

_________________
Gena
View profile  Send private message
wkempees


Posts: 1679
Posted: 06/11/2008, 6:40 PM

Harder than I thought.
The Group is Hidden but then it is not.
Attack taken:
Add attribute to <td ..... 'attribute here' >Group</td>
like 'rowspanner'
In BeforeShowRow you could than do
  
$i = CCDLookup('Count(*)' , 'store_order_items' , 'order_id =' . $Container->order_id->GetValue() , $DBInternetDB);  
$Container->Attributes->SetValue('rowspanner', 'rowspan="' . $i . '"');  
you would have to test if the current group has changed like in the 'Simple report with grouping example' (HelpFile)
if changed do the above if not, then set attribute to blank string.

However, due to the construct of the HTM in the report (please post yours for the Detail)
things will move to the right.

Will take another go at this sometime tomorrow.

HTH at least gives you a pointer,
Another Q&D approach is change the class="Row" on the <tr> to
none, that will remove the lines!

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: 06/22/2008, 6:31 AM

Any progress?

_________________
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
Gena

Posts: 591
Posted: 06/22/2008, 11:06 AM

I have got some advise from support but not yet tried it.
_________________
Gena
View profile  Send private message
wkempees


Posts: 1679
Posted: 06/22/2008, 4:26 PM

See my post here http://forums.codecharge.com/posts.php?post_id=97960

See if it gives you something to go by.

HTH,

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: 06/22/2008, 5:37 PM

Based on Internet DB, store_product.
NewPage Reportbuilder
Step2 select fields category_id, product_id, product_name, press Next
Step3 Groupfields category_id, press Next
Step4 Layout with Groups, Group Left and above, don't worry about this now, press Next
Step5 skipped for now, press Next
Step6 accepted defaults, press Next
Step7, accepted defaults but non-breaking spaces for empty cells must be checked, press Next
Step8, skipped , press Next
Step9, accepted suggested Style, Press Next.
Generate and Live Page, to see it works as a normal report.

Next we need to count the number of rows in a group.
In this case count all product with the current category_id.
Click on category_id, properties Events BeforeShowRow
Add action DLookup "Count(*)","store_products","category_id=".$Container->category_id,DBInternetDB target= Variable name=RowSpanner
Or add your handcode like:
  
     global $DBInternetDB;  
     global $RowSpanner;  
     $ccs_result = CCDLookUp('Count(*)', 'store_products', 'category_id='. $Container->category_id->GetValue(), $DBInternetDB);  
     $store_products->Attributes->SetValue("RowSpanner", intval($ccs_result));  

Next we go and modify the HTML
Find: <!-- BEGIN Section category_id_Header -->
changed to:
  
<tr class="Row">  
   <td style="TEXT-ALIGN: right" rowspan="{store_products:RowSpanner}">{category_id}  </td>  
<!-- END Section category_id_Header -->  
I changed the class for <tr> to Row, and inserted Attribute RowSpanner as last item in the <td> for category_id.
Before the attribute I added rowspan=
You could also just add the attribute and set the rowspan= ion the BeforeShowRow code.
Now for the trick:
In Section Detail, (re)move the starting <tr class="Row"> and place it after the closing</tr>
like this:
  
<!-- BEGIN Section Detail -->  
   <td style="TEXT-ALIGN: right">{product_id} </td>   
   <td>{product_name} </td>   
</tr>  
<tr class="Row">  
<!-- END Section Detail -->  
  
effect: the row from the groupheader is closed for every detail and a new row opened
We will close these in:
  
<!-- BEGIN Section category_id_Footer -->  
</tr>  
<!-- END Section category_id_Footer -->  
  
That does it for me, and I am sure it will for you.

Happy coding:
Full HTML for the report part:
  
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">  
<html>  
<head>  
<meta http-equiv="content-type" content="text/html; charset=windows-1252">  
<title>Gena</title>  
<meta content="CodeCharge Studio 4.01.00.06" name="GENERATOR">  
<link rel="stylesheet" type="text/css" href="Styles/{CCS_Style}/Style_doctype.css">  
</head>  
<body>  
<p>  
<!-- BEGIN Link Report_Print -->  
<p align="right"><a href="{Report_Print_Src}" id="Report_Print" target="_blank">Printable version</a></p>  
<!-- END Link Report_Print --></p>  
<p>  
<!-- BEGIN Report store_products -->  
<table cellspacing="0" cellpadding="0" border="0">  
  <tr>  
    <td valign="top">  
      <table class="Header" cellspacing="0" cellpadding="0" border="0">  
        <tr>  
          <td class="HeaderLeft"><img alt="" src="Styles/{CCS_Style}/Images/Spacer.gif" border="0"></td>   
          <td class="th"><strong>Store Products </strong></td>   
          <td class="HeaderRight"><img alt="" src="Styles/{CCS_Style}/Images/Spacer.gif" border="0"></td>   
        </tr>  
   
      </table>  
   
      <table class="Grid" cellspacing="0" cellpadding="0">  
        <!-- BEGIN Section Report_Header --><!-- END Section Report_Header -->  
        <!-- BEGIN Section Page_Header -->  
        <tr class="Caption">  
          <th scope="col">Category Id  </th>  
   
          <th scope="col">  
          <!-- BEGIN Sorter Sorter_product_id --><a href="{Sort_URL}">Product Id</a>   
          <!-- BEGIN Asc_On --><img alt="" src="Styles/{CCS_Style}/Images/Asc.gif" border="0"><!-- END Asc_On -->  
          <!-- BEGIN Desc_On --><img alt="" src="Styles/{CCS_Style}/Images/Desc.gif" border="0"><!-- END Desc_On --><!-- END Sorter Sorter_product_id --> </th>  
   
          <th scope="col">  
          <!-- BEGIN Sorter Sorter_product_name --><a href="{Sort_URL}">Product Name</a>   
          <!-- BEGIN Asc_On --><img alt="" src="Styles/{CCS_Style}/Images/Asc.gif" border="0"><!-- END Asc_On -->  
          <!-- BEGIN Desc_On --><img alt="" src="Styles/{CCS_Style}/Images/Desc.gif" border="0"><!-- END Desc_On --><!-- END Sorter Sorter_product_name --> </th>  
   
        </tr>  
 <!-- END Section Page_Header -->  
        <!-- BEGIN Section Page_Footer -->  
        <tr class="Footer">  
          <td>{Report_CurrentDate}  </td>   
          <td style="TEXT-ALIGN: right" colspan="2">Page {Report_CurrentPage} of {Report_TotalPages}   
            <!-- BEGIN Navigator Navigator -->  
            <!-- BEGIN First_On --><a href="{First_URL}">First</a> <!-- END First_On -->  
            <!-- BEGIN First_Off -->First <!-- END First_Off -->  
            <!-- BEGIN Prev_On --><a href="{Prev_URL}">Prev</a> <!-- END Prev_On -->  
            <!-- BEGIN Prev_Off -->Prev <!-- END Prev_Off -->    
            <!-- BEGIN Pages -->  
            <!-- BEGIN Page_On --><a href="{Page_URL}">{Page_Number}</a> <!-- END Page_On -->  
            <!-- BEGIN Page_Off -->{Page_Number} <!-- END Page_Off --><!-- END Pages -->of  {Total_Pages}    
            <!-- BEGIN Next_On --><a href="{Next_URL}">Next</a> <!-- END Next_On -->  
            <!-- BEGIN Next_Off -->Next <!-- END Next_Off -->  
            <!-- BEGIN Last_On --><a href="{Last_URL}">Last</a> <!-- END Last_On -->  
            <!-- BEGIN Last_Off -->Last <!-- END Last_Off --><!-- END Navigator Navigator --> </td>   
        </tr>  
   
        <!-- BEGIN Panel PageBreak -->  
      </table>  
 </td>   
  </tr>  
</table>  
</p>  
<p style="PAGE-BREAK-AFTER: always"> </p>  
<p>  
<table cellspacing="0" cellpadding="0" border="0">  
  <tr>  
    <td valign="top">  
      <table class="Grid" cellspacing="0" cellpadding="0">  
        <!-- END Panel PageBreak --><!-- END Section Page_Footer -->  
        <!-- BEGIN Section category_id_Header -->  
		<tr class="Row">  
		  <td style="TEXT-ALIGN: right" rowspan="{store_products:RowSpanner}">{category_id}  </td>  
  		<!-- END Section category_id_Header -->  
        <!-- BEGIN Section Detail -->  
          <td style="TEXT-ALIGN: right">{product_id} </td>   
          <td>{product_name} </td>   
		</tr>  
		<tr class="Row">  
 		<!-- END Section Detail -->  
        <!-- BEGIN Section category_id_Footer -->  
		</tr>  
		<!-- END Section category_id_Footer -->  
        <!-- BEGIN Section Report_Footer -->  
        <!-- BEGIN Panel NoRecords -->  
        <tr class="NoRecords">  
          <td colspan="3">No records</td>   
        </tr>  
 <!-- END Panel NoRecords --><!-- END Section Report_Footer -->  
      </table>  
 </td>   
  </tr>  
</table>  
<!-- END Report store_products --><br>  
</p>  
</body>  
</html>  

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
Gena

Posts: 591
Posted: 06/22/2008, 5:37 PM

Thank you, Walter !
_________________
Gena
View profile  Send private message
wkempees


Posts: 1679
Posted: 06/22/2008, 5:39 PM

Your welcome, but I was still editing as you replied.
If satisfactory, please change tiltle to [SOLVED] or [HOWTO]

2:39AM, signing off

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
Gena

Posts: 591
Posted: 06/22/2008, 6:03 PM

Walter, thank you again! I think this should works! I will check it asap! For now in my project I did not use rowspan and have blank cells.
_________________
Gena
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.

MS Access to Web

Convert MS Access to Web.
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.