Generating a database report to be Sent as an email

Discussion in 'Databases' started by saihati, Apr 9, 2010.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi everybody,

    I have a website that receives online customer orders. Once an order is submitted, it will be entered to the database as a "new" order and sends an email to the order taker in the website. The next step is handled manually.

    The website owner wants to create a reminder report for all requests that have not been handled for more than 48 hours which will be triggered daily by the Task Schedule Manager of DASP.

    I am using ASP.net GridViews, DetailsViews, and DataLists in this website application. Now, I want to create a loop to generate a HTML table to be sent as the email reminder for those orders. So, in the .aspx file I have the database output table and on the other file .aspx.vb I have the email object which will include the output table to the order taker.

    In the I am facing difficulty to which method I should use to include the output to my message object (MessageBox) in the .aspx.vb.

    Please, advise me if there is a way to do so as I don't want to use a classical ASP file to do so. :D
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    have you considered reporting service? you can schedule report to be sent on a scheduled basis.
     
  3. Bruce,
    Thanks for your prompt reply.

    Honestly speaking, I haven't. Though, after some snooping around, I think such a service is supporting MS SQL database not MS Access databases which I use.

    Anyway, do you have a way to pass the output of a GridView to a .aspx.vb file so that I can include it in the email message body?

    Taking a look at this might give you an idea of what I need to see in system scheduled reminder email message: Here!

    Appreciate your hints. ;)
     
  4. I'd say you're correct to think about using the DASP task scheduler for this:
    • Create a new aspx page that will be called from the scheduler.
    • Put some code in the page code-behind to perform a SQL query on your MSAccess db using the RequestState and SubmissionDateTime columns. This will return the rows to be attached to your reminder email.
    • Write code to create and send an email using the data you got in step 2.
    • Finally configure the scheduler to call this new aspx page once per day.
    When the page is called regularly and automatically each day by the scheduler, it will compile a new report and email it to the designated recipient.
     
  5. Many thanks CrystalMS,

    The key word was the use of "HTMLTextWriter" which by it, you will be able to render the ready made GridView to HTML code and prepare it to be sent by an email to the order takers.

    Yours,

    Saihati
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page