Focal Point
CREATING DYNAMIC SUBJECT LINE FR E-MAIL DISTRIBUTION

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9271033791

November 19, 2006, 06:17 PM
chelsea
CREATING DYNAMIC SUBJECT LINE FR E-MAIL DISTRIBUTION
Hi,
can someone give me an example of how to create a subject line dynamically.i want to display the parameters that i pass to the report in my subject line.
Thanks
November 20, 2006, 11:53 AM
BlueZone
Good Morning Chelsea :
Are you talking about email distribution via Report Caster ?

Please also update your signature to show your platform / WF release etc. It always helps when people try to answer your Q.

Thanks,
Sandeep M.


-------------------------------------------------------------------------------------------------
Blue Cross & Blue Shield of MS
WF.76-10 on (WS2003 + WebSphere) / EDA on z/OS + DB2 + MS-SQL
MRE, BID, Dev. Studio, Self-Service apps & a dash of fun !! Music
November 20, 2006, 12:11 PM
BlueZone
Chelsea,
Please also look at this previous forum entry on the same topic -

Linky

Hope that helps,
Sandeep M.


-------------------------------------------------------------------------------------------------
Blue Cross & Blue Shield of MS
WF.76-10 on (WS2003 + WebSphere) / EDA on z/OS + DB2 + MS-SQL
MRE, BID, Dev. Studio, Self-Service apps & a dash of fun !! Music
November 20, 2006, 02:44 PM
chelsea
Hi BlueZone,
i tried the example that is there in the report-caster help and it worked when i assigned the parameter and the value in the advanced tab of the task option of the schedule and usedit in the subject line .what i want to see is if there is a way that we specify the parameter in the subject line and it takes the value of the parameter from the report rather then specifying the valued in the advanced option of reportcaster.
Thanks
December 05, 2006, 11:50 AM
chelsea
HI,
any ideas on how this can be done
thanks
kumar
December 05, 2006, 12:14 PM
<RickW>
You may be able to do something with the RC API - maybe setMailSubject(String)function but that's probably not what your looking for since it's a bit complex.
December 05, 2006, 01:56 PM
Prarie
Sounds like a new feature request.


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
I am trying to do have a subject line say: REPORT XX (followed by the current date).
I tried REPORT XX '&DATE' in the subject line but did not see the date appear in the actual subject line. Instead, I saw 'REPORT XX' and in the log i saw it say unknown parameter DATE.
Must I specify elsewhere this parm? How/where?

Thanks, Ira
wf 536 AIX533


aix-533,websphere 5.1.1,apache-2.0,
wf 538(d), 537 (p),
==============
7.6.11 (t) aix 5312
websphere 6.1.19
apache 2.0
I checked on this once. It is not supported.

Someone may have already requested and NFR (New Feature Request) but it doesn't hurt to give IBI more ammunition. So I would suggest that you open a case.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
GinnyJakes - Thanks, I had opened up a case. I was wondering what do you think of this as a workaround (dare I say that?)

table &DATE to save file - read it back in to an &&variable. include that condition in a where clause somehow. Would subject line then recognize that &&? Not totally thought out yet as you can see - just a thought...


Ira
AIX 533 wf 5.3.6 (dev) 5.3.3 (prod) 7.6.1 (test)


aix-533,websphere 5.1.1,apache-2.0,
wf 538(d), 537 (p),
==============
7.6.11 (t) aix 5312
websphere 6.1.19
apache 2.0
I don't think that will work. Please see a very similar thread and Gerry's comments about what is allowed and not allowed. According to Gerry, the variable has to be in Report Caster, i.e. specified in the Advanced tab of the task.

https://forums.informationbuilders.com/eve/forums/a/tpc/...1057331/m/5351054062


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
why not build a quick jsp to do a one time submission and set the subject line as you see fit.

