Lexter
Nuker Posts:15
|
10/01/2007 12:39 PM |
|
Hi, I am a real novice when it comes to DNN but I find it extremily easy to use and I am progressing in leaps and bounds.
However, I have designed numerous sites using HTML and Javascript to connect to SQL databases and display results in a table or any format required. I have tried without any success to get the Text/HTML module to display my results. Is there anyone out there that could give me a helping hand?
I dont want to download module after module to get close to what I need, I just need to enter the Javascript I have always used into the Text/HTML Module and display the data returned in my chosen format.
All i need is a sample page/script which will connect to a give database and display the results in any format, from that script I could work out where i am going wrong.
Please contact me ASAP because this is doing my head in.
Once I have what I need, I can continue with my Extranet site.
Regards
Alex |
|
|
|
|
Lee Sykes DNN Creative Staff
Nuke Master VI Posts:4945
|
10/01/2007 2:40 PM |
|
Hello, I don't know about javascript that you can insert into a text / html module to extract data out of DotNetNuke. - But, if you want to place JavaScript in a text / HTML module make sure the'source' button is selected - do not go back to HTML view and click straight on the update link, this should allow you to store JavaScript in the text HTML module. However there are other ways of generating reports, for instance checkout the core reports module, this allows you to enter SQL queries to extract information out of the SQL database. Or a more advanced module which will give you probably all the flexibility you need will be listx and the suite of modules from bi4ce Hope this helps, Thanks, |
|
Lee Sykes Site Administrator Subscribe to the website : DotNetNuke Video Tutorials : The Skinning Toolkit : DotNetNuke Podcasts
Twitter: www.twitter.com/DNNCreative
|
|
|
Lexter
Nuker Posts:15
|
10/01/2007 3:31 PM |
|
Lee, buddy, I'm not trying to retieve data from anything in DNN, I just need a sample Javascript scipt that will work in the Text/HTML module which will drag data from a database of my choosing and display the results in any format.
Once i see how its done I can adapt it to suit.........
Please tell me you can help, or point me in the direction of someone who can.
Regards
Alex
|
|
|
|
|
Joseph Craig DNN MVP Posts:11667
|
10/01/2007 3:35 PM |
|
Alex,
I believe that Lee's suggestion of listx and possibly Xmod will satisfy your needs. You can also write custom modules to dump data into a gridview control. |
|
Joe Craig, Patapsco Research Group Complete DNN Support |
|
|
Lexter
Nuker Posts:15
|
10/01/2007 4:05 PM |
|
No, No, No, NO please read the previous posts.....I just need a script/free module that will give me the ability to run scripts of my choosing (up to 30 different scripts on various pages) that i can use to post data to a database and retrieve the same data via a script.....
I have tried the above posts but I cannot get them to work...... Can someone please post a sample script that they have tried and tested........and works?
If I can see a working example, I can work everything else out for myself!!!!!
If DNN is as case sensitive like ASP and Javascript......then I and everyone else needs to know.
PLEASE, can anyone help????????
I absolutely love everything about this software, but if Javascript cannot be executed, I'll have to look elsewhere.
Please, can smeone help?????
Alex
|
|
|
|
|
Joseph Craig DNN MVP Posts:11667
|
10/01/2007 4:19 PM |
|
Javascript can certainly be executed.
Let's focus on a single, simple script. I assume that you have a script that runs a db query and then wants to dump the results of the query somewhere. In what format is that output, and where do you want to dump it?
If you want to dump the output into a Text/Html module, then you script will need to write it's results into the entry in the DNN database that holds the text for that script. A good place to stick the javascript, hopefully, is the "header" to the Text/Html module. You can find that in the Advanced settings for the page that holds the module.
To make sure that the javascript is placed correctly, look at the page source.
Posting a simple example of the script that you want to run might help us understand.
BTW, writing a simple module to run queries against external databases and put the results in a table on a DNN page isn't that big of a deal. Even I have done that! In my case, I do it programmatically, doing the SQL scripts in c#. Your module could certainly contain a script as a parameter. If you were to decide to go that way, I'd recommend that you locate Michael Washington's blog at the dotnetnuke.com site and read over his tutorial on module development and "super simple DAL." |
|
Joe Craig, Patapsco Research Group Complete DNN Support |
|
|
Lexter
Nuker Posts:15
|
10/01/2007 4:42 PM |
|
OK, heres a simple script that I used in previous (old) websites, I've changed the connection string and added '*****' where needed for security reasons.....dont laugh, it does actually work!!!!!!!
<%@ LANGUAGE = JScript %><%<br> var oConn; <br> var oRs; <br> var curDir; <br> var Index;<br> var dated;<br><br> // Create ADO Connection Component to connect<br> // with Extranet<br> <br> oConn = Server.CreateObject("ADODB.Connection");<br> oConn.Open("Provider=SQLOLEDB;server=******;database=dotnetnuke;uid=*****;password=*****");<br> <br> <br> <br> // Create ADO Recordset Component<br> <br> oRs = Server.CreateObject("ADODB.Recordset");<br> oRs.ActiveConnection = oConn;<br> <br> <br> // Get recordset<br> <br> oRs.Source = "select * from links";<br> <br> <br> <br> // Open Recordset<br> <br> oRs.Open();<br> <br> var RecordCount;<br> RecordCount = 0;<br> <br> while (!oRs.eof) { %><% for(Index=0; Index < oRs.count; Index++) { %><% }<br> RecordCount = RecordCount + 1; %>
<% =oRs("Title") %>
<%<br> <br> oRs.MoveNext();<br> } <br> %><% <br> oRs.Close();<br> oConn.Close();<br> %>
Can anyone help????
Regards
Alex |
|
|
|
|
Joseph Craig DNN MVP Posts:11667
|
10/01/2007 5:12 PM |
|
Is this reading from your DNN database, or an external one? If it's reading your database, why do you want to do it this way?
I guess that I can see your problem. This script doesn't know where to put the output of the query. Is that the problem?
If I were you, I'd google "dotnetnuke javascript" and I would also scan and possibly post your question at the DotNetNuke forums. |
|
Joe Craig, Patapsco Research Group Complete DNN Support |
|
|
Lexter
Nuker Posts:15
|
10/01/2007 5:29 PM |
|
Could you recomend a way to retieve data from a DB using bespoke Javascript? as a DNN starter/novice i'm struggling using the Text/HTML Module? All i need is a simple script that will work!!!!!
I'm from the old school and have no knowledge of XML, ASP etc I'm just fumbling around with DNN.
Can someone please post a working script that works within the Text/HTML Module?????
|
|
|
|
|
Joseph Craig DNN MVP Posts:11667
|
10/02/2007 11:14 AM |
|
Check out t he ReportGrid project Dnaxp.Net. It appears to answer most of the requirements that you've mentioned. |
|
Joe Craig, Patapsco Research Group Complete DNN Support |
|
|