Argument types do not match

Hello,

When I'm adding collection without elements (Count == 0), exception "Argument types do not match" is thrown on Report.Run

Eg.


IEnumerable<SomeType> collection = DataFetchFunction();

XlsFile xlsFile = new XlsFile();
xlsFile.Open(reportPath);
FlexCelReport report = new FlexCelReport();
report.AddTable("SomeName", collection); // collection.Count() == 0
report.Run(xlsFile);



Thanks in advance, and happy new year to everybody.

Marin Mašić

Hi,

I have been trying but I can't see to reproduce the error.
One of the things that I tried:

I'm sorry. Code example wasn't complete.
This is all thing:


            IEnumerable<DefinicijaMjerenjaEntity> definicijaMjerenjaCollection = new List<DefinicijaMjerenjaEntity>();
            IEnumerable<IzvrsavanjeMjerenjaEntity> izvrsavanjeMjerenjaCollection = new List<IzvrsavanjeMjerenjaEntity>();

            XlsFile xlsFile = new XlsFile();
            xlsFile.Open(reportPath);

            FlexCelReport report = new FlexCelReport();

            report.AddTable("DefinicijaMjerenja", definicijaMjerenjaCollection);
            report.AddTable("IzvrsavanjeMjerenja", izvrsavanjeMjerenjaCollection);
            report.AddRelationship("DefinicijaMjerenja", "IzvrsavanjeMjerenja", "DefinicijaMjerenjaId", "DefinicijaMjerenjaId");

            report.Run(xlsFile);



It seems that problem is in relationship, because when I comment line


            //report.AddRelationship("DefinicijaMjerenja", "IzvrsavanjeMjerenja", "DefinicijaMjerenjaId", "DefinicijaMjerenjaId");



report is rendered without exception.

I've refactored code. Now I'm using implicit relationship, and everything is peachy.

Hi,

Thanks for the example, there was indeed an issue if the relationship was in a value type and thre were zero records.
We have fixed it internally, and it will be available in next release. If you need an urgent fix please contact me by mail.