Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

User inputted letters with dynamic fields in Report Builder

New Here ,
Jul 17, 2009 Jul 17, 2009

I'm proactively trying to get certain aspects off our hands in IT and more specifically, the way letters are generated through ColdFusion.  Right now we are using activeX controls (with some vbscript and asp pages) through IE to do Word mail merges for letter's for our students.  We would like the user to be able to change these letters by themselves through our web application and have them saved in our database so they can be stored as a future template.

Now I'm new to Report Builder and have a few examples to show my colleagues, but I'm having troubles being able to dynamically insert the student's name (for example) into the report.

So basically I have an empty template with a huge dynamic box for the text which reads #param.MessageBody# that comes from a textarea within the cfm page.  That works, but taking it one step further, I want to replace all instances of "%%StudentName%%" within that MessageBody with the actual student's name.

Since I cannot loop over the report and do my usual ReplaceNoCase(lMessageBody, "%%StudentName%%", Trim(ReportQueryLetters.StudentName), "ALL")>, how can I put this into a built-in function into the report?

I figured the function needs to be in <cffunction name="BeforeExport"> and while a simple display of the message works perfectly, I cannot get my replace line to work.  I am passing the query to Report Builder instead of having it built-in, is that my problem?!  I would prefer if it was external to save my stored procedures if I can.  Is there any way to call the query to get that line to work?!

The code inside the cffunction (in report Builder):

<cfargument name="lTextArea">

<cfset lTextArea = #form.frmTextArea#>
<cfset lTextArea = ReplaceNoCase(lTextArea, "%%StudentName%%", Trim(ReportQueryLetters.StudentName), "ALL")>

<cfreturn lTextArea>

The error:

Element STUDENTNAME is undefined in REPORTQUERYLETTERS.           

TOPICS
Reporting
1.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 22, 2009 Jul 22, 2009
LATEST

Sorry for the late reply, just got back from vacation.

I don't think you use ReportQueryLetters for the query. it should be

query.StudentName

Also, you can have an intermediate step on the page that receives the

MessageBody and change the MessageBody before passing it as a parameter to the

report.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources