Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show blank value in a report

Status
Not open for further replies.

Solojer

Technical User
Feb 28, 2008
54
CA
Hi there! I'm trying to use Crystal to automate the building of an HTML table, and am running into a bit of a problem: They way I understand HTML tables to work, is that every cell must have a value (even if the value is s space). Otherwise, the remaining cells will be shifter to the left.

In the past when I've asked a question on here, I don't feel as though I've fully explained my question, so I'll do my best to be as complete as possible in this question..please excuse if it's too long :)

My problem is, there is not always data for @longsub, which is making the output html table cells shift left, which results in the correct data appearing in the incorrect columns.

I figured the best way to explain with few words would be with an image, so here goes...
98c2cc22.jpg


and here are the relevant formula codes..
Code:
//@Table_Tech/Non Tech
"<TH ROWSPAN="&totext(distinctcount({@longsub},{@tech}),0,"")&">"&{@tech}&"</TH>"

Code:
//Table_Longsub
"<TD>"&{@longsub}&"</TD>"

Code:
//@Table_Incident_Count
if count({Incident.Incident #},{@Report Months})=0 then "<TD>0</TD>"
else
"<TD>"&TOTEXT(count({Incident.Incident #},{@Report Months}),0,"")&"</TD>"

Code:
//UESMonths Subreport
//@DisplayMonth
"<TH>"&totext(year({Incident.Close Date & Time}),0,"")&"-"&totext(tonumber(month({Incident.Close Date & Time})),0,"000")&"</TH>"

The output I get for the current code I have is:
Code:
Current Output:

<TABLE width=100% BORDER=1 CELLPADDING=4 style="background-color:white";> 

<tr> 

  <TH COLSPAN="2"></TH>

  <TH>2011-10</TH>

  <TH>2011-11</TH>

  <TH>2011-12</TH>

  <TH>2011-8</TH>

  <TH>2011-9</TH>

  <TH>2012-1</TH>

  <TH>2012-2</TH>

  <TH>2012-3</TH>

  <TH>2012-4</TH>

  <TH>2012-5</TH>

  <TH>2012-6</TH>

  <TH>2012-7</TH>

<TR>

<TH ROWSPAN=5>Non Technical Calls</TH>

<TD>LongSub1</TD>

<TD>1</TD>

<TD>1</TD>

<TD>1</TD>


</tr>

<tr>

<TD>LongSub2</TD>

<TD>1</TD>

<TD>1</TD>

<TD>1</TD>

<TD>1</TD>

<TD>1</TD>

<TD>1</TD>

</tr>

<tr>

<TD>LongSub3</TD>

<TD>4</TD>

<TD>7</TD>

<TD>3</TD>

<TD>2</TD>

<TD>1</TD>

</tr>

<tr>

<TD>LongSub4</TD>

<TD>4</TD>

<TD>7</TD>

<TD>3</TD>

<TD>2</TD>

<TD>1</TD>

</tr>

<tr>

<TD>LongSub5</TD>

<TD>4</TD>

<TD>7</TD>

<TD>3</TD>

<TD>2</TD>

<TD>1</TD>

</tr>

<TR>

<TH ROWSPAN=5>Technical Calls</TH>

<TD>LongSub6</TD>

<TD>3</TD>

<TD>51</TD>

<TD>55</TD>

<TD>24</TD>

<TD>21</TD>

<TD>11</TD>

<TD>15</TD>

<TD>19</TD>

<TD>21</TD>

<TD>11</TD>

<TD>15</TD>

<TD>19</TD>

</tr>

<tr>

<TD>LongSub7</TD>

<TD>1</TD>

<TD>4</TD>

<TD>19</TD>

<TD>6</TD>

<TD>8</TD>

<TD>10</TD>

<TD>6</TD>

<TD>8</TD>

<TD>10</TD>

<TD>6</TD>

<TD>10</TD>

<TD>10</TD>

</tr>

<tr>

<TD>LongSub8</TD>

<TD>6</TD>

<TD>94</TD>

<TD>79</TD>

<TD>35</TD>

<TD>37</TD>

<TD>20</TD>

<TD>23</TD>

<TD>24</TD>

<TD>37</TD>

<TD>20</TD>

<TD>23</TD>

<TD>24</TD>

</tr>

<tr>

<TD>LongSub9</TD>

<TD>3</TD>

<TD>5</TD>

<TD>1</TD>

<TD>10</TD>

<TD>8</TD>

<TD>6</TD>

<TD>6</TD>

<TD>1</TD>

<TD>10</TD>

<TD>8</TD>

<TD>6</TD>

<TD>6</TD>

</tr>

<tr>

<TD>LongSub10</TD>

<TD>3</TD>

<TD>10</TD>

<TD>22</TD>

<TD>31</TD>

<TD>40</TD>

<TD>22</TD>

<TD>22</TD>

<TD>17</TD>

<TD>40</TD>

<TD>22</TD>

<TD>22</TD>

<TD>17</TD>

</tr>

  </TABLE>
The output I need to properly build the table:
Code:
<TABLE width=100% BORDER=1 CELLPADDING=4 style="background-color:white";> 

<tr> 

  <TH COLSPAN="2"></TH>

  <TH>2011-10</TH>

  <TH>2011-11</TH>

  <TH>2011-12</TH>

  <TH>2011-8</TH>

  <TH>2011-9</TH>

  <TH>2012-1</TH>

  <TH>2012-2</TH>

  <TH>2012-3</TH>

  <TH>2012-4</TH>

  <TH>2012-5</TH>

  <TH>2012-6</TH>

  <TH>2012-7</TH>

<TR>

<TH ROWSPAN=5>Non Technical Calls</TH>

<TD>LongSub1</TD>

<TD>1</TD>

<TD>&nbsp;</TD>

<TD>&nbsp;</TD>

<TD>1</TD>

<TD>1</TD>

<TD>&nbsp;</TD>

<TD>&nbsp;</TD>

<TD>&nbsp;</TD>

<TD>&nbsp;</TD>

<TD>&nbsp;</TD>

<TD>&nbsp;</TD>

<TD>&nbsp;</TD>


</tr>

<tr>

<TD>LongSub2</TD>

<TD>1</TD>

<TD>1</TD>

<TD>&nbsp;</TD>

<TD>&nbsp;</TD>

<TD>1</TD>

<TD>1</TD>

<TD>&nbsp;</TD>

<TD>&nbsp;</TD>

<TD>1</TD>

<TD>&nbsp;</TD>

<TD>&nbsp;</TD>

<TD>1</TD>

</tr>

<tr>

<TD>LongSub3</TD>

<TD>4</TD>

<TD>&nbsp;</TD>

<TD>&nbsp;</TD>

<TD>7</TD>

<TD>&nbsp;</TD>

<TD>&nbsp;</TD>

<TD>3</TD>

<TD>&nbsp;</TD>

<TD>&nbsp;</TD>

<TD>2</TD>

<TD>&nbsp;</TD>

<TD>1</TD>

</tr>

<tr>

<TD>LongSub4</TD>

<TD>4</TD>

<TD>&nbsp;</TD>

<TD>&nbsp;</TD>

<TD>7</TD>

<TD>&nbsp;</TD>

<TD>&nbsp;</TD>

<TD>3</TD>

<TD>&nbsp;</TD>

<TD>&nbsp;</TD>

<TD>2</TD>

<TD>&nbsp;</TD>

<TD>1</TD>

</tr>

<tr>

<TD>LongSub5</TD>

<TD>4</TD>

<TD>&nbsp;</TD>

<TD>&nbsp;</TD>

<TD>7</TD>

<TD>&nbsp;</TD>

<TD>&nbsp;</TD>

<TD>3</TD>

<TD>&nbsp;</TD>

<TD>&nbsp;</TD>

<TD>2</TD>

<TD>&nbsp;</TD>

<TD>1</TD>

</tr>

<TR>

<TH ROWSPAN=5>Technical Calls</TH>

<TD>LongSub6</TD>

<TD>3</TD>

<TD>51</TD>

<TD>55</TD>

<TD>24</TD>

<TD>21</TD>

<TD>11</TD>

<TD>15</TD>

<TD>19</TD>

<TD>21</TD>

<TD>11</TD>

<TD>15</TD>

<TD>19</TD>

</tr>

<tr>

<TD>LongSub7</TD>

<TD>1</TD>

<TD>4</TD>

<TD>19</TD>

<TD>6</TD>

<TD>8</TD>

<TD>10</TD>

<TD>6</TD>

<TD>8</TD>

<TD>10</TD>

<TD>6</TD>

<TD>10</TD>

<TD>10</TD>

</tr>

<tr>

<TD>LongSub8</TD>

<TD>6</TD>

<TD>94</TD>

<TD>79</TD>

<TD>35</TD>

<TD>37</TD>

<TD>20</TD>

<TD>23</TD>

<TD>24</TD>

<TD>37</TD>

<TD>20</TD>

<TD>23</TD>

<TD>24</TD>

</tr>

<tr>

<TD>LongSub9</TD>

<TD>3</TD>

<TD>5</TD>

<TD>1</TD>

<TD>10</TD>

<TD>8</TD>

<TD>6</TD>

<TD>6</TD>

<TD>1</TD>

<TD>10</TD>

<TD>8</TD>

<TD>6</TD>

<TD>6</TD>

</tr>

<tr>

<TD>LongSub10</TD>

<TD>3</TD>

<TD>10</TD>

<TD>22</TD>

<TD>31</TD>

<TD>40</TD>

<TD>22</TD>

<TD>22</TD>

<TD>17</TD>

<TD>40</TD>

<TD>22</TD>

<TD>22</TD>

<TD>17</TD>

</tr>

  </TABLE>

Thanks again for all your help! And again, apologies if this post was too long :)
 
What is in formula @longsub

Add an extra condition to that so if it returns a null ensure its retuns zero if a number or " " if a string.

Ian
 
Hi Ian, I added an extra condition to @longsub and in fact all the "group by" fields, and still nothing, unfortunately.
 
I was able to figure this out by adding a subreport in the @longsub section. Thanks for all your help :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top