Skip to Content
Former Member
Mar 30, 2011 at 04:05 PM

WebElements - Using Text Area to add notes


I am trying to use the WETextArea & WESubmit to allow a user to add notes to a notes table in my SQL Sever DB.

I have gone through the forums & user doc and thought I had all the bases covered, but I can't get it to work.

Ideally, the user will enter a text note and when they hit submit, the user's ID, the note text, a datestamp will be inserted into the table.

I have a crystal report (add_notes_rpt) with a command object that is simply this




The sole prompt in the report is named NOTE - the report works as expected; when I run it standalone, I am prompted for the NOTE value and once I provide it, a row is added to the table.

Onto my Main Report: I have a formula that lays out the TextArea and Submit button (I cloned code Jamie posted in another post)

stringvar moreParams:= "drilldowntabs=hide&toolbar=hide&sReportMode=weblayout";

stringvar addpath:=WETargetPath ("rpt","CUID" ,{@CUID_add_notes},moreParams);

stringvar allelements :=

WETextArea ("NOTE", ElementDefault, ElementHeight, ElementWidth, Font,Validation, ValidationMessage) +

WEBreak(1) +

WESubmit("noteadd", "Button", " Add Note",WETargetPath ("rpt","CUID" ,{@CUID_add_notes},moreParams),font );

allelements + WEBuilder(allelements,3);

When I run my Main Report, the text area and submit button display beautifully. But, after entering a note and hitting the submit button, I am presented with the parameter prompt from my add_notes_rpt. (parameter name is NOTE)

The documentation indicates that naming the TextArea the same as the report parameter will cause the prompt to be satisified automatically with the text from the TextArea element, but it's clearly not happening. I've tried naming the TextArea as "?NOTE" and that doesn't work. I've tried embedding the WETargetPath statement in the WESubmit function call (instead of using a variab le).

Any ideas? I'm sure I'm missing something elementary...

Once I figure THIS out, the other goal is to pass a 2nd parameter (empl_ID) into the add_notes_rpt crystal report. Right now, to debug this issue, I am hardcoding the empl_ID into the command object script so that I only have ONE parameter to fulfill, but ultimately the Main Report will have a formula that contains the emp_id and I'd like to pass it into the add_notes_rpt in addition to passing in the Notes text. Assuming that the TextArea object will fulfill the NOTE paramenter, will I only have to code the 2nd parameter into the TargetPath function call?

stringvar moreParams :="lsSEMPLID="+

thanks in advance for the help! !