How to create crystal report dynamically with dataset

Posted on 2007-08-10
Last Modified: 2013-11-07
In application I am generating the dataset which contains several tables these tables have no relation between them, now I need to display all those tables on the crystal report

Also I am not sure about the exact number of tables and number columns in the table because they all are generating dynamically

I really appriciate any code examples

Question by:shieldguy
    LVL 6

    Expert Comment


    you can use Temp Table and gather all needed data in that table ... and just
    linke your temp Table to your report .
    LVL 42

    Expert Comment

    No need to use temp tables, you can pass datasets into crystal reports.  You can find the code samples needed here:     Note that Visual Studio help and MSDN have code samples as well.

    You will need to define the report structure in advance however - you can for example design a report with 10 columns and if your table only has 6 just pass the six columns and four null columns.

    Because there's no relationship between the tables you're going to need to either do separate crystal reports or you can do each table as a subreport and put all subreports into a single 'main' report.  It'll have to be one or the other because Crystal won't support disconnected tables gracefully.

    LVL 100

    Expert Comment

    I agree with frodoman.  

    You can also do the entire report from an application but that will require a separate license for each user and the stand-alone version of Crystal.  

    What is the purpose of this reporting?

    I find many times the user thinks he needs maximum flexibilty but after reviewing the requirements, I can build one o more reports that satisfy the requirements even if it means having a few extra fields in a report.  

    LVL 69

    Expert Comment

    by:Éric Moreau
    >>Also I am not sure about the exact number of tables and number columns in the table because they all are generating dynamically

    Normally, a report is bound to a datasource definition (tables, fields, ...). It would probably be better to find another format like outputting to an HTML format.
    LVL 6

    Accepted Solution


    if are looking for quick way to build reports check this:

    Full Series:

    Hope this help ...

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Better way of writing the code 4 22
    Need help error handling a windows service 2 25
    Change to event 1 49
    Linux operating system 12 29
    This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now