Solved

crystal report 8.5 or 9 in vb6

Posted on 2003-11-14
4
412 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
  • 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

A short article about problems I had with the new location API and permissions in Marshmallow
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

679 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