Access array or dictionary elements

TurntwoTurntwo Folsom, CA
edited 11:44PM in FastReport .NET
Hi,

Using Business Objects as the datasource:

I'd like to be able to access Array or Dictionary elements in the report, without having them be separate rows. I have user-defined data that I keep in separate rows in the database, but I'd like to be able to access them in the report with something similar to customData["field1"] (for dictionary) or customData[1] (array), preferably the first example (accessed by string value for Key in Dictionary).

Is this possible with FastReports? If I add a Dictionary property to my object data-source I can use it as the source for a databand and print each as a row, or I can use Matrix to print all the values - but then I have to use filter criteria to limit it to only certain values, and the formatting is less flexible. So far this is the best I can come up with, but was hoping there was a way to use syntax similar to customData["field1"]. I can change the object type (Dictionary, Array, whatever will work) if needed.

Thanks,

Jason

Comments

  • edited 11:44PM
    Hello,

    It is possible using a script. See the attached report example (you can open it in the Demo.exe).

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.