Solved

crystal report 8.5 or 9 in vb6

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
A short article about problems I had with the new location API and permissions in Marshmallow
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

839 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