Reporting on tables with unknown schemas RRS feed

  • Question

  • Hi,

    I have an application that gathers font information from pc's, and creates a table on the fly based on the pc name and some other info. At the moment i am displaying the information in a List View control, but i would also like the option to show the information in a a report as well.

    The problem is, at design time i dont know the structure of the table, so i cant just drag and drop the fileds from the dataset onto the table in the report designer. Is there a way i can create the table on the report on the fly at run time, at witch point i will know the layout of the table?

    Couple of examples:

    Person A could run the application on 2 machines, so the table would look like this -

    fieldnames - Fontname,machine1,machine2 - data in the table would be - Ariel, True,False

    Person B could run the appliaction on 4 machines and the table would look like this - 

    fieldnames - Fontname,machineA,machineB,machineC,machineD - data in the table would be - Times, True,False,True,True

    Hopfully i have made it clear what i'm after, if not please let me know and ill try and explain it more.
    • Changed type beakersoft Tuesday, August 19, 2008 11:49 AM Wrong selected
    Tuesday, August 19, 2008 11:47 AM

All replies

  • Hello beakersoft,

    i think MS developed a Matrix for those Problems. Your Fields are: Person, Fontname and Machinename.

    Tuesday, August 19, 2008 12:13 PM
  • Hi ,

    I thought about using a matrix but i still have the same problem, at design time i dont know the name of the fileds (there is a new field for each pc, named as the pc name).

    Ideally i want to be able to tell the matrix/table at runtime the fields to show.

    Tuesday, August 19, 2008 1:32 PM
  • Hello beakersoft,

    in this Forum are many Examples how to manipulate a RDLC-File. In your Application you have the Dataset and there is a list with all Columns in there. So you can write 'on the Fly' a new RDLC and show it in your Application.

    HTH, BanditTreiber
    Wednesday, August 20, 2008 7:00 AM
  • Hi BanditTreiber,

    Do you know a specific thread that might be of help, i've just been playing about with it and i think i should be able to alter the xml, but an example would be a great help.

    Wednesday, August 20, 2008 11:15 AM
  • Sorry, but i didnt have enough time to search 186 Sites fou you.

    But you are on the right way. Build a simple Report with the ReportViewer(give each Field a Speaking Name), then add Fields and look what changed in the File. It is easy.

    Save your Master-Report, make a sign in the File(e.g.: ~~##~~, to find exact this Place to insert your modifications or copy all to your Application and then save it under an other name. Open with your application and set the ReportDataSource. Thats it.

    HTH, BanditTreiber
    Wednesday, August 20, 2008 11:28 AM