Willian Fernando, cara, era isso mesmo. Fiz a ligação e funcionou. Só que ao abrir o relatório aparece no final a mensagem:
Atenção
Undefined offset: 2
E agora, o que pode ser? Segue abaixo o script dessa aplicação (blank). Por enquanto é apenas um teste, ainda vou melhorar o incremento da última consulta.
$sql = "SELECT
Evento_ID,
ME_ID,
Evento_Titulo,
DATE_FORMAT(Evento_DataInicial, '%d%m%Y') AS DATAINICIAL,
DATE_FORMAT(Evento_DataFinal, '%d%m%Y') AS DATAFINAL,
Evento_Periodo,
Evento_Descricao,
Evento_Publicar,
Evento_CriaCracha,
Evento_Investimento
FROM c001_eventos
WHERE ME_ID = [vlME]
AND Evento_ID = [vlEvento] ";
sc_lookup(Ds, $sql);
if(!empty({Ds}))
{
$titulo = {Ds[0][2]};
$dtinicial = {Ds[0][3]};
$dtfinal = {Ds[0][4]};
$periodo = {Ds[0][5]};
$publicar = {Ds[0][6]};
$descricao = {Ds[0][7]};
$publicar = {Ds[0][8]};
$investimento = {Ds[0][9]};
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td valign='top' style='width:50%; font-family:sans-serif; font-size:11pt; text-align:justify; padding:0px 10px 0px 10px;'>
<div style='font-weight:bold;'>Título:</div>
<div>$titulo</div>
<div style='font-weight:bold;'>Data Inicial:</div>
<div>$dtinicial</div>
<div style='font-weight:bold;'>Data Final:</div>
<div>$dtfinal</div>
<div style='font-weight:bold;'>Período:</div>
<div>$periodo</div>
</td>
<td valign='top' style='width:50%; font-family:sans-serif; font-size:11pt; text-align:justify; padding:0px 10px 0px 10px;' >
<div style='font-weight:bold;'>Publicação:</div>
<div>$publicar</div>
<div style='font-weight:bold;'>Valor do Investimento:</div>
<div>$investimento</div>
<div style='font-weight:bold;'>Descrição:</div>
<div>$descricao</div>
</td>
</tr>
</table>
";
} else
{
echo “
Nenhum dado foi retornado.
”;
};
$sql0 = "SELECT COUNT(*) FROM c002_agenda
WHERE Evento_ID = [vlEvento] ";
$total = 0;
sc_lookup(Ds, $sql0);
if(!empty({Ds}))
{
$total = {Ds[0][0]};
};
$sql = "SELECT
Agenda_ID,
Evento_ID,
ME_ID,
Agenda_Titulo,
Agenda_Descricao,
DATE_FORMAT(Agenda_DataInicial, ‘%d%m%Y’) AS DATAINICIAL,
Agenda_HoraInicial,
DATE_FORMAT(Agenda_DataFinal, ‘%d%m%Y’) AS DATAFINAL,
Agenda_HoraFinal,
Agenda_Retorno,
Agenda_Periodo
FROM c002_agenda
WHERE Evento_ID = [vlEvento] ";
sc_lookup(Ds, $sql);
if(!empty({Ds}))
{
echo “
”;
$var = 0;
while ($var <= $total)
{
$titulo = {Ds[$var][3]}."
";
echo $titulo;
$var++;
};
echo $titulo;
echo “
”;
};