Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

crystal report 8.5 or 9 in vb6

Posted on 2003-11-14
4
Medium Priority
?
425 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 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Loops Section Overview

926 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