Solved

How to include?

Posted on 2000-03-13
21
256 Views
Last Modified: 2013-11-18
I'am using CGI App and using a Page Prducer Component to be linked with my Html Pages,the Pb is how to include Delphi Code with Html code,for e.g i tried to place an html code in:
PageProducer.HtmlDoc.Text and i want to the Response to be:

Response.content:=PageProducer.HtmlDoc.Text;
i found that i need to call:
Response.Cookies to be displayed?????
i think u got it?????
so what is the Mechanism!
Regards
Meer
0
Comment
Question by:mirghani
21 Comments
 
LVL 15

Expert Comment

by:simonet
ID: 2612048
You have to call:

Response.Content := PageProducer.Content;

Alex
0
 

Author Comment

by:mirghani
ID: 2663454
Adjusted points from 50 to 100
0
 

Author Comment

by:mirghani
ID: 2663486
hi simonet,
sorry for delay in replying,
i'am using Table Producer component,
i want to display my table with specific or custom characteristics of display:
such as a hyper link appear in specific coloumn,or in the footer to display
a variable string.
thanks .
Regards Meer.a.a
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

Author Comment

by:mirghani
ID: 2663498
hi simonet,
sorry for delay in replying,
i'am using Table Producer component,
i want to display my table with specific or custom characteristics of display:
such as a hyper link appear in specific coloumn,or in the footer to display
a variable string.
thanks .
Regards Meer.a.a
0
 

Expert Comment

by:junglist
ID: 2671087
I would have thought you can use the OnGetText event handler of the appropriate TField to solve this.
0
 
LVL 17

Accepted Solution

by:
geobul earned 100 total points
ID: 2672436
Hello my friend,

  I'm sorry for the late reply. I was on a business trip for a few days. When I came back I've been told that there is a question for me.
  If it is not too late there is my answer:

  For a specific column use OnFormatCell event handler. There is CellColumn integer which gives the Column number (0 is the first) and CellData string to replace with the new one.

Here it is:

procedure TWebModule1.DataSetTableProducer1FormatCell(....);
var
  OldCellData : String;
  MyURL : String;
begin
  { CellRow = 0 is the title }
  if CellRow > 0 then begin
    { Suppose that you want to change the third column }
    if CellColumn = 2 then begin
      { Save the original value of the cell }
      OldCellData := CellData;
      { Replace with the new one }
      { Here depending on CellRow or the contents of the OldCellData
        generate the URL string }
      MyURL := .....;
      CellData := '<A HREF="' + MyURL + ">'+OldCellData+'</A>';
    end;
  end;
end;

For the Footer property:
  You can place HTML commands here to be executed after the table.

....
DataSetTableProducer1.Footer.Clear;
DataSetTableProducer1.Footer.Add('<HR>The End Of The Table!');
....

Regards, Geo
0
 

Author Comment

by:mirghani
ID: 2675677
hi geo,
if i want the following string to appear at the footer of my table what should i do:
Request.CookieFields.values['login'];
and i'am using (DatasetTableProducer)?
Thanks.
Regards
Meer
0
 

Author Comment

by:mirghani
ID: 2675685
hi geo,
if i want the following string to appear at the footer of my table what should i do:
Request.CookieFields.values['login'];
and i'am using (DatasetTableProducer)?
Thanks.
Regards
Meer
0
 

Author Comment

by:mirghani
ID: 2675690
hi geo,
if i want the following string to appear at the footer of my table what should i do:
Request.CookieFields.values['login'];
and i'am using (DatasetTableProducer)?
Thanks.
Regards
Meer
0
 

Author Comment

by:mirghani
ID: 2675693
sorry for repitition miss control happened.
waiting for u:-)
0
 

Author Comment

by:mirghani
ID: 2675695
sorry for repitition miss control happened.
waiting for u:-)
0
 
LVL 17

Expert Comment

by:geobul
ID: 2679028
Hi Meer,

I'm talking about DataSetTableProducer too. This is the same using QueryTableProducer. The source is different only (Query instead of Table).

....
{ Clear the previous footer if any }
DataSetTableProducer1.Footer.Clear;
{ Add a string to the footer }
DataSetTableProducer1.Footer.Add(Request.CookieFields.Values['login']);
....

