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...
and here are the relevant formula codes..
The output I get for the current code I have is:
The output I need to properly build the table:
Thanks again for all your help! And again, apologies if this post was too long
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...
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>
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> </TD>
<TD> </TD>
<TD>1</TD>
<TD>1</TD>
<TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD>
</tr>
<tr>
<TD>LongSub2</TD>
<TD>1</TD>
<TD>1</TD>
<TD> </TD>
<TD> </TD>
<TD>1</TD>
<TD>1</TD>
<TD> </TD>
<TD> </TD>
<TD>1</TD>
<TD> </TD>
<TD> </TD>
<TD>1</TD>
</tr>
<tr>
<TD>LongSub3</TD>
<TD>4</TD>
<TD> </TD>
<TD> </TD>
<TD>7</TD>
<TD> </TD>
<TD> </TD>
<TD>3</TD>
<TD> </TD>
<TD> </TD>
<TD>2</TD>
<TD> </TD>
<TD>1</TD>
</tr>
<tr>
<TD>LongSub4</TD>
<TD>4</TD>
<TD> </TD>
<TD> </TD>
<TD>7</TD>
<TD> </TD>
<TD> </TD>
<TD>3</TD>
<TD> </TD>
<TD> </TD>
<TD>2</TD>
<TD> </TD>
<TD>1</TD>
</tr>
<tr>
<TD>LongSub5</TD>
<TD>4</TD>
<TD> </TD>
<TD> </TD>
<TD>7</TD>
<TD> </TD>
<TD> </TD>
<TD>3</TD>
<TD> </TD>
<TD> </TD>
<TD>2</TD>
<TD> </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