Have you thought about building each bill as a separate HTML file? Basically
you'd create an html template, or even a number of templates, with unique names
where you want to place information.

html
body

Customer Name: 0cust_name
Biller Name: 0biller_name

etc, etc

/body
/html

Then use cffile to read the template and rereplace to replace the unique names
w/the corresponding information from your db. Then use cffile again to write a
unique html file for each bill, and reference that unique name in your DB field.
You can set this up to run at 2am, and your users will only hit the db to get
the file name for the bill instead of all of the html content. I've got the code
for all of this at home, and I know I posted it on the list a few months ago if
someone still has it. I'm not sure if this will work for what you're trying to
do, but it might be an alternative.

Phil





Dave Cahall <[EMAIL PROTECTED]> on 03/16/2001 08:48:29 AM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  Re: inserting html into a DB field



After our phone discussion, it appears I think I have a clearer
understanding of what you are trying to do.

You want to create a customer bill or invoice and put the code in a
database.  You are trying to put the dynamic code
that creates the bill/invoice in the database (along with the variables)
so that it can be called from the database later and then
displayed. You are putting the HTML/CFML code on your page as a long
string and ColdFusion is interpreting the code rather
than just inserting it in the database.

If this more clearly describes the situation, then try the following
approach.

Put your CFML page that creates the bill/invoice out on your server.  In
your original page, use a CFHTTP tag to execute the page
(passing the appropriate variables).  This will cause the page to be
executed and the results will be returned to you in a variable named
CFHTTP.FileContent.  Now use this variable to store the results in your
database.  This will have the effect of storing all of the HTML code with
the data already in it.  Now to display the bill dynamically, you just
retrieve the record from your database and display the field contents
(which in turn will have all of the HTML and data originally generated by
the CFHTTP tag).  In fact, if there are a large number of these, you can
set up a scheduled process to create the bills/invoices during non peak
hours and then when the customer wants to view them on-line during peak
times you should get very fast performance because the only query that
has to be executed is to retrieve the record that already has the code
and data in it (no query will be needed to dynamically generate the
content of the bill/invoice).

Hope my interpretation is on target.
On Thu, 15 Mar 2001 17:31:42 -0600 "David Shuck" <[EMAIL PROTECTED]> writes:
> I am trying to insert a chunk of html code from <html> to </html>
> into a
> field in a DB.  The sql works in a query tool, but fails in CF.  In
> the
> error debugging on the page where it shows the query, it displays
> the html
> like it would if it was outputting it on a page after 'values'.  I
> am
> assuming that CF is trying to interpret it rather than just consider
> it a
> long string of text.  I know there is some way to let CF know that
> it is
> just raw text, but I am drawing a major blank.  Anyone?
>
> Thanks.
>
> ~Dave
>
>
>
-------------------------------------------------------------------------
> This email server is running an evaluation copy of the MailShield
> anti-
> spam software. Please contact your email administrator if you have
> any
> questions about this message. MailShield product info:
> www.mailshield.com
>
> -----------------------------------------------
> To post, send email to [EMAIL PROTECTED]
> To subscribe / unsubscribe: http://www.dfwcfug.org
>

-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org







-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org

Reply via email to