I have assigned a task to create (relatively) simple reporting system. In these system, user will be shown a table result of report. A table has some fields and each field give some part of information to user in each record. My problem however is that each report field will not be declared by developer. It must be declared by user of system. So my reports table are dynamic.
I saw example in 'Data Driven Custom View Engine in ASP.NET MVC' for creating dynamic forms using Asp.net MVC Framework but I don't know that is appropriate for my system or not.
Update1:
Currently I ended with following Entity Relationship Diagram:
In above diagram, I store every record for report in Report
table. Also I store type of report in ReportType
. For each field that will be used in report record I will use a ReportFieldValue
. Type of fields will be stored in ReportField
.
So If I want to add a record to my db first I add a row to Report
Table. Then for each added record fields I will add a row to ReportFieldValue
table.
However as you may notice, in these approach I must store every field value in char(255). The problem is for fields type like datetime
that should not be stored as string. Is there any design pattern or architecture for this type of systems?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…