Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




How To Change DSN For Crystal Reports


I have generated various reports using Crystal Reports 7.0. Now, without changing the design and the fields for the reports, I want to change the DSN, so that I can access another similar database.Can I change the DSN without re-designing the crystal reports. Any suggestions are welcome.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Change The Database Location In Crystal Reports Sub Reports From VB During Runtime
I have several reports that were designed in Crystal Reports that have the DB location changed during runtime. When I move my database, or choose another copy of the DB that has a lot of records in it, my reports don't fire. I need to be able to Verify the database during runtime. I'm usiung VB6.0 and CrystalReports8.5 I've tried using Crystal's "Verify On Every Print" function, but I haven't had any luck. Here is the code I am using.

MyLocation = "C:mydatabase.mdb"
CRPE321.ReportFileName = "c:aptcom
eports eninfo.rpt"
CRPE321.DataFiles(0) = MyLocation
CRPE321.ParameterFields(0) = "ThisKey;" & Who.Text & ";true"
CRPE321.PrintReport

Also, does anyone know if changing the DataFiles location during runtime also effects the subreports. I don't think it does, but any input would be appreciative.

Change The Database Location In Crystal Reports Sub Reports From VB During Runtime
I've created a Report Viewer that displays Crystal Reports 8.5 reports. I have the DB location in Crystal Reports changed during runtime, but I can't get the location to change in the subreports at runtime as well. Also, by using my method of calling the reports, I can't get VB to pass any parameters to the Main report. Below is the code that I am using. I'm using VB 6.0 and CR 8.5

Dim MyNewKey
MyNewKey = Who.Text

' On Error GoTo KeepGoing

MyLocation = GetStringValue("HKEY_LOCAL_MACHINESoftwareAptCom", "AptCom DB Path")
strReportFile = "c:aptcom
eports eninfo.rpt"

Set CRReport = New CRAXDRT.Report
Set CrxApp = CreateObject("crystalruntime.application")
Set CRReport = CrxApp.OpenReport(strReportFile)
' Set CRReport.ParameterFields(0) = "ThisKey;" & MyNewKey & ";true"

' KeepGoing:

For Each dbTable In CRReport.Database.Tables
dbTable.SetLogOnInfo "", MyLocation, "", ""
dbTable.Location = MyLocation
dbTable.SetDataSource MyLocation
Next dbTable
CRReport.Database.Verify


CRReport.SQLQueryString = strSQL

frmReportViewer.Show
frmReportViewer.CRViewer1.ReportSource = CRReport
frmReportViewer.CRViewer1.ViewReport

Set CRReport = Nothing
Set CrxApp = Nothing
Set CRReport = Nothing

>>>>
I've tried using this method:

MyLocation = "C:mydatabase.mdb"
CRPE321.ReportFileName = "c:aptcom
eports eninfo.rpt"
CRPE321.DataFiles(0) = MyLocation
CRPE321.ParameterFields(0) = "ThisKey;" & Who.Text & ";true"
CRPE321.PrintReport

But, I can't get Crystal Reports to verify the database during runtime. The first way verifies the DB, but won't change the DB location of the subreports or pass parameters to the reports.

Any help would be appriciative.

Crystal Reports (Change Server In RPT)
I have a serious problem when i change the name of my SQL Server.
The RPT's files open, but always ask the server name and password for logon.
And always they bring the name of the old SQL Server

How can i change in definitive the RPT File for New SQL Server Name.

I appreciate for any help

Crystal Reports Datasource Change
Hi folks,

Thanks to MKoslof yesterday, I managed to set up my application to view all reports through one CRViewer (Thanx again),

Today, I am trying to change the datasource of a report so that I do not need a different report for each query that displays the same fields.

The code I am using is:


Code:
Dim application As New CRAXDRT.application
Dim selectedreport As String
Dim CurrentRpt As CRAXDRT.Report

selectedreport = App.Path & "
eport1.rpt"
Set CurrentRpt = application.OpenReport(selectedreport)
'ShowReport
CurrentRpt.Database.SetDataSource DE_Test.rsByName