Simple Example (/rcaster/custom/scheduleExample.jsp) -- sorry, there was a wee typo:
<%-- $Revision: 1.2 $: --%>
<%@ page language="java" import="ibi.broker.beans.*,ibi.broker.beans.handler.*,java.util.*,java.text.*" %>
<jsp:useBean id="schedFact" scope="request" class="ibi.broker.beans.DSTSchedFactory" />
<%

     /* 
      *  Expected parameters to be passed:
      *
      *  emailFrom = User email who processed the merchandise request.
      *  emailTo   = User who initialiated the merchandise request.
      *  merchId   = Unique merchandise request id.
      *  random    = Random number passed from the calling process.
      *
      */
		Date now = new Date();
		SimpleDateFormat formatter = new SimpleDateFormat( "yyyyMMdd" );
		
		DSTAuthenticate auth = new DSTAuthenticate();

                // expected parameters.
		String emailFrom = request.getParameter("emailFrom");
		String emailTo = request.getParameter("emailTo");
		String country = request.getParameter("COUNTRY");
                String car = request.getParameter("CAR");

		auth.setUser("admin");
		auth.setPass("");
		auth.setAgentProperty("localhost:8200");
		
		// build subject line with passed parms
		String emailSubject = "*** Some Description: Country: " + country + " Car: " + car + " ***"; 
		String interval = "O";
		String startdate = formatter.format(now);
		String starttime = "0600";
		String fex = "merchandise_request_confirmation";
		String[] parNames = {"COUNTRY","CAR"};
		String[] parValues = { country, car };

		schedFact.setAuthenticate(auth);

		schedFact.setIBIB_casteruser("admin");    
		schedFact.setIBIB_jobdesc("*** Some Description.  This will be deleted anyway ***");                            	
		schedFact.setIBIB_active("Y");                                    	
		schedFact.setIBIB_priority("3");                                  	

		schedFact.setIBIB_interval(interval); //Run Once   	
		schedFact.setIBIB_startdate(startdate);                            	
		schedFact.setIBIB_starttime(starttime);                                	
		schedFact.setIBIB_listtype(DSTSchedFactory.ADDRESSTYPE_SINGLEADDRESS); //send to one address	
		schedFact.setIBIB_distlist(emailTo); // access list name    	
		schedFact.setIBIB_method(DSTSchedFactory.METHOD_MAIL);   
		schedFact.setIBIB_mailfrom(emailFrom);
		schedFact.setIBIB_mailuser(emailFrom);
		schedFact.setIBIB_mailsubject(emailSubject);
		schedFact.setIBIB_asvalue("sent.htm");
		schedFact.setIBIB_mulpart("N");

		// notification 
		schedFact.setIBIB_notifyflag(DSTSchedFactory.NOTIFYFLAG_INACTIVE);  	
		schedFact.setIBIB_tasktype(DSTSchedFactory.TASKTYPE_EDA_FOCEXEC); 
		schedFact.setIBIB_servername("EDASERVE");
		schedFact.setIBIB_taskobj(fex); //URL being Schedled
		schedFact.setIBIB_execid("server-userid");
		schedFact.setIBIB_execpass("server-password");
		schedFact.setIBIB_sendformat(DSTSchedFactory.SENDFORMAT_HTML);

		schedFact.setIBIB_paramname(parNames);
		schedFact.setIBIB_paramvalue(parValues);

		schedFact.setIBIB_servername("EDASERVE");  
		
		// delete the job after execution.
		schedFact.setIBIB_deletejob("Y");

		DSTBeanHandler h = schedFact.getCreateScheduleHandler();
		h.processRequest();
		DSTAPIStatus status = h.getAPIStatus();
		int code = status.getErrorCode();
		if(code != DSTAPIStatus.NO_ERROR) {
			out.println("Code = " + code + "; Message = " + status.getErrorMessage());
			return;

		}

		DSTBeanResult result = h.getBeanResult();
		Vector xml = result.getXML();		
		String sid = null;
		String stag = "<IBIB_scheduleid>";
		String etag = "</IBIB_scheduleid>";
		for(int i = 0; i < xml.size(); i++) {
			String temp = (String)xml.elementAt(i);			
			int index = temp.indexOf(stag);
			if(index != -1) {
				int end = temp.indexOf(etag);
				sid = temp.substring(index + stag.length(), end);
				break;
			}
		}
		out.println("Schedule ID = " + sid);
	
%>
<html>
     <head>
     </head>
     <body>
          <h2>Some Confirmation message.</h2>
     </body>
</html>  


Call with:
  
http://server:port/rcaster/custom/scheduleExample.jsp?e...TRY=JAPAN&CAR=DATSON

This message has been edited. Last edited by: dhagen,


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
Hi Dhagen,
This is nice, the first time I see an example of this functionality.
This can be a good start to do something like this where we need a looping for a rather complex report where burst does not work.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

Dhagen, I gotta check it out. This is good! Thanks. GinnyJakes and all other helpful ones - thank you. IBI has an NFR put in place. In the interim their official line is HTTP://TECHSUPPORT.INFORMATIONBUILDERS.COM/SPS/93411036.HTML (see the solution section)...


aix-533,websphere 5.1.1,apache-2.0,
wf 538(d), 537 (p),
==============
7.6.11 (t) aix 5312
websphere 6.1.19
apache 2.0
Ira

there is a little typo in your hyperlink, it looks ok, but it is not.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

[URL=HTTP://TECHSUPPORT.INFORMATIONBUILDERS.COM/SPS/93411036.HTML]

Frank, you are absolutely correct. The link actually appeared as 'infromation' instead of 'information' . Try it now...


aix-533,websphere 5.1.1,apache-2.0,
wf 538(d), 537 (p),
==============
7.6.11 (t) aix 5312
websphere 6.1.19
apache 2.0
Dhagen,

This is good stuff. I was easily able to set this up with your example.

Much better than DSTRUN.

Cheers,

Francis.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
Dhagen,

Where is this JSP stuff documented?

I searched for "setIBIB_sendformat" on the IBI Tech Support site and the only document displayed wasDSTSchedFactory for WebFOCUS 4.3.

Thanks,


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
Francis,

Go here:

http://documentation.informationbuilders.com/masterindex/webfocus_53.asp

Look under the API section.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
Mickey,

Thank you. I have the API document. I have to say it is quite useless! It provides detailed Java syntax but very poor examples.

I cannot find the text "SENDFORMAT_HTML" anywhere on IBI.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server