ReportSharpShooter filling in forms - working with templates


Author
Message
Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
I need to fill in fields in Word doc templates to be printed/pdf with ReportSharpshooter. I'm trying to get a handle on it conceptually - at what part of the process does the insert happen? Do I first desiign a RSS report with an RTF field and data fields as inserted into the RTF? How do you handle places where there might be multiple lines of data (this is insurance policies and at some points there will be lists of things appearing on the policy)



Is there a particular place in the docs or samples I should be looking? Anyone have a RSS report as a sample I could look at?



Thanks



Charles





Any guidance to get me started will probably save me a lot of time and will be greatly appreciated. I am still somewhat of a novice with RSS.

Trent Taylor
Trent Taylor
StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Charles,

I guess I am a little confused.  You are replacing Word templates, is that correct?  We have done the same thing and created our own little data dictionary so that data can be inserted into the report.  This would include such things as he/she, patient names, addresses, etc.

RSS has a control called AdvancedText (I think that is what it is called). Anyway, it is a hybrid HTML/RTF solution.  However, their most recent build (4.1 [again I think]) has fixed their RTF issues and now supports page breaks correctly, etc.  So you can use RTF.

No here is the kicker that requires a bit of work, you will have to create a class that RegEx's out your keys and replaces them.  This requires a little bit of work to make it line up with their AdvancedText control and will in RTF also as there will be some special tags in the RTF versus being able to do a straight replace.  Not the end of the world, but just a heads up.  We then have a section of our report engine that is called Letters and Labels that allows the customer to modify the text, insert pre-built dictionary items, etc.

Here is a screen shot of our screen that allows the text to be maintained.

We use the « and » characters to represent a dictionary item.  Next, is the RSS template.  Here is what it looks like for this particular report. If you notice, in this report, we have two checks above for the body texts.  This means that we will have two AdvancedTextBoxes on the report template since the text needed to be physically separated but there was no real way to do this inline in one RTF field.

Note: Notice that only the alignment, bold, italics, underline, and font name can be selected.  This is all that was really supported well within the AdvancedTextBox control.

In the above picture, you can see a 1 and a 2 (I have attached the image for a better view).  The 1 is where the Body Text 1 will print from the previous screen shot, and the 2 is where the Body Text 2 will print from the second shot.

This is how we replaced all of our Word document templates that we used in our previous VFP version with RSS.

Hope this helps!

Attachments
Screen2.png (140 views, 21.00 KB)
Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
Trent -



Thanks very much for the thoughtful reply. I will study this.



My first thought was to store the RTF of the Word doc as data, do all of my substitutions replacing delimited markers in that data field, and then use the data field as a source for an advanced text control i.e. RSS would see the prechewed result as the RTF info to go in the report



I do not plan to give the users any modification options for the report, other than they are producing the policy data that determines what gets filled in. the Template could be modified if the wording changed, but the number and naming of the fields to be substituted would be fixed.



Is this what you mean by RegExing out the placeholders or are you talking about a script that runs withing RSS?



I had thought about creating the basic RSS report as Header/style info ( company logos, perhaps some unchanged boilerplate etc ) and then a body that was one big Advanced Textbox ( which would receive the RTF as data that already had the substitutions done)



Am I close here or do you see a problem with that ( again, apologies as I am at the beginning stages of my RSS learning curve and so I may be mumbling gibberish on this Smile )



I'm basically thinking of this as if I were doing a VFP textmerge on the memo field and then feeding the memofield to a report - but with RTF instead of plain text







Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
On further studying your example I think it is coming into focus. It would seem those body text boxes could contain RTF with substitutions done within the framework of an RSS template with fixed items.



I think this is going to give me a starting point.



Trent Taylor
Trent Taylor
StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Yup, you got it. That is exactly what we are doing. Let me know if you have any questions. Smile
Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
just one other quick question - if I want to chop up my Word doc into RTF chunks and store them as data in varchar(max) fields ( or do I want vbinary? ) can I put them in as cut and paste to RTF textboxes bound to the SQL data or ???



Trent Taylor
Trent Taylor
StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Actually you will want to use NVarChar(MAX). This will support the unicode characters that may be entered at some point. This would be the safest road to travel. Your needs may be no greater than doing just as you mentioned and binding the SQL data to the RTF controls. If that meets your need then I would say go for it!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search