Runtime Crystal reports in VS.NET-C# (using CRAXDDRT20) problem

  • Thread starter Thread starter Martin Daøílek
  • Start date Start date
M

Martin Daøílek

Hi all,

I'm trying create dynamic reports by Crystal Reports engine distributed with
VS.NET. I know there is only lite version without native support to do this,
but I've found another way via using CRAXDDRT20 library (Crystal Reports
..NET ActiveX Designer Design and Runtime library).

But I've problem with adding table by passing ADO recordset:

loCRGenerator = new CRAXDDRT20.ApplicationClass();
loReport = loCRGenerator.NewReport();

ADODB.RecordsetClass loADO = new ADODB.RecordsetClass();

foreach (DataColumn loColumn in aoDataGrid.CurrentDataTable.Columns)
{
loADO.Fields.Append(loColumn.ColumnName, ADODB.DataTypeEnum.adVarChar,
50, ADODB.FieldAttributeEnum.adFldMayBeNull);
}

loADO.Open(Missing.Value, Missing.Value, ADODB.CursorTypeEnum.adOpenDynamic,
ADODB.LockTypeEnum.adLockBatchOptimistic, 0);
loReport.Database.Tables.Add("", Type.Missing, loADO, Type.Missing,
"p2smon.dll", Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing); <-- here raises error :-(

Error message says: "Type mismatch" ...

Please can You help me? Or exist another way how to do this there?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top