With Frm_ReportViewer
.Show
'code below courtesy of MKoslof
Screen.MousePointer = vbHourglass
.CRV_Report.ReportSource = CurrentRpt
.CRV_Report.ViewReport
.CRV_Report.Zoom 100
Screen.MousePointer = vbDefault
End With
The problem is that the data in the report displays the original and not the changed recordset. Can anyone help?

Change Group In Crystal Reports
Can someone help me change the grouping in my crystal report through VB code? I want the user to choose either Group by Name or Group by Date from the VB interface and the report is printed with the selected grouping...

I found this on the forum but it doesn't work for me. It doesn't get into the For loop because CRReport.RecordSortFields.Count is returning 0:


Code:
Private Sub Change_Group(NewSortFieldName As String)

Dim SortField As CRAXDRT.SortField
Dim NewSortfld As CRAXDRT.SortField

Dim crxApp As CRAXDRT.Application
Set crxApp = New CRAXDRT.Application

Set crxApp = New CRAXDRT.Application

Dim CRReport As CRAXDRT.Report

Set CRReport = crxApp.OpenReport(App.Path & Report_Name, 1)

For Each SortField In CRReport.RecordSortFields

If NewSortFieldName = SortField.Field.Name Then

Set NewSortfld = SortField
Set SortField = CRReport.RecordSortFields(1)
SortField.Field = NewSortfld.Field
CRReport.Areas.Item("GH").GroupConditionField = SortField.Field

If SortOrder = "Ascending" Then
'SortField.SortDirection = crAscendingOrder
CRReport.Areas.Item("GH").SortDirection = crAscendingOrder
Else
'SortField.SortDirection = crDescendingOrder
CRReport.Areas.Item("GH").SortDirection = crDescendingOrder
End If

Exit For
End If
Next

End Sub

VB 6/Crystal Reports 9 - Change DB At Runtime?
I'm using the Crystal Reports 9 ActiveX Designer Runtime Library to view and print existing Crystal Reports in a VB6 application connecting to a SQL2000 database. Is there any way to change the database used by the report at runtime? I need to be able to switch between reporting against identical databases on different servers.

I've been trying to use the LogOnServer & LogOnServerEx methods of the report's CRAXDRT.Database object, but I've been getting an OLE DB error with description: "Data source name not found and no default driver specified". I'm not even sure that this is the correct approach, as the Crystal developer help states, "This method can be invoked only in formatting Idle mode", and I can't seem to find out what exactly "formatting Idle" mode is. I'm inclined to think that these methods aren't really what I want, but the Crystal documentation is less than wonderful, and I can't find anything helpful on their website.

Thanks in advance!



Edited by - kconklin on 11/21/2003 11:43:40 AM

Change The Ttx File In Crystal Reports From VB
How can I through VB point a ttx file to a newly created crystal report and then
set a ado datasource to that report. All of this must be done from VB.
I am using SQL 2000, Crystal reports 8.5 and VB6


 

Crystal Reports - Database Change
How can I change the database of a report in run-time from VB. I use ODBC to access a SQL Server database. I change the database source of ODBC but the report query the initial database.
Thanks.

Can You Change Login Details On Crystal Reports?!!!
I am using VB6, MS SQL SERVER 7 and Crystal Reports 5

Here's my problem:

All the reports designed in CR5 use a username that is not password protected. I need to lock down this username with a password, but no reports generate once the password is put on. I have tried using the 'connect' property of the crystal report control but that doesn't seem to work either!

Does anyone have any thoughts on this?

How To Change Mail Labels In Crystal Reports
Hai,
I create a Mail Label report (3 x 4 landscape) in crystal reports, after create report how to change its direction like down then across and how change label size and distance between lables. ple. send me the solution it is very useful to me. thanks in advance regards CHANDU

Crystal Reports - Change Currency Format
I've designed some reports that will be used in different areas (Ireland & UK), so my VB app needs to be able to change the report currency format at run time.

I assume you're able to do this using the Crystal Automation Engine, does anyone know of any source for this - must be something that people do quite regularly!

Any links/code appreciated

Thanks

Crystal Reports Won't Accept Change To Default Printer
(VB6, Crystal 9)

I've added all the printers on the computer to a combobox, so the user can select a printer to print from.

I'm using a method i found on this forum, to change the default printer - it stores the default printer, sets the newly selected printer as the default, then re-instates the old default printer. ( I could paste this code, but its a bit lengthy - its the class thats a modification of MSDN's article Q167735).

