Search code examples
crystal-reports

Generate Crystal Report


I want to generate a Crystal Report which is having 2*M columns and N rows. M is determined by user. This 2*M columns will be having values from a single column of sql database. I am firing M SQL queries where every query will fetch 2*N value from a single column.

How can I generate Crystal Report?


Solution

  • Create your report (group by User Id, order by date and time so you will have all I and O for user ordered by time)

    Add two parameters called StartDate and EndDate

    Use Record - Selection Formula and then Drag your elements (or type text) so that you'll have:

    {Comand.Date}>={?StartDate} AND   {Comand.Date}<{?EndDate}
    

    Note that date entered by user will be 00.00.00, while date recorded in DB has time. You will have to add 1 day to EndDate to have <= instead of < .