Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3363

Job HasRecords property

$
0
0

Hi!

 

If i wanted to detect if a print job (printer, screen or file) is empty, what are my options? I found a HasRecord property. Oddly enough, accessing this property will return a true if the report has records, but throw an exception if the report has no records. I can certainly handle that, but it seems sortof odd:

 

rc=jobb->OutputToPrinter(1);

//

if(!rc)

{

  AfxMessageBox(jobb->GetLastError(), MB_OK|MB_ICONSTOP);

}

else

{

  try {

  rc = jobb->m_Report->HasRecords;

  }

  catch (System::Exception ^e)

  {

  TRACE("HasRecords() Exception %s", e->Message);

  rc = false;

  }

}

(VS 2012, MFC, C++)

 

First-chance exception at 0x776c4598 (KernelBase.dll) in Lp.exe: Microsoft C++ exception: CSResultException at memory location 0x00886148.

First-chance exception at 0x776c4598 (KernelBase.dll) in Lp.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.

First-chance exception at 0x776c4598 (KernelBase.dll) in Lp.exe: Microsoft C++ exception: _com_error at memory location 0x0088b10c.

First-chance exception at 0x776c4598 (KernelBase.dll) in Lp.exe: Microsoft C++ exception: _com_error at memory location 0x0088aee4.

First-chance exception at 0x776c4598 (KernelBase.dll) in Lp.exe: Microsoft C++ exception: _com_error at memory location 0x0088af4c.

First-chance exception at 0x776c4598 (KernelBase.dll) in Lp.exe: Microsoft C++ exception: _com_error at memory location 0x0088af94.

A first chance exception of type 'CrystalDecisions.CrystalReports.Engine.ParameterFieldCurrentValueException' occurred in CrystalDecisions.ReportAppServer.DataSetConversion.dll

 

I also saw that someone else had similar issues: Crystal Reports Missing Parameter Value

 

Any ideas? Am I going about this the wrong way?


Viewing all articles
Browse latest Browse all 3363

Trending Articles