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

  • SEARCH
  • Home
  • 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 9134473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:39:58+00:00 2026-06-17T08:39:58+00:00

I need to generate a report in csv format. Data is retrieved as List<T>

  • 0

I need to generate a report in csv format. Data is retrieved as List<T> and only certain columns needs to be displayed in the report. I am thinking of doing it by storing its schema in an XML document under App_Data folder and use LINQ to XML to retrieve the field names and create the report.

Sample XML:

<report>
<fields>
<field headercaption='Customer Name'>CName</field>
<field headercaption='Address'>CAddress</field>
...
</fields>
</report>

Is it advisable to completely depend on XML file this way or do I need to do it through coding.

Edit

Fields are properties of List<T> which needs to be populated in the CSV files. Header caption is the name of the column for the field in the report.

Sample Report

Customer Name, Address,

ALFKI , 31 Independence Ave., Washington

  • 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-06-17T08:39:59+00:00Added an answer on June 17, 2026 at 8:39 am

    If you just want to add/remove columns at run time in this one report, it would be even easier to use a plain text file. Store column information in a format you can easily parse ( something like CName|Customer Name). When you need to generate CSV, read all lines, split by | (or whatever separator you choose) and go from there. You will probably also want to add a comment or documentation note somewhere about the format (in case you or someone else need to come back and modify it in a year or more).

    XML might become useful if you:

    • plan to put several reports into one file, and maybe give them names
    • provide some way for other people to submit their own reports
    • create some authoring tool to allow people to customize reports
    • localize column names in CSV. You could define something like

    .

    <report>
    <fields>
       <field name="CName">
          <header language="en-us">Customer Name</header>
          <header language="es-es">Nombre de cliente</header>
          ...
       </field>
       ...
    </fields>
    </report>
    
    • want to experiment with XML libraries

    In those cases XML may be useful because you could define an XSD and easily validate that submitted reports are valid.

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

Sidebar

Related Questions

I need to generate a report in .xls format, while trying to write the
Need to generate some financial report where the formatting is controlled by the data
Hello I need to generate a report which would include both data and a
I need to generate report that will show number of new / changed rows
I would like to achieve the following, I need to generate report for multiple
I need to generate a report where the user can choose All Issues, Open
i will need to generate a report based on user input for every food
I am creating a Generate Report button for some data in my application. The
I have an application which needs to generate a report. However, I do not
I need to generate a report/printout programmatically. My app currently uses FastReport to build

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.