How to "intercept" missing smart markers. (possible feature request/suggestion)

We use Cells as a batch reporting engine.
We bind to data source using code like this:

IList list = dataSource.GetDataSource(reportRequest);
Designer.SetDataSource(dataSource.Name, list);

where “list” is a IList of user objects, and “Designer” is of type WorkbookDesigner.

This works OK, but it can’t handle smart markers like:

&=Listname.ListProperty.SubProperty
&=Listname.UnknownListProperty (but where the object actually knows how to resolve the property using an interface like IDataRecord or similar)

This could all be done in user code if there were some way to intercept each smart marker lookup similar to the Aspose.Words.Document.MailMerge.MailMerge event.

Alternatively this could be an event only raised when the smart marker could NOT be resolved. This could give the program a second chance to resolve the smart marker.

Hi,

Thank you for sharing your detailed requirements.

We will look into the feasibility of this feature and see if we can implement it soon.

Thank You & Best Regards,

Hi,


I’m still eagerly waiting for this feature.

Another possible solution is to implement an overload for SetDataSource that accepts a parameter of type IDataReader. A user implementation of that interface could resolve nested properties ect.

Thanks

Hi,

Thank you for considering Aspose.

We have registered your required feature in our issue tracking system with issue id CELLSNET-12060. We will support it soon as per your requirement.

Thank You & Best Regards,

Hi,

Please try the attached version.

a)

We have supported IDataReader as the data source of smart marker. Please try the method WorkbookDesigner.SetDataSource(string name,IDataReader dataReader, int rowCount).
If your smart marker does not contain "noadd", we have to insert rows according to the parameter "rowCount". And, we do not support "Group" option if the data source is DataReader.

b)
We could not support the smart marker as "&=Listname.ListProperty.SubProperty" at the moment.We support the smart marker as "&=Listname.SubProperty".


Thank you.

Aaaargh! That was not very nice!


The implementation of SetDataSource(string, object) and/or SetDataSource(string, object[]) are broken in the attached version.

I just spent two hours looking for bugs in my code before I realized it was the updated Aspose.Cells component that caused the problem: No data is inserted in the spreadsheet during Process().


Hi,

Well, I have tested both overloaded methods i.e…,
SetDataSource(string, object), SetDataSource(string, object[])
Both works fine here.

Could you create a sample console application to reproduce the issue, we will check it soon.

Thank you.

Sorry, I don’t have time right now to do a sample application.

I was a bit unsure which overload I was using, but it seems that I use SetDataSource(string, object).

My code looks something like this:
IList xxx = GetDataSource(…).ToArray();
builder.SetDataSource(name, xxx);

I think the cast to IList was a workaround because the object[] overload didn’t work way back when I started using Aspose.Cells.

Hi,

We have found the issue and will figure it out soon.

Your issue has been logged into our issue tracking system with an issue id: CELLSNET-12325.

Thank you.

Hi,

Please try the attached version. We have fixed this issue.


Thank you.

Hi,

Yes, that did indeed fix that error.

However I found another: When I open the file in Excel, it complains that the file is locked for editing by another user. This particular problem only occurs while program is still running. My guess it that this is a problem with the file not being closed/disposed.

I think I’m going to stick with 4.8.0.0 for now.

Hi,

Could you create a simple console application with all the details and post it here, we will check it soon. We will surely appreciate your efforts in this regard.

Thank you.

The issues you have found earlier (filed as 12325) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.