Solved

crystal report 8.5 or 9 in vb6

Posted on 2003-11-14
4
416 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 100

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 100

Accepted Solution

by:
mlmcc earned 50 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 100

Expert Comment

by:mlmcc
ID: 10198349
Glad I could help

mlmcc
0

Featured Post

Technology Partners: 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

Suggested Solutions

Title # Comments Views Activity
draw a Christmas tree by using a nested loop? 26 106
Hive vs Impla in Hadoop 1 151
Getting Variable not defined error in Python 1 82
Looking for reading material 2 45
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

751 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