I need to dynamically generate columns in an RDLC report. The report displays the breakup of the salary paid to each employee.
Background:
Dynamic column creation is required because every organisation has a unique salary structure and we have given our customers the facility to create their custom salary structures.
I am using:
- Visual Studio 2015
- SQL Server 2008 R2 Express
- Windows 10 Pro x64
- .Net 4.5.2`
In my opinion, the 3rd option in this post will suit my purpose - Generate columns dynamically in RDLC
What I want to do:
- Create a table dynamically in the calling form (I have done this successfully)
- Generate an XSD dynamically. The questions I face here is:
- How to create an XSD dynamically? I know how to create an XML file. But my questions are:
- Where should I write this code?
- Where should I store the XSD at runtime so that the RDLC may read from it?
- Alongwith the
.xsd
file, I can see other files with extensions.cs
,.Designer.cs
,.xsc
,.xss
. Would I need to make changes in these too?
- How to create an XSD dynamically? I know how to create an XML file. But my questions are:
- How do I get the
.RDLC
file to create the columns and rows dynamically based on this xsd? - Where should I write this code for the
.RDLC
file? - Where do I store the
RDLC
file at runtime? - Are the above steps correct or is there another way to do this?
Error: An error occured during local report processing. The definition of the report " in invalid.
The definition of this report is not valid or supported by this version of Reporting Services. The report definition may have been created with a later version of Reporting Services, or contain content that is not well-formed or not valid based on Reporting Services schemas. Details: Deserialization failed: The element 'Fields' in namespace 'http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition' has incomplete content. List of possible elements expected: 'Field' in namespace 'http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition'. Line 15, position 9.