So i have a custom print dialog, and under the print button i have (where setprinter is the lengthy class):

Dim SetPrinter As New clsSetDefaultPrinter
Dim DeviceName As String
Dim smsg As String

DeviceName = cboPrinter.Text
If SetPrinter.SetPrinterAsDefault(DeviceName) Then
smsg = DeviceName & " -set"
Else
smsg = DeviceName & " -not set "
End If

MsgBox smsg, vbDefaultButton1, ""

MsgBox Printer.DeviceName & vbCrLf & Printer.DriverName & vbCrLf & _
Printer.Port, vbDefaultButton1, ""

MyReport.PrintOut False, 1, False

'destroy instance of printer class to restore printer to default
Set SetPrinter = Nothing

MsgBox Printer.DeviceName & vbCrLf & Printer.DriverName & vbCrLf & _
Printer.Port, vbDefaultButton1, ""
End Sub


See the messageboxes - they show that the default printer is indeed being changed, then restored. Yet the report is still being printed from the "default" printer - that is, its prints like the change never took place, from the original printer, not the newly selected printer.

Now whats most frustrating about this is if i run the above code in a seperate .exe, (a simple combo box which lists printers, and does the above swapping of printers), leave it open after i've changed it to the printer i want, then open the app with the above code in it, it WILL print to the printer that i want to change it to.

I've tried adding the MyReport.PrintOut :

MyReport.SelectPrinter Printer.DriverName, Printer.DeviceName, Printer.Port

But this crashes the app and shuts down vb.

Can anyone help me, i'm getting a bald patch where i'm scratching my head so much.

List Of Printers To Change Printer In Crystal Reports
I need to have a drop down list of all available printers on the computer so the user can change the printer before trying to print a crystal report. I've seen MKosolf's post on how to do it, parsing the chosen printer from a list and getting the driver name and port from that, but my question is how do I get what the driver name and port are into the list in the first place? I populate a list with:


Code:
Dim x As Printer
For Each x In Printers

listPrinters.AddItem x.DeviceName & ", " & x.Port & ", " & x.DriverName

Next

Is this correct?

*Resolved * Dynamically Change Group - Crystal Reports.
.GroupSelectionFormula
.GroupCondition
.GroupSortFields


How can I change the group of a report to a different field...


IE. One time its grouped by id, the next time by name?

Chris

Crystal Reports - Change The Database Connection *RESOLVED*
Me thinks a not so simple question!

Hi,

In VB (.net) you can view your database connection, if you have connected using the wizard in the:

#Region " Windows Form Designer generated code "

and it looks a little something like this:


