Tuesday, November 10, 2015

SSRS Data or calculated fields with type 'Void' are not supported

I keep running into this error with SSRS reports.  First it was on a custom report which eventually went away.  Now, it is on the PSAProjInvoice report.


I have seen issues that show a similar error that says 'Record' instead of 'Void'.  That would usually indicate that a method is returning an entire 'Record' which is not allowed.

I have noticed that this may very well have something to do with the PSAProjInvoiceDP class.

Still looking into this...

UPDATE:

This is now on another custom report again.  Still no solution.  Leaning towards the DP class but can't be sure.

FINAL UPDATE:

This appears to have been a problem with my local install of VS 2010.  Not exactly sure what was causing it, however, now that I have cleaned my hard drive and re-installed, all appears to be working great!

FINAL UPDATE (For reals)

I don't think this is an issue of my local install of VS 2010.  The SSRS Repor dataset used a field list in it's 'Select' rather than a 'Select *'.  I changed it to a 'Select *' and everything is now working perfectly.

LOL UPDATE:
This issue is far from over.  I moved everything to one layer (CUS) which has made getting around this easier.  I delete my CUS layer, refresh dataset on the report, then restore CUS layer (TFS).  That allows me to make changes.  However, it will come back the next time I work on the report.  No idea what is causing this other than my custom fields.

Tuesday, October 20, 2015

SQL Error on insert_recordset

Today, I found myself working on the LedgerTransListDate report.  Basically, it's a list of voucher transactions grouped by date.

My customer needed two fields added from the GeneralJournalEntry table; createdBy and createdDateTime.

In looking at the code I found I need to add some assignments in the 'while (queryRun.next())' section AND in the insert_recordset section.

When I tested it, I recieved the following SQL error:

SQL error description: [Microsoft][SQL Server Native Client 10.0][SQL Server]The select list for the INSERT statement contains fewer items than the insert list. The number of SELECT values must match the number of INSERT columns.

This didn't make any sense because I made sure to add my 2 fields on the field list AND on the select statement (in this case the 'join' of GeneralJournalEntry to GeneralJournalAccountEntry)

Included in the info log from AX, I found that the insert field list contained 3 custom fields instead of the 2 I had specified:

...,MYFIELD_CREATEDBY,MYFIELD_CREATEDDATETIME,MYFIELD_CREATEDDATETIMETZID,...

The last one was added somewhere, I'm just not sure where yet...

Stay tuned...

Update:
This is a 'flaw' (possibly) with using insert_recordset.  You can't use UTCDateTime fields with this functionality.

Wednesday, September 30, 2015

SSRS and Array Fields

I recently had a requirement to show amounts throughout different months of the year.  Originally, I only was showing 3 months, however, the requirement changed and all 12 months were then required.

This led me to try using and EDT with the Array Elements set up. Very easy on the AX side, however, I wasn't sure how SSRS would handle it.  I added the new array field to my report table and refreshed my dataset in SSRS and POOF!  It worked great.

SSRS sees the array numbering as 0-11 rather than 1-12 like AX.

Pleasantly surprised!

Although, I have noticed that no values are coming through to the report.

Also, to clarify, when using code I think ax uses[0-11], however, the EDT in the AOT appears to use 1-12.

SSRS is acting funny... It doesn't put MyArrayField[1] into the corresponding datasat SSRS Field MyArrayField1

https://community.dynamics.com/ax/f/33/t/177552