Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

Complex Plug-In to generate Excel file with huge amount of records/fields

$
0
0

Hey guys,

I have a rather unorthodox question regarding plugin programming and excel templates in CRM.

Our customer wants to generate an Excel file from several different entities which are referencing to each other hierarchically in several 1 to many relationships.
I know from first experiences I've collected that I can only construct views for Excel templates with very limited possibilities.
The current model that we have right now looks something like this:

The customers wants to trigger the export on Entity A and that export shall collect data from Entities B, C, D and E and generate an Excel file with several calculations.
And to make it a bit more tricky, the "Many" part of the relationships means that there may be several records from which shall be collected.

So going over the possibilities in CE/CRM, I decided to create a custom entity in order to combine all the necessary records by reference on one record.
So when the customer clicks on a button in Entity A, my Plug-In runs through all these relationships and creates a custom entity record containing all needed records from Entities B,C,D and E.
Imagine it looking like this:

I thought that this might help me creating a view in for my custom entity because that way I can directly access all fields of all Entities needed for the Excel file.
So now I have a subgrid for my custom entity on Entity A. By clicking the "create custom record" ribbon, all the referenced records are collected and filled into the custom entity record.
Now I tried to added all necessary fields from all these entities onto one single view of my custom entity and then create an Excel Template with calculations referencing all these fields.

The system accepted my template with many many fields and it seemed like it will work.

Unfortunately...…. when I try to do an export inside that SubGrid,the system quickly hits me with an "Query has exceeded the limit of fields" error, I have not even added 30% of the fields I need because I just wanted to test my idea.

Very long story, short:
I am now thinking of writing another Plug-In in order to workaround the limits of the system. That Plug-In shall retrieve the Excel template and fill in the data with the help of my custom entity.

My Question:
Has any one of you had any experience in creating a Plug-In that can retrieve an Excel Template from the system, fill in the data and then return it back to the user?
Or is there anything I am missing in the system? any possibility I have missed? Maybe some extension or tool that can help me accomplish/meet the requirement?

Or is my approach totally wrong and I should do something completely different.....


Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>