VB Code:
Me.OleDbConnection1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=ITsMe;Data Source=C:codewh" & _        "ateverMyDatabase.mdb;Mode=Share Deny None;Extended Properties="""";Jet " & _        "OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Database Password=" & _        """"";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Pa" & _        "rtial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Pas" & _        "sword="""";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False" & _        ";Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica " & _        "Repair=False;Jet OLEDB:SFP=False"


This is very nice because I can easily change the Data Source= bit to make it equal whatever database I happen to be using, wherever it is.

Now when it comes to crystal reports, (my reports I have created using Crystal Report Wizard thingy, which I like) I setup where my database is to connect to in the wizard. This would be fine but my database location could change to anything at run time depending on what database the user selects and so I want to be able to change the database source programatically like I am with the database connection thing show above.

The problem is I can't!
I can't find anything like the Me.OleDbConnection1.ConnectionString =...... bit anywhere for the Crystal Report connection and I can't see how else to do it. Any Ideas?

If I connect my Crystal Reports to datasets (so in effect there is no direct databse connection), I get problems using multiple datasets, and a window asking for database username, passwords etc appears when i try to display my report. I really don't want to do it this way.

In the search for my answer I have worked through most threads on this forum and the Crystal Decision Support forums and found nothing of help and so am posting here cos the Crystal Decision Support forums threads hardly ever get replies and you Guys nearly always come up with the goods

Cheers

URGENT Change Dbpath Of Crystal Reports At Runtime
hi,
i was using crystalreports 4.6 with vb6.0 with msasccess as database. Then i protected my database with a password, and i changed the database path for crystal reports at runtime by using
crep.datafiles(0) = "dbpath.mdb"
and
crep.password = "password".
it worked successfully.

Now i upgrade my crystal reports to version 8.0. the same code now not working. It won't allow me to change the db path. It is giving an error "Incorrect session parameters". if database password removed. it is working.

How can i change db path, when it is protected. Help me please

any help can be appriciated.
sanki

Problem With Page Break On Data Change In Crystal Reports 8
Hi all,

I've got a problem with Crystal Reports 8 (not so much a problem, more can't figure out how to do it).


I have a report linked to a Stored Procedure in SQL Server, which returns data ordered by a particular field. This works fine and prints the report in the order shown below

HEADER

XXX
XXX
YYY
YYY
etc.


What I have been asked to do now is make it so that the when the data changes in the "Sort Order" field that we can force a page break so that each group is on a serparate page like below.

HEADER

XXX
XXX
Page Break Here

HEADER

YYY
YYY
etc.

Can someone please advise on how this can be done, as I'm relatively new to Crystal Reports, or point me somewhere that I can find an example.

Thanks in advance,

Mark

**RESOLVED**Dynamically Change TextColor Of Formula In Crystal Reports
I have a formula which resides in a subreport. The results of this formula are either "Pass" or "Fail". I would like the textcolor for the result to be displayed in green for "Pass" and red for "Fail".

Anyone ever done something like this before. Not sure if I should be attempting to change the color in the Initialize event procedure of my main report or handling directly in the formula itself.

Dynamically Change Connectionstring And Database During Runtime /Crystal Reports
hi,
I have to write a prog in which i can decide during runtime which kind of database(MSSQL 7 or Access) my prog is
using. I also have to design my Reports with ADO-Connectivity(no ODBC). The connection String
the database saved in the registry.
So i wrote this piece of code:

set m_rpt = m_appTheApp.OpenReport(m_ReportFileName)

for iTable = 1 to m_rpt.Database.Tables.Count
m_rpt.Database.Tables(iTable).SetLogOnInfo ConnectionString,NameAndLocationOfDatabase , LogInName,Password
m_rpt.Database.Tables(iTable).Location = LocationOfDatabase
If Not m_rpt.Database.Tables(iTable).TestConnectivity = true then
MsgBox "Es ist ein Fehler aufgetreten"
End If
next iTable

'm_rpt.database.LogOnServer "pdsmon.dll", ConnectionString,LocationAndNameOfDatabase, LogInName, Password

m_vntRptPk.AddReport m_rpt
CRVwr.ReportSource = m_vntRptPk
CRVwr.ViewReport



If I do so my prog produces at the line where I call TestConnectivity i've got a Messagebox, titled "Database Error",
with no Messagetext within it. Further after calling CRVwr.ViewReport i've got the same messagebox and a new Messagebox
titled "Crystal Smart Viewer" and the Messagetext "Server has not connect til yet" (hope i translate it correctly).

If I add the line m_rpt.database.LogOnServer ... i've got the also the "Server has not ..." text as above after the LogOnServer-Line

Do anyone of you knows what i've done wrong?
Every help would be highly welcome.

Akademos

Data Reports Active Reports Or Crystal Reports
Hi all

I am really stuck here and i need help urgently
I have to call three tables in a row to print a single invoice entry
noe the problem is if the do it by calling single tables then there is a problem that it is nopt going to print the last order which is filled.Is there is any way it can be done through using sql command or something.
Secondly if i use max order in sql then i would not be in a position to print order after searching for it


Thanx

In Crystal Reports, How To Display Financial Reports (P & L, Balance Sheet Etc.) In Columnar Format
Dear All,

I am developing a Financial application using VB6, MS-Access & Crystal Reports 8.5. I am facing problems in certain reports. Some of the reports like Profit & Loss and Balance Sheet require the output to be printed in columnar format.

I have tried giving subreports for each section, i.e.; Assets & Liabilities, but then, the output is not coming in order as per the groups. The problem is even more where there are sub-sections in the right side column & left side column for example in Profit & Loss, where there are sub-sections for Gross Profit/Loss and Net Profit/Loss. In such cases, how to bring the total amount fields at the same horizontal level.
I hope someone can help me how to do the above.

Thanks in advance.

Best Regards
Mahesh

Need To Understand Data Reports - Heard That Crystal Reports Were Slow
I have two questions:

1.) I was going to take a step forward to learn how to use crystal reports but I heard that on a website they are viciously slow. Is that true or is there a way around that with coding?

2.) I have been using Access reports through Visual Basic 6.0 with the following code - thanks for the tremondous help of everyone on this website:

Code:
appAccess.OpenCurrentDatabase SERVER & "disp-1_be.mdb"
appAccess.DoCmd.Maximize
appAccess.DoCmd.OpenReport "oalog", acPreview
appAccess.Visible = True

The reports work great UNTIL I came accross a situation where the report is based off of the data entry of the user. oalog is a monthly report and in the query it automatically pulls the current month with the following query:

Code:
SELECT oalogallmonths.ctsbranch, Count(oalogallmonths.Amount) AS [Total Of Amount], oalogallmonths.GivebyName, oalogallmonths.United, oalogallmonths.Mayflower, oalogallmonths.Other, oalogallmonths.Tord, oalogallmonths.CURRENTDATE, oalogallmonths.Amount, oalogallmonths.Month1, oalogallmonths.ORDER
FROM months, oalogallmonths
WHERE (((months.monthID)=[oalogallmonths].[Amount]))
GROUP BY oalogallmonths.ctsbranch, oalogallmonths.GivebyName, oalogallmonths.United, oalogallmonths.Mayflower, oalogallmonths.Other, oalogallmonths.Tord, oalogallmonths.CURRENTDATE, oalogallmonths.Amount, oalogallmonths.Month1, oalogallmonths.ORDER
HAVING (((oalogallmonths.Amount)=11;

If you notice the records are pulled HAVING the 11th month in there.

If I want the user to ENTER the month I know that I must change the last line to:


Code:
HAVING (((oalogallmonths.Amount)=[ENTER MONTH]));

But a user might type January or 12/2003, etc...

so I made a combobox named ListMonth of the 12 months.
Then I made the change from:


Code:
HAVING (((oalogallmonths.Amount)=11;
to

Code:
HAVING (((oalogallmonths.Amount)=ListMonth.ListIndex + 1));

The only problem is that I keep getting a message box asking for ListMonth.ListIndex + 1.

My question is in the above code that defines appAccess.DoCmd.OpenReport "oalog"...
is there a way to change the RecordSource of the report to pull from my own query instead of the Access Query?

Thanks,
Stephen

Crystal Reports - Upgraded To 8.5, Now Reports Written In 8.0 Wont't Work!!!
My reports are crashing when I run them on a machine with CR8.5, but they work fine on cr8.0. They crash inside the .DiscardSavedData Routine.


Does anyone know why or what I can do...

I call the report.Printout routine and right after I call the
.DiscardSavedData. The report is still printing out in debug mode.


Please help. Is my syntax wrong. The help file says I can only use Printout and DislcardSavedData in "formatting idle" mode. I don't know what this this???? The .PrintOut routine works but not the discardsaveddata.


Thanks,

Any help is appreciated.


M

How To Use Crystal Reports To Make The Dynamic Reports?(I Can't Use The Design Expert To D
  How to use Crystal Reports to make the dynamic reports?(I can't use the design expert to design the report,because the data source with different fields is unknown in design time.)
     Hello all!
     I use the dynamic generating MS Access table as the Data Source of Crystal Report.
How to use the Crystal Reports to display the data of the dynamic generating MS Access table?
     Thanks All!
                                                    China






Edited by - dehuiworkroom@hotmail.com on 12/17/2003 9:37:59 PM

Crystal Reports- I Need Help Running Reports With A Shared Database.
I am trying to figure out how to use a shared database in crystal reports. I have it set up for my application were I use: App.Path +
"databaseWMdbase.mdb" But in crystal reports it makes you use a drive name. I am trying to use the UNC but when I run it on the computer without the physical database it tells me Database not found... is there a way to set the Location of the database in the form load like you do with ADO? Any help or Ideas would be great.

I Hate Reports. Trash Crystal Reports, Access Instead?
I am creating an app which requires a copius amount of complicated reports. These reports would be an absolute breeze to do in access, simply create a query that does all the work then base the report on that. Instead of wasting time with Crystal Reports, I'd love to be able to create an access query and then run an access report based on that query from within my VB app. Now I have code that allows me to run an access report, but it seems to require that access is open on the users machine at that time. Is there any way I can achieve what I need without opening access each time ?

Export Reports Created Using Crystal Reports 8.5 To MS Excel
i would like to know if there is a way out to export reports created using Crystal reports 8.5 to MS Excel directly with out the user doing it manually, by coding in VB6.0.
If yes please give me the codes.

Crystal Reports Using ActiveX Viewer For URL Linked Reports
Hi,

We have a IIS service that broadcasts a virtual directory of reports so that they can be viewed using the crystal reports ActiveX viewer through an IE browser.

I am now trying to replicate this setup on another server, the IIS service is setup and URL's created for our reports.  When they are selected the browser defaults to the Crystal Enterprise logon screen.  Where do i change the settings so that the ActiveX viewer is used in the browser to view the report?

Many thanks,

Al

Retrieving Images In Crystal Reports And Data Reports
I am saving the image path in the database and retrieving it for display but the problem is when I want to print the image for that particular record when I am only saving the image path in the database.

If I embed the image in the database it increases the size of the database but can be used in the reports in a bounded image control.

If somebody can help me retrieve the image in a data report/crystal report by using the image path in the database that did be great.

Thanks,
Kamran

Grouping Records In Data Reports / Crystal Reports
Hi

I want to group records in my Data Report based on 2 particular fields. Just see the example below.

Below is the Table Structure and its values

UnitID Part Quantity
1 xx 5
1 xy 10
2 xx 5
2 xy 10


Now I want to result to show the summation of quantities based on the part only.

so the result should be

Part Quantity
xx 10
xy 20

It would be fine if someone can tell me how to do this in Crystal report/ VB data reports


Thanks
Kumaran

Anybody Know How To Get Crystal Reports 10 Reports Working In VB Studio 6?
It seems that there are a few posts regarding Crystal Reports 10...few from me. However there are 0 responses dealing with any really developer issues. Has anybody moved to using CR10 or are you people still using 8.5 or another version. Could you tell me what version you guys are using so that I will stop posting issues about CR10

Crystal Reports, Printing Data Reports
how do you filter records in Crystal Reports using a variable? I'm using Crystal Reports ver. 4.6.1 Why does a time field shown as mm/dd/yy when it should be hh:mm? Is there an easy way to print data reports with filtering or conditions in vb?

Problem Accessing Reports In Crystal Reports 9.0 From VB
Hi.  I use the following code in a number of VB apps to execute Crystal Reports.  It has worked fine with CR 7.0 and CR 8.0.  Now, with upgrade to 9.0, code will not work.  Error message is "Unable to load report".

I've played around with some of the references and componenets for 9.0, but haven't had any success.  Anyone encountering same problem?  Any workaround without incorporating the crystal viewer?  Any help would be greatly appreciated.

Thanks.  TM.

-------------------------------------------------
Public Sub PrintCrystalReport(CrystalReport As Object, _
                              Optional ReportName As String, _
                              Optional criteria As String)
On Error GoTo problems
    Dim i As Integer
    Dim n As Integer
    Dim a As Integer
    Dim response As Integer
    
    With CrystalReport
       .Connect = "DSN=" & strCurrentServer & ";UID = crystalreports;PWD=crystalreports;DSQ=" & strCurrentDatabase
       .ReportFileName = App.Path & "Reports" & ReportName
       For i = 0 To .GetNSubreports - 1
            .SubreportToChange = .GetNthSubreportName(i)
            .Connect = "DSN = " & strCurrentServer & ";UID = crystalreports;PWD =crystalreports;DSQ = " & strCurrentDatabase & ""
       Next
       .SelectionFormula = criteria
       .WindowState = crptMaximized
       response = MsgBox("Would you like this report sent to the printer?", vbYesNo, "Send Report To Printer")
       .PrinterSelect
       If response = vbYes Then
          .Destination = crptToPrinter  'Print to the Screen
       Else
          .Destination = crptToWindow    'Print to the window
       End If
       .Action = 1
    End With
    Exit Sub
problems:
    MsgBox "There was an error trying to print this report.", vbCritical, "CRYSTAL REPORT ERROR"
    MsgBox Err.Description
End Sub

Problem With Crystal Reports 8.5 Chart Reports
Hi All,

I had a problem with crystal reports 8.5 chart reports.
Iam using chart reports and included in the setup. The application shows all other reports except the chart reports.
Can anyone help me in solving this problem.
Are there any specific dlls to be included into the setup for crystal report chart graphs?

Thanls & Regards
Osman

Crystal Reports : Page Total In Sub-Reports
I have Main-Report like this
The columns 1-3 are Sub-Report(1), Column 4 is Sub-Report(2) and Column 5 is field of Main Report only.

-------------------------------------------------------
 (1)......(2).........(3)............(4)............(5)
Sl.No. Name Gross(Nov) Gross(Oct) Difference
-------------------------------------------------------
1........Mary........2300.......2200......

2........John........1500.......1400......

3........Jim.........1000.......1200......

4........Mike........3000.......3200......

.. ..... .... ....


10.......Rosy.......4000.......4500......

-----------------------------------------
Total C/F Rs. .......???........???........
-----------------------------------------

I want the Difference Amount of Column(3) and Column(4)for every Record. How to achieve this?


At the same time I also want the Page Total of Column(3) and (4)at the page footer of Main Report(not the Grand Total).


 

View Reports Made By Crystal Reports
Hi Dear Friends,
I am using Crystal Reports 9.0. I want to view the reports from Visual Basic. But it is giving error. Say my database name is internship.mdb. My report file name is report.
I bring a control to my form named Crystal Report Control, (Need any more?). I set the database name the property of the control and everything. But it is still giving error.
I write the code behind the button "cmdreport" "report.action=1" (This works in CR 5.0).
But giving error "Unable to load report". Any body can help me.

Thanks,

Mamun

Crystal Reports..opening Reports Runtime
hi
I want to know is there anyway where i can make a query and attach that recodset to the report .I dont know much about ttx and would like to write the code with opening a crystal report application.
I have just added a reference of Reports dll and dont want to use Crystal Report control in the project.
I have made report with ADO option.
hopefully someone helps me in this direction
Thnaking you

Reports With Only Access 2000 & Crystal Reports Without VB?
Hi,

I have not had a chance to read Crystal reports literature and I have never used it but I will ask anyway . Is it possible to create reports using only Access 2000 (as the database) and Crystal Reports (8.5) without the use of Visual Basic (6.0)? If so how and does anyone have a sample code?

Displaying Reports Dynamically With Crystal Reports 8
I've made an upgrade from CR 7 to CR 8 and as i tried my programms an error message occured. Here's the code:

public Function bOpenReport(CRVwr as CRViewer,as string, Report as string) as Boolean
on error GoTo bOpenReport_Err



set m_appTheApp = nothing
set m_appTheApp = new CRAXDRT.Application

Debug.print ReportName
set m_rpt = m_appTheApp.OpenReport(ReportName)
set m_vntRptPk = new ReportSourceRouter
m_vntRptPk.AddReport m_rpt
set m_rpt = nothing
CRVwr.ReportSource = m_vntRptPk 'Connect Control with Report


CRVwr.DisplayGroupTree = false
CRVwr.DisplayToolbar = false

CRVwr.ViewReport 'Display Control
bOpenReport = true
Exit Function
bOpenReport_Err:
Select Case Err.Number
Case -2147206452 'Datei ist schon geöffnet
CRVwr.Refresh

Case else
MsgBox Err.Description & vbCrLf & Err.Number
End Select
bOpenReport = false
End Function




With this code i could display different reports dynamically during runtime. Now with the now CRViewer Control of CR 8 the error message "Memory full" occured. After calling this function bOpenReport i have following line of code:

crvReportManager.ShowLastPage 'Show the last page of the current report in the CRViewer control



After this it reloads the report as it should do in bOpenReport without printing a error message.
But if i delete the line crvwr.showreport

in the bOpenReport function my program crashed.
Does anyone have an idea how the CR 8 CRViewer-Control displays reports dynamically?

Akademos

Change Change ODBC Connection To Call A Crystal Report From VB6 App
I have a DSN set to D_2002.MDB Access database. I have created a crystal report based off of this ODBC connection. In my VB6 APP, the user might want to run the report off another database D_2004.MDB. How do I change the ODBC connection to D_2004.MDB and run the report off D_2004.MDB.


Any help is appreciated!!!
Sudha

Dynamic Crystal Reports In VB Using Crystal Viewer Control
hi,
my problem is i m new to crystal reports. I have prepared a application in vb 6.0 which is used for printing bills. When enter all the particulars and press print the crystal viewer is showing only the first bill which was saved. wat i want wen i give the print command the viewer shud show the present bill, so it can be printed.



thanks!!

How To Dynamically Change The Login Info Of A Crystal Report Using Crystal Query File
Hi,

How can I dynamically change the login information of a Crystal Report that uses a Crystal Query File (*.qry) to retreivee it's data using VB.NET?

It works fine when the report is built on regular table links generated within the Report Designer, I simply use the following :

Dim myLogonInfo As New CrystalDecisions.Shared.TableLogOnInfo()
myLogonInfo.ConnectionInfo.ServerName = UCase(SelectedDB.GetName) & "_ODBC"
myLogonInfo.ConnectionInfo.DatabaseName = UCase(SelectedDB.GetName)
myLogonInfo.ConnectionInfo.UserID = UCase(usr)
myLogonInfo.ConnectionInfo.Password = UCase(pwd)

(...)

CReport.Database.Tables(i).ApplyLogOnInfo(myLogonInfo)
MessageBox.Show(CReport.Database.Tables(i).TestConnectivity())

But when the Data is retreive using a query file it crashes.
Any ideas?

Thanks.

How To Use Crystal Reports Without Using Crystal Report Control
Hi..

I want to program a DLL for using Crystal Reports. Since this isn't a Form, I couldn't use the Crystal Reports control... how can I do it then?

Thanks
Jaime

Do Dynamic Reports With Vb Vs Crystal Reports
I'm interesting to do one dynamic report based on change their information along the time. It depends on the selected items... then If I select more items, the report must show more subreports. Each one of them contain the information of item selected.

Any code idea to begin ? ?... I'm coding with vb and crystal reports.
I appreciate your help.
Have a nice day.

Scheduling Reports (Crystal Reports 9 Or 10)
I have a report that I did using CR which connects to a SQL Databse via ODBC. I need it to run every day at 6:00 am and email a person. The query on the report also has to show all data from the last 24hours. Can someone please help me in the right direction??

Crystal Reports Vs Access Reports
I do not know a lot about Crystal Reports but I was wondering what some of the advantages may be for using Crystal Reports over the report feature in Access to create my reports from my Access database? Thanks!

Printing Reports From VB 6 Using Crystal Reports
I have delveloped an application for invoice generation and printing.
I have 2 tables(MS ACCESS), first will store invoice details and the second will store item details of invoice like serial no, description, qty, rate and value.
for a given invoice there will be 4-5 items.

In the crystal report(ver 7), I have linked first table containing invoice details with the second table containing invoice item details.

The item details are printed in the detail structure part of crystal report.

The problem is when I print the report, the report generates individual invoice for each item rather than one invoice for all the items.

I wish someone could rectify this error and enable me to implement the software

Regards

NSNRao

Reports In Crystal Reports, Access And VB???
Hi All,

I want to know the difference between reports in crystal-reports, Access and VB. I know that crystal reports give maximum flexibility but how to justify that which one to use?? If I'm having reports in Access then do every client machine require Access installed to run the report ??? What happens when scenario is for VB or crystal reports ?? Does anyone know about online document to read about this more ??

Thanks



Edited by - cocacola on 6/9/2004 2:03:26 PM

Refreshing Reports With Crystal Reports
I am trying to use Crystal reports that ships with VB6. I can't find much information on how to use the different methods available. I created the report and it looks fine but when I change the data that the report is based on. The report does not show the current data it only shows the data that existed when I initially created the report.

If I use the Refresh button then the data is refreshed and shows correctly. How do I get the report to refresh prior to printing? Or is there a correct way to do the coding to ensure that the data being displayed is the most correct?

Copyright © 2005-08 www.BigResource.com, All rights reserved