The footer is a set of HTML commands.
If the response HTML page contains the table only it is a good idea to place HTML header commands in the TableProducer header and closing HTML tags in the TableProducer footer. For example:
-------
  DataSetTableProducer1.Header.Clear;
  DataSetTableProducer1.Header.Add('<HTML><HEAD><TITLE>');
  DataSetTableProducer1.Header.Add('This is the page title string');
  DataSetTableProducer1.Header.Add('</TITLE></HEAD>');
  DataSetTableProducer1.Header.Add('<BODY>');

  DataSetTableProducer1.Footer.Clear;
  DataSetTableProducer1.Footer.Add('<HR><STRONG>' + Request.CookieFields.Values['login'] + '</STRONG>');
  DataSetTableProducer1.Footer.Add('</BODY></HTML>');
  { Call the TableProducer' Content method which activates generating of the header, table and footer HTML representation }
Response.Content := DataSetTableProducer1.Content;
--------

Regards, Geo
0
 

Author Comment

by:mirghani
ID: 2679563
thanks geo,it works.
i need ur help in the last step in my App,sending Email using SMTP component what do u think???,but i know what u r thinking the points isn't it?,no pb
waiting for ur answere!
thank.
Regards Meer
0
 
LVL 17

Expert Comment

by:geobul
ID: 2680444
Hi Meer,
Do not think that way about me ;)

Actually I've never used SMTP before.
And I'm not sure is it possible to use it in CGI program.

I promise I'll think how you can send e-mails and I'll post a comment here. Give me little time for that.

Regards, Geo
0
 

Author Comment

by:mirghani
ID: 2686627
Hi Geo,
i'am waiting either here or this is my e-mail:mirabd@yahoo.com.
thanks.
pls keep in mind that i'am in hurry:-),and don't forget that u promised me.
Regards Meer.
0
 
LVL 17

Expert Comment

by:geobul
ID: 2689005
Hi Meer,

The easiest way to generate mail is to use TNMSMTP component.

{ in web action item }
var
 mail : TNMSMTP;
begin
  ...
  { your mail server data }
  mail:=TNMSMTP.create(self); //or just place it on the form
  Mail.Host:='MailServerName';
  Mail.Port:=25;
  { message header }
  Mail.UserID:='Your name';
  Mail.PostMessage.FromAddress:='Your mail address';
  Mail.PostMessage.FromName:='Your name';
  Mail.PostMessage.ToAddress.Clear;
  Mail.PostMessage.ToAddress.Add('E-mail address');
  Mail.PostMessage.Subject:='Some text';
  { file attachements if any }
  Mail.PostMessage.Attachments.Clear;
  Mail.PostMessage.Attachments.Add('a file name');
  { message text }
  Mail.PostMessage.Body.Clear;
  Mail.PostMessage.Body.Add('E-mail body - text');
  ...
  { sending prepared message }
  Mail.Connect;
  Mail.SendMail;
  Mail.Disconnect;
  Mail.Free;
  ...
end;

Regards, Geo
0
 

Author Comment

by:mirghani
ID: 2696266
Hi Geo,
give me a chance to test it and i will confirm u.
thanks.
Regards Meer
0
 

Author Comment

by:mirghani
ID: 2696275
Hi Geo,
give me a chance to test it and i will confirm u.
thanks.
Regards Meer
0
 

Author Comment

by:mirghani
ID: 2697497
hi geo,
i'am using our university proxy server do u mean i should replace its host or its ip address(....) at:
mail.host,and its port no(80) at:
mail.port,this above Ques because of the exception i recieved:connection failed.
Thanks.
Regard meer
0
 
LVL 17

Expert Comment

by:geobul
ID: 2699417
Hi Meer,
No, I don't think so. You are connecting to your mail server to send mail not to proxy. You can find these settings somewhere in your mail client program (Outlook Express or what you are using).
Regards, Geo
0
 

Author Comment

by:mirghani
ID: 2867719
hi geo,sorry for delay as i was in a vecation and now i'am back,
we don't have an email server in our university so u think that i can't use the SMTP component in sending mail if not with what u advice me.
Thanks
Regards Meer.
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Print Graphic and Text to Epson TM-T88v 12 262
Working with hours 3 58
When i run adoquery my application freezes 26 167
Multi-layered image in FireMonkey 9 38
Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question