2 Replies - 2205 Views - Last Post: 09 June 2014 - 11:30 PM Rate Topic: -----

#1 lewcianci  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 27-May 12

Displaying data from database in an eye-catching manner

Posted 16 April 2014 - 06:31 PM

Hi all,

I'm looking for a way to display data on my web page in such a way that it looks appealing (by way of providing an overview). I've been cutting code most of the morning and my attention span is starting to fray, so I apoligize if what I'm asking doesn't make sense.

Basically, its a bit of a mixed bag of a request. The SQL backend runs this query:
	SELECT COUNT(ID)
  FROM [au3test].[dbo].[Tbl_HistoryLineStats]
  WHERE HistoryLineTimeInvoked > CAST(GETDATE() AS date)


This returns a number.

I want this number to be displayed on the web page like so...

56
calls closed today

23
hours spent on calls

33
technicians working

But, I want this data to be displayed horizontally, not vertically.

The only way I can think of doing this is via a gridview, but that would mean the backend SQL query would have to pull all the numbers from the stats that I want (by way of a few self joins, I would imagine). In this way I would make the first row have a larger font, and the second row would have a smaller font. Then all the numbers would show up in the top row, along with what they mean below them (in a smaller font).

I just can't think of a way of doing that though, and I'm sure that there must be a way (and probably an easy way at that).

Can anyone help me?

Thanks...

Is This A Good Question/Topic? 0
  • +

Replies To: Displaying data from database in an eye-catching manner

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9206
  • View blog
  • Posts: 34,586
  • Joined: 12-June 08

Re: Displaying data from database in an eye-catching manner

Posted 16 April 2014 - 06:45 PM

Slap them in a DIV, and do it in CSS.
Was This Post Helpful? 0
  • +
  • -

#3 romeorulez  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 03-November 09

Re: Displaying data from database in an eye-catching manner

Posted 09 June 2014 - 11:29 PM

Not the best as asp.net but can you do this?

dim con as your connection string
dim dr as datareader

dim cmd as sqlcommand(SELECT COUNT(ID)FROM [au3test].[dbo].[Tbl_HistoryLineStats]WHERE HistoryLineTimeInvoked > CAST(GETDATE() AS date),con)

con.open()
dr = cmd.executereader

while dr () then ....assuming everytime your sql command returts one value since it will look for datareader at position 0
displayLabel(say you had a label).text = dr.getvalue(0).tosring + "calls closed today"
exit while

In your design view make a label called displayLabel and below it make another label with text Calls closed today

Just a thought :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1