View Full Version : HTML reporting (again)
dulux1309
04-18-2004, 06:55 AM
Hi all - a while back I recieved some help from Worm and a few notable others regarding turning my sqlite queries into reports. I was given an example file which works fine but I am really battling with the output format. I would ideally like to be able to choose which fields to output - relevant to the query requested. The current report is also unprintable as it runs way over the page. I would really like to be able to have more control over the way the report looks but I am no HTML guru and d.weaver just complicates the issue by adding loads of its own code.
I'm kinda after the following layout for each record:
id number | firstname | surname | date joined | status
address| contact num1|
email1 | email2
Can someone write a plugin to make this easier?
Corey
04-18-2004, 07:23 AM
Hi. Dreamweaver doesn't add tons of code. It adds a few extra font tags, which make no real world difference in both performance, and maintenance. It is the most used HTML tool anywhere and is the sole tool behind a large percentage of the internet's busiest web sites. Certainly for your usage it is the best, most appropriate tool available.
In Dreamweaver using COMMAND > CLEAN UP HTML usually gets rid of the extra code altogether anyhow. Takes one click and you only need to do it once, i.e. last thing, just before you publish. The cleaning process itself only takes a couple seconds...
In terms of writing a plug-in for writing simple HTML pages, it's probably not going to materialize due to the limit in demand caused by the ease of writing your own HTML using the TextFile actions. That doesn't mean it won't happen but on the surface it seems unlikely there would be enough sales to make it worthwhile for someone to create and support such a plug-in.
Anyhow the good news is that HTML is a very simple issue and one can sit down and learn the ins and outs of it in a single afternoon, so that's definitely your best bet. In the long run, if you are seeking to control your delivery of HTML it's the "only" real solution. Actually it's kind of fun anyhow, everyone who learns HTML seems to enjoy the process for the most part. :)
Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)
dulux1309
04-18-2004, 07:29 AM
Maybe it just seems like tons of code. I guess it's a little daunting trying to learn HTML as well as making it work in AMS. I have a shadow of an idea as to how to go about it, but I think it's gonna get complicated...
I was hoping for a plugin as SQlite is such a massive boon to AMS, and a general reporting engine kinda goes hand in hand with that. You have one customer right here (flicking a thumb through a big, dirty wad of cash)...
I'll keep plugin' away - no pun intended...
Thanks, anyway.
Corey
04-18-2004, 07:50 AM
Hi. FWIW HTML is easy to learn, there's tons of free resources on Google. If you can learn AMS, HTML will be a breeze. HTML is not complicated, I have taught it personally to dozens and dozens of people in a few hours, many of whom displayed very limited aptitude. I have full confidence in your ability to learn it. Many of the free resources for learning HTML which are on Google are absolutely magnificient and are geared directly to people in your scenario.
As for a plug-in to write HTML, who knows maybe some intrepid 3rd party will try it out. If you don't like Dreamweaver, there's a free tool called "Firstpage" out there which is similar and is very, very good... More or less like Dreamweaver except free.
Anyhow HTML knowledge is a great asset for any multimedia designer and is definitely worth the afternoon it takes to learn. It's not just about knowing the code, it's also about building an efficient workflow and confidence in your abilities. Today is Sunday. Sundays are ideal for learning HTML. :)
Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)
John-oh
04-18-2004, 10:46 AM
Firstpage is excellent, especially for free. I don't think there is much support for it now, but most of it is self explanatory. There is even a plugin FTP program.
You could go hair-shirt and just use a text editor, I know people who do.
As I used to be a DOS WordStar user, inserting formatting tags into a document came fairly easily, but once you've got the principle the hardest part is just remembering exactly which code to insert, which is where HTML editors come into their own.
I would recommend this site (http://www.mcli.dist.maricopa.edu/tut/lessons.html) which takes you through building a complete site with nothing more than a flask of coffee and Notepad, I prefer Textpad, (which has a HTML tag addin) but everyone has their own favourite text editor.
Cheers
Corey
04-18-2004, 10:54 AM
Great link! Yep, that's the ticket. :cool
Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)
dulux1309
04-18-2004, 12:09 PM
Nice one - thanks for the great link. I think I may have confused you guys a bit here. I have some rudimentary HTML skills - although nearly all my web work takes place without using raw code. My real problem is creating a looping structure in AMS that will create the exact layout that I want. I'm sure I can manage this, it might just take some time...
At the mo I am creating the page in Dweaver and then cutting and pasting the HTML into AMS in strings - it's just going horribly right now... I'm having to amend each line as i'm getting all sorts of errors - using '\' and so on. Would be nice to be able to tell AMS to 'ignore this code - is HTML' in much the same way as it ignores comments. That way I could just dump my HTML straight in and save myself a few more grey hairs...
Corey
04-18-2004, 12:22 PM
Hi. A simple global replace will turn all " into \" with one click. you can do this in any text editor or Dreamweaver...
Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)
dulux1309
04-18-2004, 12:30 PM
Thanks - I guess the real problem here is I have just got lazy. AMS takes so much of the hard work out of development I have sort of got used to having it all on a plate for me.
I have had some success with the following example -
pagecode = String.Replace(pagecode, "~idnumber~", tblResult.Data[1]["MEMBERSHIPNO"], false);
Of course, this only displays one item. What I ideally need to do is create a table populated by placeholders for each field I want to display and then have this table duplicated for every record returned by the query - does that sound about right?
dulux1309
04-18-2004, 12:39 PM
Can you guys have a look at this and tell me where I stink?
--**CREATE LOOP FOR MAKING A TABLE AND REPORTING ALL RECORDS**
for i = 1, tblResult.Rows do
table = ""<table width="75%" border="0">
\<tr>
<td width="14%" bgcolor="#FFFFFF"><font color="#FF0000" size="3" face="Tahoma">~idnumber~</font></td>
<td width="20%">~firstname~</td>
<td width="66%">~surname~</td>
</tr>
</table>""
--use stringreplace to replace the placeholders in the template with my fields
pagecode = String.Replace(pagecode, "~idnumber~", tblResult.Data[i]["MEMBERSHIPNO"], false);
end
--
Thanks - with your continued support I'll master this yet...
Dulux,
What in the sample I posted to you the other day are you having difficulty grasping? The sample I uploaded did basically this exact thing
Thread (http://www.indigorose.com/forums/showthread.php?t=7189&highlight=html+table)
Can you guys have a look at this and tell me where I stink?
--**CREATE LOOP FOR MAKING A TABLE AND REPORTING ALL RECORDS**
for i = 1, tblResult.Rows do
table = ""<table width="75%" border="0">
\<tr>
<td width="14%" bgcolor="#FFFFFF"><font color="#FF0000" size="3" face="Tahoma">~idnumber~</font></td>
<td width="20%">~firstname~</td>
<td width="66%">~surname~</td>
</tr>
</table>""
--use stringreplace to replace the placeholders in the template with my fields
pagecode = String.Replace(pagecode, "~idnumber~", tblResult.Data[i]["MEMBERSHIPNO"], false);
end
--
Thanks - with your continued support I'll master this yet...
dulux1309
04-18-2004, 06:17 PM
The sample you kindly put up I have been using and trying to manipulate - it currently shows all fields in a format that I am having trouble printing out. I really need to change it so that I only get certain fields, depending on the query selected. I am sure I am coming across as extremely dense, but I did understand most of the code you posted, just having a problem amending it to suit my requirements. I think the loop that creates and formats the table also has a question mark over it, but maybe I need to spend more time on it.
I hate to appear like one of those guys who just can't be bothered and wants everyone to drop everything, rally round and write my app for me. I do appreciate the help - even more when I learn from it and begin to grasp the concepts behind it...
using the sample I uploaded you could do the same. Instead of doing a :
Select * from MEMBERS
Do This:
Select ID, FirstName, SurName from MEMBERS
The code will create a table using whatever fields you choose in your Select statement.
The sample you kindly put up I have been using and trying to manipulate - it currently shows all fields in a format that I am having trouble printing out. I really need to change it so that I only get certain fields, depending on the query selected. I am sure I am coming across as extremely dense, but I did understand most of the code you posted, just having a problem amending it to suit my requirements. I think the loop that creates and formats the table also has a question mark over it, but maybe I need to spend more time on it.
I hate to appear like one of those guys who just can't be bothered and wants everyone to drop everything, rally round and write my app for me. I do appreciate the help - even more when I learn from it and begin to grasp the concepts behind it...
dulux1309
04-19-2004, 08:04 AM
Thanks, Worm. I'll try it out and let you know.
Powered by vBulletin™ Version 4.0.6 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.