Convert SQL queries output to report

db , sql server India
  • 13 years ago

    Hi,

    I have an SQL script that has many simple queries that I run on an SQL server database.When I run the output of script I want to convert in a report format where in I can put some header and additonal infor and display the results of script in an HTML or any GUI based report for a more userfriendly view.

    Could any one guide me how to go about it.

    Thanks,

    Meenakshi

  • 13 years ago

    If it is the output results you want, try setting the Edit/Output to file option in Query Analyser.

    This gets you a text file with the extension RPT by default. (Unfortunately, this is assicated with Crystal if you have that installed)

    You could try getting a little trickier: Force HTM headers into the output and save the file as  something.HTM  (you need to change the output type from RPT to Any Files)

    Example output into an HTML file:

    select '<HTML>';
    select count(1) from PEOPLE;

    select '<BR>'
    select distinct FORENAME from PEOPLE;

    select '<BR>';
    select '</HTML>';

     

  • 13 years ago

    Do you want the report to be static or dynamic. For example , do you have a front-end website that could call the db - grab the recordset and then do the formatting?

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Debugging is anticipated with distaste, performed with reluctance, and bragged about forever.” - Dan Kaminsky