Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

crystal report 8.5 or 9 in vb6

Posted on 2003-11-14
4
Medium Priority
?
421 Views
Last Modified: 2010-04-17
I need help. I am trying to see how I can change a certain text object on a crystal report file that I have during run-time

I am using vb6 and 8.5 or 9 would be great.


I want to change the value of the textobject to "people" to "City"


how can this be done????
0
Comment
Question by:bman9111
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 9752382
To the best of my knowledge text fields are read only from a VB application.

You can however change formulas or use parameters.

How are you calling the report now?

mlmcc
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 150 total points
ID: 9752385
0
 
LVL 3

Expert Comment

by:saracoglu
ID: 9797977
Assuming that the textobject is called Text1, you can pu the following line to the code pane of the embedded crystal report object:

Private Sub Report_Initialize()
    if x = 1 then
        Me.Text1.Text = "something"
    else
        Me.Text1.Text = "something else"
End Sub

If you want to change the text in a non-embedded crystal report, design the report in a way that you use a formula-field instead of the text object, and place this where the text object should be placed. Then, while you are calling the external crystal report, you change the value of this formula, and the text is changed as appropriate:

    Set CrystApp = CreateObject("Crystal.CRPE.Application")
    Set CrystReport = CrystApp.OpenReport("Your_Template_FileName")
    CrystReport.FormulaFields("{@000_FirstPageNumber}").Text = "something"
    CrystReport.ReadRecords

    Set CrystView = CrystReport.Preview
    If Print_output Then
         CrystView.PrintOut
    else
         CrystView.ShowFirstPage
    end if


hope this helps,

Alper
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 10198349
Glad I could help

mlmcc
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
Simple Linear Regression
Introduction to Processes

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question