HTML Formatting using SSIS
Hi Forum ,
I need to do cleanup on a column to display clean data by eliminating the various <HTML> in the source. I would like to do a replace using the charindex, but my query becomes too big and i might miss some tags. What would be the best approach removing
the <tags> or formating them to display in correct format? .
Please give me some example if we can format data according to the tags using SSIS components.
<p><font face="Times New Roman"><span style="font-size: 11pt; ">DAVID BACKER, JR
</span><span style="font-size: 11pt; color: navy; ">L
</span></font><span style="font-size: 11pt; ">
<font face="Times New Roman"> 11111 Erwin 185th Ter <br />Jersey Gardens, NJ 10156
/* Microsoft SQL Server Integration Services Script Component
* Write scripts using Microsoft Visual C# 2008.
* ScriptMain is the entry point class of the script.*/
// C# code
using System;
using System.Data;
using System.Text.RegularExpressions; // Added
using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
using Microsoft.SqlServer.Dts.Runtime.Wrapper;
[Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]
public class ScriptMain : UserComponent
// Method that will be executed for each row.
public override void Input0_ProcessInputRow(Input0Buffer Row)
// Replace the value of the message column
Row.Notes = RemoveHtml(Row.Notes).Replace(" ", " ")
.Replace("&", " ").Replace("-->", "
").Replace(""", "\"")
.Replace("<", "<").Replace(":
YES", ": YES ").Replace(": NO", ": NO ");
// A string method that removes html tags
// with a regex pattern
public String RemoveHtml(String message)
// The pattern for a html tag
String htmlTagPattern = "<(.|\n)+?>";
/// ///"<(.|\n)+?>"
/// ///"(?<=<[^>]*) "
// Create a regex object with the pattern
Regex objRegExp = new Regex(htmlTagPattern);
// Replace html tag by an empty string
message = objRegExp.Replace(message, String.Empty);
// Return the message without html tags
return message;
Ntext Source DataType
I convert the columns to convert(varchar(max),jr.NOTES) as Notes
Similar Messages
-
How to send mail in HTML format using SMTP
I want to send mail in HTML format using SMTP.Can anybody please suggest how to do it.Can anybody send me the code.
Thnx.If you don't know how to send a message using JavaMail see here : http://developer.java.sun.com/developer/onlineTraining/JavaMail/contents.html#JavaMailSending
To send a html format mail you need to set the content type like this (msg is a javax.mail.internet.MimeMessage) :
String subject = "An Email 4 U";
String message = "<HTML><BODY>Here is a link<br><a href='http://javasoft.com'>Java</a></BODY></HTML>";
msg.setSubject(subject);
msg.setContent(message, "text/html");p.s This isn't really an advanced topic -
How to send the body of mail in html format using servlet
Hi
i developed an servlet using sun.net.smtp.SmtpClient package,my servlet receiving data from an form,i can able to send mail successfully,but my mail body part is in the text format,but i would like to send it as an html format,for ex <input type="text" size="25" name="Name"> as an input field with value received from the form instead of showing tags as i mentioned<input type="text" size="25" name="Name"> ,any help would be appreciated.
Regards.See this program
But here whats the problem is ,
some maiservers doesnot support html code if u send this mail to yahoo account it will show html code as it is,
hotmail account encodes the html and shows proper fonts and headings
import java.io.*;
import java.util.*;
import java.net.*;
import sun.net.smtp.SmtpClient;
public class SendMail {
public static void main(String args[]){
int i = 0;
//while (true) {
SmtpClient mail;
try{
i++;
String email = "[email protected]";
String from="[email protected]";
mail=new SmtpClient("bizpivot.com");
mail.from(from);
mail.to(email);
PrintStream msg=mail.startMessage();
msg.println("To: " +email);
msg.println("Subject: Hai" i "!!!");
msg.println("<html><head><title>Untitled</title></head><body bgcolor='red' text='#00ffff'><font face='Courier New' size='+3'>Hai How are you Man!!!</font></body></html>");
mail.closeServer();
System.out.println(i);
catch(Exception e){e.printStackTrace();} -
Please suggest how can we verify file format using SSIS 2008 .
We have ragged files placed in directory which need to be loaded into DB. Before loading we need to validate the file format before loading.
The file schema is as follows.
01 XREF_RCD.
05 XR_JOB PIC X(4).
05 XR_PHASE PIC X(2).
05 XR_DATE PIC X(6).
05 XR_ST_CHECK_NO PIC S9(8)
05 XR_END_CHECK_NO PIC S9(8)
05 XR_ST_SERIAL PIC S9(8)
05 XR_END_SERIAL PIC S9(8)
05 XR_AMOUNT PIC S9(7)V99
05 XR_ISSUE_DATE PIC X(6).
05 XR_CONTENT_FLAG PIC X.
05 XR_XREF_CARD_PROCESSED PIC X.
Could you please suggest how can we validate using SSIS 2008 and
invalid value in header (alpha character for numeric field), more than 20% of records with errors, format is not correct also need to validated.Before we load the data we need to verify invalid value in header (alpha character for numeric field),
more than 20% of records with errors,
format is not correct (values starting or ending in wrong position), if the above validation pass then only the data can be loaded. please suggest how can we achieve in SSIS . The FileFormat and filedata is available below.
please find the file contents.
49530110050230088937300889393008893730088939000036714100506
54000110050230089190300894103008919030089410000066614100506
73880110050230090564300907593009056430090759000104503100506
73880110050230090564300907593009056430090759000104503100506
45980110050230088829300888793008882930088879000033453100506
58160110050230089820300898263008982030089826000058278100506
41680110050130088623300886413008862330088641000035877100506
41680110050241683471416834714168347141683471000000949100505
82900110050230093642300936633009364230093663000069407100506
54520110050230089411300894193008941130089419000048629100506
83580110050230093664300936683009366430093668000083136100506
56320110050230089556300895613008955630089561000073072100506
74160110050230090760300907983009076030090798000099724100506
57920110050230089562300895823008956230089582000079256100506
45950110050230088649300888283008864930088828000185937100506
81770110050230092335300928073009233530092807000118370100506
70760110050230089827300899233008982730089923000083451100506
74200110050230090799300908493009079930090849000047305100506
84450110050230093699300937153009369930093715000076723100506
83930110050230093669300936983009366930093698000043699100506
75120110050230091002300910043009100230091004000034908100506
10100110050230088620300886223008862030088622000194662100506
79600110050230091402300914093009140230091409000119741100506
58110110050230089583300897633008958330089763000140539100506
58117710050230089764300897643008976430089764000047663100506
52460110050230088940300891893008894030089189000097617100506
48820110050230088928300889343008892830088934000142420100506
48824110050230088935300889363008893530088936000144862100506
82810110050230093510300936413009351030093641000156790100506
76090110050230091060300911413009106030091141000111451100506
74210110050230090850300909943009085030090994000130955100506
75760110050230091030300910323009103030091032000075843100506
File Layout
XR_JOB PIC X(4).
XR_PHASE PIC X(2).
XR_DATE PIC X(6).
XR_ST_CHECK_NO PIC S9(8)
XR_END_CHECK_NO PIC S9(8)
XR_ST_SERIAL PIC S9(8)
XR_END_SERIAL PIC S9(8)
XR_AMOUNT PIC S9(7)V99
XR_ISSUE_DATE PIC X(6).
XR_CONTENT_FLAG PIC X.
XR_XREF_CARD_PROCESSED PIC X -
How to send mail using HTML format using tags
Hello experts,
I am currently using FM SO_NEW_DOCUMENT_SEND_API1 to send e-mails to our users' Outlook accounts. Now, I converted its document type from 'RAW' to 'HTM'. I enclosed my texts in HTML tags. But the problem is, I cannot see a thing when I check my message in SCOT. It just opens internet explorer and thats it. Anyway, Below is my code:
get e-mail addresses of controllers in table ZSHIPTO_EMAIL
SELECT * FROM zshipto_email
INTO TABLE it_zshipto_email
WHERE zevent = '2'.
IF sy-dbcnt > 0.
IF NOT it_del_entries[] IS INITIAL.
CLEAR lv_contents.
maildata-obj_name = 'Record Deleted in table ZTS0001'.
maildata-obj_descr = 'Record Deleted in table ZTS0001'.
maildata-obj_langu = sy-langu.
records deleted in ZTS0001 and ZTS_STPGEOLOC
CLEAR: lv_flag, lv_counter.
LOOP AT it_zshipto_email.
CLEAR: it_del_entries, mailtxt.
LOOP AT it_del_entries ASSIGNING <fs_del_entries>.
get name of dealer
SELECT SINGLE name1 FROM kna1
INTO <fs_del_entries>-name1
WHERE kunnr = <fs_del_entries>-kunnr.
IF lv_counter IS INITIAL.
CONCATENATE: '<p>'
'FYI: The ff record/s were deleted in tables'
'ZTS0001 and ZTS_STPGEOLOC by user' sy-uname
'</p>'
INTO lv_contents
SEPARATED BY space.
mailtxt-line = lv_contents.
APPEND mailtxt.
CLEAR: mailtxt, lv_contents.
ENDIF.
APPEND mailtxt.
CONCATENATE: '<p>'
'Dealer :' <fs_del_entries>-kunnr '-'
<fs_del_entries>-name1 '</p>'
INTO lv_contents
SEPARATED BY space.
mailtxt-line = lv_contents.
APPEND mailtxt.
CLEAR: mailtxt, lv_contents.
CONCATENATE: '<p>'
'Ship-To:' <fs_del_entries>-cdseq '</p>'
INTO lv_contents
SEPARATED BY space.
mailtxt-line = lv_contents.
APPEND mailtxt.
CLEAR: mailtxt, lv_contents.
CONCATENATE: '<p>'
'Address:' <fs_del_entries>-zaddress '</p>'
INTO lv_contents
SEPARATED BY space.
mailtxt-line = lv_contents.
APPEND mailtxt.
CLEAR: mailtxt, lv_contents.
CONCATENATE: '<p>'
'Contact person:' <fs_del_entries>-zcperson
'</p>'
INTO lv_contents
SEPARATED BY space.
mailtxt-line = lv_contents.
APPEND mailtxt.
CLEAR: mailtxt, lv_contents.
CONCATENATE: '<p>'
'Contact number:' <fs_del_entries>-zcnumber
'</p>'
INTO lv_contents
SEPARATED BY space.
mailtxt-line = lv_contents.
APPEND mailtxt.
CLEAR: mailtxt, lv_contents.
lv_counter = 1.
ENDLOOP.
APPEND mailtxt.
mailrec-receiver = it_zshipto_email-zemail.
mailrec-rec_type = 'U'.
APPEND mailrec.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = maildata
document_type = 'HTM'
put_in_outbox = 'X'
commit_work = 'X'
TABLES
object_header = mailtxt
object_content = mailtxt
receivers = mailrec
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CLEAR: mailtxt, mailrec, lv_counter.
REFRESH: mailtxt, mailrec.
ENDLOOP.
ENDIF.
Message was edited by: viraylabHi,
Check this...
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5931ff64-0a01-0010-2bb7-ff2f9a6165a0
Regards
vijay -
To Send HTML Format and excel file attachment in same mail
Dear All,
Have requerment ,to send a mail options HTML table format and same data in excel file attachement.have capable to do the html format using methods BCS .but how to send excel format attachment in same mail.
Please guide me how to do it.
Regards ,
Santhu
Edited by: santosh jajur on Apr 9, 2010 1:54 PMSanthosh,
please check the code:
report bcs_example_7.
This report provides an example for sending an Excel
attachment in Unicode Systems
constants:
gc_tab type c value cl_bcs_convert=>gc_tab,
gc_crlf type c value cl_bcs_convert=>gc_crlf.
parameters:
mailto type ad_smtpadr
default 'ur mail id'. "#EC *
data send_request type ref to cl_bcs.
data document type ref to cl_document_bcs.
data recipient type ref to if_recipient_bcs.
data bcs_exception type ref to cx_bcs.
data main_text type bcsy_text.
data binary_content type solix_tab.
data size type so_obj_len.
data sent_to_all type os_boolean.
start-of-selection.
perform create_content.
perform send.
form send.
try.
send_request = cl_bcs=>create_persistent( ).
create document object from internal table with text
append 'Hello world!' to main_text. "#EC NOTEXT
document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = main_text
i_subject = 'Test Created By BCS_EXAMPLE_7' ). "#EC NOTEXT
add the spread sheet as attachment to document object
document->add_attachment(
i_attachment_type = 'xls' "#EC NOTEXT
i_attachment_subject = 'ExampleSpreadSheet' "#EC NOTEXT
i_attachment_size = size
i_att_content_hex = binary_content ).
add document object to send request
send_request->set_document( document ).
--------- add recipient (e-mail address) -----------------------
create recipient object
recipient = cl_cam_address_bcs=>create_internet_address( mailto ).
add recipient object to send request
send_request->add_recipient( recipient ).
---------- send document ---------------------------------------
sent_to_all = send_request->send( i_with_error_screen = 'X' ).
commit work.
if sent_to_all is initial.
message i500(sbcoms) with mailto.
else.
message s022(so).
endif.
endtry.
endform. "send
form create_content.
data lv_string type string.
data ls_t100 type t100.
columns are separated by TAB and each line ends with CRLF
concatenate 'This Is Just Example Text!' "#EC NOTEXT
gc_crlf gc_crlf
into lv_string.
header line
concatenate lv_string
'MSGID' gc_tab
'MSGNO' gc_tab
'Language' gc_tab "#EC NOTEXT
'Text' gc_crlf "#EC NOTEXT
into lv_string.
data lines
select * from t100 into ls_t100
where arbgb = 'SO' and msgnr = '182'.
concatenate lv_string
ls_t100-arbgb gc_tab
ls_t100-msgnr gc_tab
ls_t100-sprsl gc_tab
ls_t100-text gc_crlf
into lv_string.
endselect.
select * from t100 into ls_t100
where arbgb = 'SO' and msgnr = '316'.
concatenate lv_string
ls_t100-arbgb gc_tab
ls_t100-msgnr gc_tab
ls_t100-sprsl gc_tab
ls_t100-text gc_crlf
into lv_string.
endselect.
try.
cl_bcs_convert=>string_to_solix(
exporting
iv_string = lv_string
iv_codepage = '4103' "suitable for MS Excel, leave empty
iv_add_bom = 'X' "for other doc types
importing
et_solix = binary_content
ev_size = size ).
catch cx_bcs.
message e445(so).
endtry.
endform. "create_content
Thanks. -
Convert JEditorPane document into HTML format
Hi,
I have developed an editor using swing's JEditorPane.
I want to know whether is it possible to convert the entire content of the
JEditorPane into HTML format using some API's.
For example if JEditorPane contains the text such as
JEditor pane to HTML
After converting it to HTML, it should appear as
<b>JEditorPane</b> <i>to</i> <u>HTML</u>
.editorPane.getDocument.getText()
-
Formating of o/p to proper HTML format
Hi All,
I have aprogram which generates an o/p and send it as an attchment via mail in HTML format using FM.
However the o/p doesn't look well formated. I want to format it.
Current o/p format is -
Job Name Job Creator Status Delay Duration Sched.start date Sched.start time Start Date Start Time End Date End Time Executing Server SAP_REORG_XMILOG MSAMPSON A 000048 000000 20100819 000100 20100819 000148 20100819 000148 norddev_NRD_00
I want to format it to
Job Name Job Creator Status Delay Duration Sched.start date Sched.start time
Server SAP_REORG_XMILOG MSAMPSON A 000048 00000 20100819 000100
Kindly help me with your expertise!!!
Thanks
ReshmaIS your requirement adding a line in your format?
Try checking out the function module and see what tags they use and how they implement....
Regards,
Lalit Mohan Gupta. -
Help needed while exporting crystal reports to HTML file format using java
Help needed while exporting crystal reports to HTML file format using java api(not using crystalviewer).i want to download the
html file of the report
thanksthe ReportExportFormat class does not have HTML format, it has got to be XML. Export to HTML is available from CR Designer only.
Edited by: Aasavari Bhave on Jan 24, 2012 11:37 AM -
How can I send email from an JSP page with HTML format either using jsp
hi,
I have an jsp page with online application form,after compleating the form if i select submit it will send all the compleated data to the mail id we mentioned in the form tag,for this i am using javascript,but instead of receiving the data in the format of strings,my client want to receive the data in the same format as he's filling in the jsp page(html format) through e-mail.any help would be appreciated.the fallowing is the code right now i am using for email application.
<code>
function send()
if(validatePersonalInfo(document.theform))
document.theform.submit()
location.href=location.reload()
function validatePersonalInfo(form)
var tmpStr ="";
if (form.Name.value == "") {
tmpStr = "Name";
document.all.dName.style.visibility="visible";
document.theform.Name.focus();
else{
document.all.dName.style.visibility="hidden";
if (form.SSN.value == "") {
tmpStr = tmpStr + ", Social Security Number";
document.all.dSSN.style.visibility="visible";
if(form.Name.value != "")
{document.theform.SSN.focus();}
else{
document.all.dSSN.style.visibility="hidden";
if (tmpStr == "") {
return true;
} else {
alert("Please Fill the Following Fields: " + tmpStr);
return false;
<FORM NAME="theform" METHOD="post"
ACTION="mailto:[email protected]?subject=Online Application Form for MinorityDealer." ENCTYPE="text/plain">
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="10" NOF="LY">
<TH>
<P>
<FONT SIZE="3" FACE="Arial,Helvetica,Univers,Zurich BT">Online�Application</font></TH><BR>
</TABLE>
<table width="718" border="1" cellspacing="0" cellpadding="3" bgcolor="#CCCCFF" align="center">
<tr>
<td colspan="2"><font class="captionText">Name*�</font><br><input type="text" size="25" name="Name" class="bodyText">
<div id="dName" name="dName" style="position:absolute;visibility:hidden"><font color="red">Name is Mandatory*</font></div>
</td>
<td colspan="2"><font class="captionText">Social Security Number*�</font><br><input type="text" size="9" name="SSN" class="bodyText">
<div id="dSSN" name="dSSN" style="position:absolute;visibility:hidden"><font color="red">SSN is Mandatory*</font></div></td>
</tr>
<tr>
<td colspan="2"><font class="captionText">Total Personal Assets</font><br><input type="text" size="10" name="TotPersAss3" class="bodyText"></td>
<td colspan="2"><font class="captionText">Total Personal Liabilities & NetWorth</font><br><input type="text" size="10" name="TotPerLiab3" class="bodyText"></td>
</tr>
</tr>
</TABLE>
<IMG Valign="middle" name="imgSubmit" src="images/buttons/Submit.gif" width="66" height="29" border="0" alt="Submit">
</code>Can any one do some help to solve this problem.
Regards. -
How to format and send html email using utl_smtp
Hi,
I need to send email in the html format from within the database using utl_smtp. I am really not interested in creating os level file using "set markup html on spool on" and sending that as an html attachment. Can someone please give a code?
1. Output of a select needs to be emailed (for example : select empid, name from emp, salary)
2. Certian cells for example salary < 4800 needs to be higlighted in Red color
3. I need to send email which is having more than 32767 characters (I can not use varchar2 field)
I have reffered to following url on asktom:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1739411218448
However it does not help.
If someone has a sample code with any select from a table, it would be a great help.
Regards
Sudhanshu BhandariThere have been many very good threads on sending email using the UTL_SMTP on the forum including threads that deal with HTML formated mail.
The basic process is to the same as with sending regular (non HTML) mail, but you add some additional headers to the mail message as well as additional formatting to the message body (e.g. HTML tags as needed).
Specifically you need to add the two following headers:
MIME-Version: 1.0
Content-type: text/html -
How do I Send HTML formatted email using class in javax.mail pkg
How do I Send HTML formatted email using javax.mail pkg class ?i mean is thr any class available in this package to do this ?
Please see
http://javaalmanac.com/egs/javax.mail/SendApp.html
for Quintessential Program to Send E-Mail.
Then substitute line
msg.setText(content);
/with this one
msg.setContent( content , "text/html");
it should do in simplest form. -
How to send HTML Format Mail using Java Mail in oracle 9i Forms
Dear All
could you please tell me how to send HTML Format Mail using Java Mail in oracle 9i Forms and how to implement the java mail ?
if it is possible, could you please send me the sample code? please very urgent
Thanks
P.SivaramanHello,
<p>Here is a Form sample.</p>
Francois -
How to maintain format in html email using the send email....
Does anyone know how to maintain the format in a HTML email using the Send E-mail To Recipients From Recordset behavior?
When text only is selected instead of HTML text on the Options tab the format of the input is maintained, but when HTML text is selected the email has no format. I have tried to use a replace \n with
as I have done when hand coding PHP, BUT I am trying to learn to use ADDT. I also tried to use a Custom trigger without success.
Help!Hi Dave,
in my snippets folder I have this thing which I found on the old MX Kollection forums and which was suggested by the Interakt staff:
//trigger SendEmail (write content)
function Trigger_SendEmail(&$tNG) {
ob_start();
include("myDynamicContentFile.php");
$mailcontent = ob_get_contents();
ob_end_clean();
$emailObj = new tNG_Email($tNG);
$emailObj->setTo("[email protected]");
$emailObj->setFrom("[email protected]");
$emailObj->setSubject("A new User was added");
$emailObj->setContent($mailcontent);
$emailObj->setEncoding("UTF-8");
$emailObj->setFormat("text");
$emailObj->setImportance("Low");
return $emailObj->Execute();
//trigger SendEmail (write content)
The only modification is the possibility to include a dynamic PHP file rather than some static text or a HTML file which will also render textarea contents on one line:
ob_start();
include("myDynamicContentFile.php");
$mailcontent = ob_get_contents();
ob_end_clean();
That said, it should be possible to define all the "rendering" options in the external PHP file, what would mean to apply the nl2br function there, e.g.: nl2br($row_queryname['columnname'])
What I´m not sue about is, if you will have to strip the external file´s head and body tags before it´s getting included -- however, please give this a try and tell us how it worked.
Cheers,
Günter Schenk
Adobe Community Expert, Dreamweaver -
I've got several html pages that I made to use SSI's. The code would go like:
<div class="footer">
<!--#include file="../ssi/footer.html" -->
<div class="clr"></div>
But when I preview the page on the server, it's not showing the code. If I bypass the SSI and paste the html code in directly it shows.
I'm sure the path is correct. I can browse to it and I've also tried putting in the whole url just incase DW's Insert messed up.
Inserting SSI's works fine with php files, but when I try it in htm files I can't get it to work.
Is there something I'm doing wrong?Also, change this
<!--#include file="../ssi/footer.html" -->
to this:
<!--#include virtual="../ssi/footer.html" -->
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
http://alt-web.com/
http://twitter.com/altweb
Maybe you are looking for
-
How to see multilanguage data in web forms9i
Hai Everybody I have installed 9i Developer Suite & 9i database in the same machine our application has to display multilanguage data like malay,chinese and english. our database is Parameters are as follows PARAMETER VALUE NLS_LANGUAGE
-
How to clean database tables after testing?
Hello, All ! I'm beginer in eCATT. I have a simple question. My test run some transaction. It put record into database table. I need check some fields of this record. I want run this test avery day. How I can remove record automaticly? It's important
-
Executing SQL command in OMB PLUS
How can we execute sqlplus commands in OMB PLus command prompt ?
-
As much as it seems like Verizon never adds HD, I wanted to check to see how many channels I could find that were added this year. In no particular order, I thought of- 4 more NBA/MLS channels 4 more MLB/NHL channels Cartoon Network HD BBC America HD
-
Upcoming Events in sidebar not reflecting correct time
I create an event on my wiki/group calendar. It shows up on the sidebar under Upcoming Events. When I place my cursor over the item listed under Upcoming Events, everything is correct except the time. The time is about 2-3 hours off. Any ideas? Thank