Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 899531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:13:58+00:00 2026-05-15T15:13:58+00:00

I have a reporting module in an ASP.NET webforms app (C#) that uses dynamic

  • 0

I have a reporting module in an ASP.NET webforms app (C#) that uses dynamic controls for the parameters for each report.

These dynamic controls are built from an XML column in a SQL Server 2008 DB.

XML structure:

<Report Parameters>
    <Parameter>
        <Name>CustomerId</Name>
        <Control />
    </Parameter>
     <Parameter>
        <Name>Start Date</Name>
        <Control>DDL</Control>
    </Parameter>
</Report Parameters>

I’ve left out a lot of the elements for readability.

If the <Control> element is not empty (as in the case of the Start Date parameter in the XML example) then a C# based XSLT tranformation creates the appropriate control on my form .

If the <Control> element is empty (as in the case of the CustomerId) then I want to use an existing c# property with the same name (i.e. I have a CustomerId defined in my c# code).

These parameter values (CustomerId and Start Date) are then passed to a stored procedure used to generate the report data.

I use the XPathNavigator and associated classes in my C# code to yank out the <Name> element of any <Control> element that is empty.

The problem is that the <Name> element is in the form of a string and I really want it to be in C# code form (sorry can’t think of a better way to describe this!) i.e. I want this.CustomerId (added the this to show it’s code not a string) not “CustomerId”.

As I don’t know how many reports this system will have over time I don’t really want to build up an enum or switch statement if “CustomerId” then this.CustomerId etc. as it seems to negate the point of dynamic code.

I realise that reflection will probably be needed and I have little knowledge of this so any advice or advice on a different approach to this problem would be welcome.

Thanks,

Rich.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T15:13:59+00:00Added an answer on May 15, 2026 at 3:13 pm

    What you are looking for is a Code generator. While I haven’t implemented one myself, I have used templates created by others before and it works like a charm. You can get started here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a reporting module (C# asp.net) that uses dynamic controls to represent the
I have an SQL Server Reporting Services (SSRS) report, that uses a view. That
We have a reporting solution that works like this. User orders the report to
We have an automatic reporting and notification system written in .net that sends emails
I have written a reporting suite, and I have a specific report that builds
I'm using a logging module that can have reporting enabled/disabled at runtime. Calls generally
I have a large reporting table in Excel that looks similar to the following.
I have a multipage reporting services report, and i would like to start from
I have a SQL Server Reporting Services report with an embedded image in the
Possible Duplicate: Best practices in error reporting (Mathematica) Assume that I have a function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.