redistribution crystal report with application
hi babu,
i using crystal report 6.0 for my project. i don't know what are the fiels needed to redistribute the crstal report with my application package. i take setup for the project using package & deployment of visual studioi .net. any one help to me. how to do this.
thanks in advance.
Murali.M
Setting database path at Run-Time for Crystal Report
Hi Babu,
I've designed a report based on a ADO database using a connection string. While building the connection string I pointed out the database from which the data is extracted.
The report runs on the development machine no problems, but when I try to run it on a deployment machine I get a Database Error:
"[Microsoft][ODBC Microsoft Access Driver] '(Unknown)' is not a valid path. Make sure the path name is spelled correctly and that you are connected to the server on which the file resides".
I assume that the report tries to look for the database where it was at the design stage.
My question is: how can I set the database's path at run time?
Server has not been opened yet?
Hello Mr. Babu and dear friends al around the world. I'm new one to Crystal Report. I developed using VB 6.0, Crystal Report 8.5 and SQL Server 2000. Please take a look at my codes below (VB Code and SQL Code - Stored Procedure) :
'The code in VB
Private Sub cmdPrint_Click()
If cmbAccount.Text = "All Account" Then
NoAccount = "%"
Else
NoAccount = cmbAccount.Text
End If
‘The codes for crystal report begin here….
Dim rptDeposit As New CrystalReport1
rptDeposit.Database.LogOnServer "pdsodbc.dll", "aan", "MoneyMall", "aan", "icandoit"
rptDeposit.EnableParameterPrompting = False
rptDeposit.ParameterFields(1).AddCurrentValue NoAccount
rptDeposit.ParameterFields(2).AddCurrentValue dtpStartDate.Value
rptDeposit.ParameterFields(3).AddCurrentValue dtpEndDate.Value
CRViewer1.ReportSource = rptDeposit
CRViewer1.ViewReport
End Sub
'The code in SQL, I generated CrystalReports1 from this stored procedure which has 3 parameters, using standart expert report wizard. (i'm using "add Crystal Report 8.5" from VB Menu :
This is my store procedure in SQL Server 2000 :
PROCEDURE PrintDeposit
@NoAccount nvarchar(10), @StartDate datetime,
@EndDate datetime
AS
SELECT * FROM Deposit
WHERE NoAccount LIKE @NoAccount AND
(DAY(MarginTime) BETWEEN DAY(@StartDate) AND DAY(@EndDate)) AND
(MONTH(MarginTime) BETWEEN MONTH(@StartDate) AND MONTH(@EndDate)) AND
(YEAR(MarginTime) BETWEEN YEAR(@StartDate) AND YEAR(@EndDate))
Order By MarginTime
Error Message in VB : "The Server has not yet been opened !" and i can not see the report in the viewer!
What did I do wrong? Please note that this is my server info :
data source=aan
user id=aan
password=icandoit
initial catalog=MoneyMall
Please, tell me the answers! I almost blown up to think all these!
Thank U so much for your help!
Re: Server has not been opened yet?
Hi,
1. ParameterFields(n), index should start from 0,1,2,...
2. "ParameterName; NewValue; SetCurrentValue"
Eg. CrystalReport1.ParameterFields(0) = "DatePar;Date(1998,12,7);TRUE"
Regards,
K.Babu
Quote:
Originally posted by aan_handoko
Hello Mr. Babu and dear friends al around the world. I'm new one to Crystal Report. I developed using VB 6.0, Crystal Report 8.5 and SQL Server 2000. Please take a look at my codes below (VB Code and SQL Code - Stored Procedure) :
'The code in VB
Private Sub cmdPrint_Click()
If cmbAccount.Text = "All Account" Then
NoAccount = "%"
Else
NoAccount = cmbAccount.Text
End If
‘The codes for crystal report begin here….
Dim rptDeposit As New CrystalReport1
rptDeposit.Database.LogOnServer "pdsodbc.dll", "aan", "MoneyMall", "aan", "icandoit"
rptDeposit.EnableParameterPrompting = False
rptDeposit.ParameterFields(1).AddCurrentValue NoAccount
rptDeposit.ParameterFields(2).AddCurrentValue dtpStartDate.Value
rptDeposit.ParameterFields(3).AddCurrentValue dtpEndDate.Value
CRViewer1.ReportSource = rptDeposit
CRViewer1.ViewReport
End Sub
'The code in SQL, I generated CrystalReports1 from this stored procedure which has 3 parameters, using standart expert report wizard. (i'm using "add Crystal Report 8.5" from VB Menu :
This is my store procedure in SQL Server 2000 :
PROCEDURE PrintDeposit
@NoAccount nvarchar(10), @StartDate datetime,
@EndDate datetime
AS
SELECT * FROM Deposit
WHERE NoAccount LIKE @NoAccount AND
(DAY(MarginTime) BETWEEN DAY(@StartDate) AND DAY(@EndDate)) AND
(MONTH(MarginTime) BETWEEN MONTH(@StartDate) AND MONTH(@EndDate)) AND
(YEAR(MarginTime) BETWEEN YEAR(@StartDate) AND YEAR(@EndDate))
Order By MarginTime
Error Message in VB : "The Server has not yet been opened !" and i can not see the report in the viewer!
What did I do wrong? Please note that this is my server info :
data source=aan
user id=aan
password=icandoit
initial catalog=MoneyMall
Please, tell me the answers! I almost blown up to think all these!
Thank U so much for your help!
Searching text in subreports
Hello Mr. Babu and everyone;
I'm relatively new to CR. I'm using CrustalReportViewer for windows forms to view a report. The report has subreports in it, they are not on-demand so they appear as a large,single,multiple-section report to the user.
When I perform a text search on this report, the data of the subreports are not searched, their titles are searched only. Is it possible to make the find dialog (or crystalreportviewer.SearchForText()) search the whole report?
Thanks everyone in advance
capture parameter past and store to textbox
I created a parameter passing in crystal reports so user can enter what records need to be printed i.e idnumber, is there a way to capture the parameter passed to a textbox.
10x
cyrus
using Crystal Report Viewer Control 9 in VB.NET
Hi,
I am trying to use a Crystal Report Viewer Control 9 (that comes with Crystal Reports 9 Developers Vs) in my VB.NET application.
I have Crystal Reports 9.0 developers installed on my development machine, so I think I have all of the necessary dlls.
In my project, I got into toolbox - Components, browse to add Crystal Report Viewer Control 9 to my components list(crviewer9.dll).
I put the control on my form,
Friend WithEvents AxCRViewer92 As AxCRVIEWER9Lib.AxCRViewer9
it's initialized,
and then I add my own code to view the report after the user selects the report from the dialog box:
me.AxCRViewer92.ReportSource = dlg.FileName
me.AxCRViewer92.ViewReport()
it all compiles,
but when I run this app, first of all, my control comes up on the screen as a white rectangle.
and after I try to open the report, I get the following:
An unhandled exception of type 'System.InvalidCastException' occurred in axinterop.crviewer9lib.dll
Additional information: No such interface supported
I'm new to Crystal Reports, and I would really appreciate any help on using this Crystal Report Viewer Control 9. So far, I hasn't been able to find any info about it from Crystal Decisions. I need to use this control, and not the CrystalReportsViewer that comes with .NET because of some internal company issues.
Thanks.
recordset as datasource of crystal report
Im using Crystal report 8 and VB6, my problem is how can i make the Crystal report get the record from the recordset i made. The problem is when i run the report it shows all the record from the table. How can i make the report show only the content of the recordset?
Below is the code im using. dcCategory is datacombo.
Code:
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Set cnn = New ADODB.Connection
cnn.Open "File name=c:\Product.udl"
Set rst = cnn.Execute("select item_no,item_category,Item_desc,Item_unit,item_price from tblitems where item_Category ='" & dcCAtegory.Text & "'")
Dim crystal As CRAXDRT.Application
Dim treport As CRAXDRT.Report
CRViewer1.DisplayBorder = False
CRViewer1.DisplayTabs = False
CRViewer1.EnableDrillDown = False
CRViewer1.EnableRefreshButton = False
Dim crxApplication As New CRAXDRT.Application
Set crystal = New CRAXDRT.Application
Set treport = crystal.OpenReport("d:\application\list.rpt")
treport.DiscardSavedData
treport.Database.SetDataSource rst
CRViewer1.ReportSource = treport
CRViewer1.ViewReport
When i design the report using crystal report designer i use the table as the datasource and i did not set anything else. Could this be the problem?
Thanks in advance!!!
Package and deploying in VB
Hello Babu, thanks for your last help. Even if the property dosn't match at all (I'm using property of report.formulafields(1).text to set the formula) but it does gave me the idea. thanks a lot :)
Now, I'm having a new problem. When I tried to package and deploy my VB-Project that contains CR inside, I found that there is "nothing happened", means that in the Package folder, the Package and Deployment Wizard doesn't make any files for installation setup, not even one!!!!
But when I try to package a project that doesn't contain CR inside, it does works! Why so strange?
Please notice that I'm using Crystal report 8.5, Visual basic 6.0 SP 5. Why the package and deployment wizard doesn't work for my project with cr inside? Please, reply this soon... I'm also surfing to another web to get the answers... thank you!
Regards
Aan Handoko
Re: Package and deploying in VB
Hi,
Yes, I also face the same problem, which you mention bellow regarding package wizard, I don't want to R&D why package wizard not support that, so that, i written the setup script in Install Shield.
You can try by change the VB setup project manually. you have to Include all the crystal report runtime files in cab file. which is mentioned in Crystal Report Developer Runtime help document.
Note: Keep in mind, what are the files you have to register with regsvr32.exe, This details are mentioned in Developer runtime help document file.
Thanks,
K.Babu.
Quote:
Originally posted by aan_handoko
Hello Babu, thanks for your last help. Even if the property dosn't match at all (I'm using property of report.formulafields(1).text to set the formula) but it does gave me the idea. thanks a lot :)
Now, I'm having a new problem. When I tried to package and deploy my VB-Project that contains CR inside, I found that there is "nothing happened", means that in the Package folder, the Package and Deployment Wizard doesn't make any files for installation setup, not even one!!!!
But when I try to package a project that doesn't contain CR inside, it does works! Why so strange?
Please notice that I'm using Crystal report 8.5, Visual basic 6.0 SP 5. Why the package and deployment wizard doesn't work for my project with cr inside? Please, reply this soon... I'm also surfing to another web to get the answers... thank you!
Regards
Aan Handoko
Re: using Crystal Report Viewer Control 9 in VB.NET
Hi,
You can't assign report file name directly to reportsource.
me.AxCRViewer92.ReportSource = dlg.FileName
Use the following code sample
Dim crrpt As New CRAXDRT.Report
Dim crapp As New CRAXDRT.Application
Set crrpt = crapp.OpenReport("D:\quotation.rpt")
crrpt.Database.Tables(1).Location = "D:\Mydata.mdb"
crrpt.Database.Tables(1).SetLogOnInfo "CRSS", "mydata.mdb", "Hello", "hi"
CRViewer1.ReportSource = crrpt
CRViewer1.ViewReport
Quote:
Originally posted by alfiya
Hi,
I am trying to use a Crystal Report Viewer Control 9 (that comes with Crystal Reports 9 Developers Vs) in my VB.NET application.
I have Crystal Reports 9.0 developers installed on my development machine, so I think I have all of the necessary dlls.
In my project, I got into toolbox - Components, browse to add Crystal Report Viewer Control 9 to my components list(crviewer9.dll).
I put the control on my form,
Friend WithEvents AxCRViewer92 As AxCRVIEWER9Lib.AxCRViewer9
it's initialized,
and then I add my own code to view the report after the user selects the report from the dialog box:
me.AxCRViewer92.ReportSource = dlg.FileName
me.AxCRViewer92.ViewReport()
it all compiles,
but when I run this app, first of all, my control comes up on the screen as a white rectangle.
and after I try to open the report, I get the following:
An unhandled exception of type 'System.InvalidCastException' occurred in axinterop.crviewer9lib.dll
Additional information: No such interface supported
I'm new to Crystal Reports, and I would really appreciate any help on using this Crystal Report Viewer Control 9. So far, I hasn't been able to find any info about it from Crystal Decisions. I need to use this control, and not the CrystalReportsViewer that comes with .NET because of some internal company issues.
Thanks.