Focal Point
[CLOSED] Import field value for reporting

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

June 30, 2010, 10:00 AM
Sayed
[CLOSED] Import field value for reporting
Hello,

My application currently takes in upto 270~ job id's on a text field (the limitation is because the text area can only have 4095 characters). The job id's are seperated by comma. I'd like to enhance the future so that users are able to import in a csv file full of job id's instead of having to type them on the text box. Keep in mind, multiple users can run this report simultaneously and may overwrite each others file if storing the imported file on the server. Logic needs to be built in for that. Also, I have no way of knowing who is currently running the report because we run all our reports using a generic id.

I saw an import future for version 767+, where users are able to import in a excel file, but that seems to work only with reporting objects. All our reports run from the server, nothing from MRE. We are in version 768 here. Any suggestions would be greatly appreciated.

Thanks,
Sayed

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


WF 8.x and 7.7.x Win/UNIX/AS400, MRE/Portal/Self-Service, IIS/Tomcat, WebSphere, IWA, Realmdriver, Active Directory, Oracle, SQLServer, DB2, MySQL, JD Edwards, E-BIZ, SAP BW, R/3, ECC, ESSBASE
June 30, 2010, 06:18 PM
Waz
How are you submitting this job, is this from a web page, and how is the form being submitted.

I just did a quick test, and found that I can pass much more than 4095 chars from a text area via Method POST.

I gave up at over 12k chars.

These are my test files...

Launch Page
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
 <head>
  <title> New Document </title>
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
 </head>

 <body>
  <form method=post action="http://localhost:8080/ibi_apps/WFServlet">
	<input type="hidden" name="IBIF_ex" value="chartest">
	<input type="hidden" name="IBIAPP_app" value="testing">
	<input type="submit">
	<br>
	<textarea name="lentest" rows="40" cols="160">12345678901234567890123456789012345678901234567890123456789012345678901234567890</textarea>
  </form>
 </body>
</html>


Fex:
-TYPE &lentest.LENGTH
-TYPE &lentest


Give it a go and see if it passes lots for you.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

June 30, 2010, 08:16 PM
Dan Satchell
On your job ID input page, you could request user initials or some other identification that would be unique to each user. Then use that information to create a uniquely named CVS (or other type) file in a special APP folder on your server.


WebFOCUS 7.7.05
July 01, 2010, 02:22 AM
Tony A
No need to get the user to input their initials, just use AJAX to get their userid - especially as the user has already had to login using their credentials. Use the URL http://[your server]/ibi_apps/WFServlet?IBIMR_action=MR_GET_DOMAINS&IBIMR_returntype=xml and then use a pattern of //CURRENT_USER to get the user id. Finally pass the value to a hidden variable so that it is included in the form execution URL.

Please note: I just know that some of you are going to cut and paste the above URL (with the server changed) to test it. This may give you an error code of 1032 because you're not logged into MRE.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
July 01, 2010, 01:33 PM
Sayed
Thanks for all your inputs. The form was built using Developer studio.

Reference: Usage Notes for STRREP Function
The maximum string length is 4095.

I use STRREP to get 'Job ID1' 'OR' 'Job ID2' 'OR' 'Job ID3' for mat before passing it to WHERE CLAUSE.


Thanks,
Sayed

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


WF 8.x and 7.7.x Win/UNIX/AS400, MRE/Portal/Self-Service, IIS/Tomcat, WebSphere, IWA, Realmdriver, Active Directory, Oracle, SQLServer, DB2, MySQL, JD Edwards, E-BIZ, SAP BW, R/3, ECC, ESSBASE
July 01, 2010, 05:46 PM
Waz
There are other ways to build the where clause.

For example, writing the variable to a file, Reading it with a TABLE connad and preparing the where clause or building a file that can be used in a JOIN.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

July 06, 2010, 05:04 PM
Sayed
Tony,

Users are not logging into MRE. All reports are run from the server. Users will log into our website but that credential do not get passed to WebFOCUS. WF client passes a generic userid/passd to Reporting server to run all reports.

Thanks,
Sayed


WF 8.x and 7.7.x Win/UNIX/AS400, MRE/Portal/Self-Service, IIS/Tomcat, WebSphere, IWA, Realmdriver, Active Directory, Oracle, SQLServer, DB2, MySQL, JD Edwards, E-BIZ, SAP BW, R/3, ECC, ESSBASE
July 07, 2010, 01:55 AM
Tony A
quote:
WF client passes a generic userid/passd to Reporting server to run all reports
Well that explains why you wont be able to use that then! How about capturing their IP address - unless you have dynamic IP addressing and they shut down inbetween entry and usage!

If you get the data entry into a file that you could use in MATCH -
MATCH FILE [user data file]
BY JOBID
RUN
FILE [your data file]
PRINT/SUM etc. ......
BY JOBID
AFTER MATCH HOLD AS ..... OLD
END

... should allow you to have a large number of JOBID entries by your end user.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
July 07, 2010, 04:02 AM
<JG>
Parse the input variable into a file and use WHERE IN FILE

 
FILEDEF XNCFILE DISK XNCFILE.FEX (APPEND
-RUN
-SET &INCFILE= '2,4,5';
-SET &CNTR=(&INCFILE.LENGTH / 2)+1;
-SET &TOKEN=0;
-REPEAT ENDREPEAT &CNTR TIMES

-SET &TOKEN=&TOKEN + 1;
-SET &VAR=GETTOK('&INCFILE.EVAL', &INCFILE.LENGTH, &TOKEN, ',',20, 'A20');
-WRITE XNCFILE &VAR
-ENDREPEAT
-RUN
TABLE FILE CAR
PRINT MODEL SEATS
WHERE SEATS IN FILE XNCFILE
END
 

July 07, 2010, 09:07 AM
linus
You can obtain the actual user id with the following:
-SET &UID = CNCTUSR('A8');
this gives you the id the user connects with, such as 'jsmith'

-SET &GUID = GETUSER('A8'); will give you the user id used to run the report,whatever you're using for your generic id -- ours is 'eda'.


WF 7.7.05
HP-UX - Reporting Server, Windows 2008 - Client, MSSQL 2008, FOCUS Databases, Flat Files
HTML, Excel, PDF
July 20, 2010, 11:19 AM
dhagen
Seems like too much work to me. Push the stuff up to the foccache diretory to avoid file contention, and to retain it for subsequent requests. Then invoke something like:
<html>
<head>
	<title>Upload and execute</title>
	<script type="text/JavaScript">
				
		var $ = function(_id) {
			return document.getElementById(_id);
		};
		
		var wfApp = {
			runFex: function() {
				$('rand').value = Math.floor(Math.random()*1001);
				$('ibif_adhocfex').value = 
					"EX -LINES " + 
					((($('txtArea').value.replace(/\s+$/g,"")).split("\n")).length + 1).toString() + 
					" EDAPUT TXT,FOCCACHE/FILE,CV,FILE\n" +
					$('txtArea').value +
					"\n-INCLUDE somereportname";
				$('myForm').submit();
			}
		};
		
	</script>
</head>
<body>
	<table>
		<tr>
			<td>
				<form id="myForm" method="get" action="/ibi_apps/WFServlet" target="_blank">
					<input type="hidden" name="IBIF_adhocfex" id="ibif_adhocfex" />
					<input type="hidden" id="rand" name="rand" />
				</form>
				<textarea name="txtArea" id="txtArea" cols="60" rows="8"></textarea>
			</td>
			<td>
				<input type="button" style="width: 120px;" id="sub-button" value="Run It" onClick="wfApp.runFex();" />
			</td>
		</tr>
	</table>
</body>
</html>  



"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott