Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rich Text Box and Report "Previewing"

Status
Not open for further replies.

almm

Programmer
Oct 21, 1999
7
US
Hello all!<br>
<br>
I am attempting to write a very simple program. I have a list box filled with report names. If the user single clicks on one of these, I would like to give them a &quot;preview&quot; of the report in a rich text box. The full report is a Crystal report, which I have run a portion of and exported the results to an .rtf file. If I pull up the .rtf file in Word, it looks fine, but when it shows up in VB, all the headings are left justified, one on top of the other, and most of the data out to the right is gone. My code to fill the rich text box is:<br>
<br>
rtbRptSample.LoadFile rptsample <br>
<br>
where rptsample is the .rtf file name. Would the CRViewer work better for this? Keep in mind, I don't want to have to &quot;run'' the report in order to get the preview. Also, some of the reports are portrait and some are landscape (in case this makes a difference). I do have the scroll bars set to both for the rich text box.<br>
<br>
Many thanks in advance!!<br>
Michelle
 
I had a similar issue when my users exported reports to Excel. The column headers would get out of sync with the data.<br>
<br>
I corrected this problem by placing &quot;dummy&quot; text fields in the report to keep the spacing correct that everything stayed lined-up. This &quot;dummy&quot; text fields have to have at least a single space in them to work. The key is to have a field for each area of the report that you want to stay lined up.<br>
<br>
Maybe this approach will help solve your reports alignment problems as well. <p>Bruce Voelp<br><a href=mailto:bvoelp@if.rmci.net>bvoelp@if.rmci.net</a><br><a href= > </a><br>Earn AS in 1976 and BS in 1986. Learn to talk with computers when the only interface was 80 column punch cards, and paper tape.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top